Some accounts in your SaaS aren't your customers'. They're yours: the Slack workspace your alerts go to, the enrichment API you pay for, your own SMTP relay.

When a customer builds an automation that needs one of those, you have two bad options. Ask every customer to paste the same API key (pointless), or hand each of them a copy they can rotate or delete (worse).

What you want is one connection that every user can pick and nobody but you can touch. In ByteChef Embedded that's a shared connection: one switch in the admin UI, two flags in your frontend.

This is part 15 of the ByteChef Embedded series. The full version, with every endpoint and edge case, is on the ByteChef blog.

Two kinds of accounts

For each connected user, ByteChef computes the set of connections they're entitled to in their environment. It has two halves:

Owned by the user Shared by you
Created by The user, or the Connect dialog for their integration instances You, under Embedded → Connections with Shared Connection on
Who sees it Only that user Every connected user in the environment
Who can change it The user and your admins Only your admins
Flags shared: false, editable: true shared: true, editable: false

The server enforces that set everywhere a user lists or picks a connection. Ask it to wire anything else into an automation and you get 400 Bad Request.

Ownership decides what a user can change. Entitlement decides what they can use.

Where sharing fits

A connection can reach a connected user's workflow four ways:

Approach Set up by The user... Use it when
User's own connection The user Authorizes their own account The automation acts in their tools
Shared connection You, once per environment Picks your account next to their own One account of yours serves everyone, and users may still bring their own
Provided Values You, per automation configuration Sees Provided by your administrator, picks nothing Every user of that automation must use your account
Provisioned for one user You, from Connected Users Gets an account you entered for them alone You onboard a specific customer by hand

The middle two are easy to confuse. A shared connection is an option in the user's pickers. A provided connection is a decision: users never see a choice. This post is about the option.

Share a connection

Sharing is an admin action in the ByteChef UI. No public embedded endpoint creates or shares vendor connections.

1. Pick the environment. Connections belong to one environment (Development, Staging or Production), selected in the sidebar header. A connection shared in Development is invisible in Production, so share one per environment, each with that environment's credentials.

2. Create it with the switch on. Open Embedded → Connections and click Create Connection. Pick the component, give it a name users will recognize (pickers show only the name, so Acme Ops Slack beats slack-prod-2), turn on Shared Connection, fill in the credentials and save.

The Create Connection dialog for Slack, named Acme Ops Slack, with the DEVELOPMENT environment badge and the Shared Connection switch turned on above the credential fields

3. Or share one you already have. The same switch is in Edit Connection. Turning it off removes the connection from users' lists and pickers right away (but doesn't rewire automations already using it; more on that below).

4. Read the list. Shared connections get a Shared badge. The status badge reads Active when something uses the connection and Not Active when nothing does yet, so a brand-new shared connection stays Not Active until a user picks it. It reports usage, not reachability. Bad credentials show up as INVALID instead.

The Embedded → Connections list: Acme Ops Airtable with Not Active and Shared badges, an unshared Acme Sandbox Airtable below it, and other connections with Active or Not Active badges

To rotate credentials, open Edit → Update credentials. The connection keeps its ID, so every user's automation picks up the new key on its next run. That's the point of sharing, and its risk.

Only ByteChef admins can do any of this, and the page lists only your connections. Connections owned by connected users never appear there, so you can't accidentally share one customer's account with the others.

The entitlement rule

Here's exactly what goes into a connected user's list, in order:

  1. Connections of the user's enabled integration instances, newest first
  2. Connections the user created, newest first
  3. Connections of the user's disabled integration instances
  4. Every shared connection, newest first

Then ByteChef keeps only embedded connections in the user's environment.

The order matters. When ByteChef picks a connection on the user's behalf, it takes the first one that fits, so a user's own account always wins over yours.

Reading the list from your frontend

The connected user's JWT is all you need:

GET /api/embedded/v1/components/slack/connections?connectionIds=1051,1062 Authorization: Bearer <connected user's JWT> X-Environment: DEVELOPMENT 

Drop the component path (GET /api/embedded/v1/connections) to get everything the user is entitled to. connectionIds is optional, and IDs the user isn't entitled to are silently dropped. X-Environment defaults to PRODUCTION, so send it explicitly while you develop.

[ { "id": 1062, "name": "My Slack", "componentName": "slack", "credentialStatus": "VALID", "shared": false, "editable": true }, { "id": 1051, "name": "Acme Ops Slack", "componentName": "slack", "credentialStatus": "VALID", "shared": true, "editable": false } ] 

Credentials never come back. Two flags should drive your UI:

  • shared describes the connection. Label it in pickers: "Provided by Acme", a badge, an icon.
  • editable describes the caller's rights. Show Reconnect and Delete only when it's true.

An INVALID connection the user owns is theirs to reconnect. An invalid shared one is yours to fix.

Your backend can read the same list for any user with your environment's API secret key:

GET /api/embedded/v1/{externalUserId}/components/slack/connections Authorization: Bearer <your API secret key> X-Environment: DEVELOPMENT 

Letting users manage their own

Users still create and maintain their own connections, all with their JWT:

Method and path Does Returns
POST /components/{componentName}/connections Creates a connection owned by the user 200 with the new ID; 403 if the JWT forbids it
DELETE /connections/{id} Deletes a connection the user owns 204; 404 if missing or not theirs; 409 while an automation uses it
POST /connections/{id}/reauthorize Replaces the credentials, keeps the ID 204; 404 if missing or not theirs

There's no shared field on create: whatever a user sends, their connection is private to them. And a shared connection looks exactly like a missing one to delete and reauthorize (404), so users can't probe or remove yours.

Keeping users on your accounts

Sharing adds your account to every user's list without stopping them from adding their own. When your plan only includes the Slack workspace you run, lock it down in the JWT:

const payload = { sub: externalUserId, name, iat: Math.floor(Date.now() / 1000), connectionDialogAllowed: false, }; 

With the claim set to false:

  • The embedded workflow builder offers only existing connections and drops its Create Connection button.
  • POST /components/{componentName}/connections answers 403, enforced on the server.
  • The Automation Hub's activation dialog hides its Connect button (UI-only).

It must be a real boolean; the string "false" makes the token invalid. The SDK has a prop with the same name (required on EmbeddedWorkflowBuilder, optional on AutomationHub in @bytechef/embedded 0.4.0). The prop can take permission away in the UI but can't grant what the token denies. Decide in the token, then pass the same value as the prop.

In ByteChef's embedded UI

If you embed ByteChef's own UI, all of this is already wired up.

Automation Hub → Connections tab. A table with Name, App, Created and Shared columns. Shared rows get a Shared badge and no actions menu. The user's own rows get Reconnect and Delete, plus a Reconnect needed badge when credentials go invalid.

The Automation Hub Connections tab in the sample app: a table with Name, App, Created and Shared columns listing the user's own Gmail and Slack connections, a dash under Shared, two Reconnect needed badges and an actions menu on each row

Activation dialog. Each app gets a Select a ... account dropdown, with your shared connection next to the user's own. Nothing is preselected. One catch: the dropdown only appears when that app has an integration with an enabled instance configuration in the environment. No integration, no picker, even if a perfectly good shared connection exists. If you don't want an integration, use Provided Values instead.

Embedded workflow builder, Custom Workflow Builder, New from Chat. All call the same endpoint, so your shared account shows up everywhere without new code.

How automations pick a connection

When a user activates a template, the request can name a connection per component:

POST /api/embedded/v1/automation/workflow-templates/{workflowUuid}/provision Authorization: Bearer <connected user's JWT> X-Environment: DEVELOPMENT Content-Type: application/json { "connections": { "slack": 1051 } } 

For each connection slot, ByteChef works down this list:

  1. A provided connection wins. Naming that component anyway answers 409.
  2. Then the requested one, if the user is entitled to it. Otherwise 400.
  3. Then the current one, if the user already has a reference and it's still entitled.
  4. Then the first entitled connection for the component, in entitlement order.

Step four is where the ordering pays off: a user with their own Slack account gets theirs, and a user without one gets yours. "Share a default, let users override" is a real pattern, not a UI trick.

Seeing it from the admin side

When a customer asks "which Slack account is my automation using?", open Embedded → Connected Users, pick the user and switch to the Connections tab. Each row has an origin badge: Self-created, Provisioned (you made it for them) or Internal (one of your shared connections).

A connected user's sheet on its Connections tab, listing Gmail and Slack connections with Integration and Self-created badges

Gotchas

  • One save, every user. New credentials apply to every connected user at once. Rotate like any production secret.
  • Usage blocks deletion, for you too. Move automations off a shared connection before deleting it.
  • Unsharing doesn't rewire. Existing automations keep their wiring until ByteChef next resolves their connections, then pick another or pause.
  • Sharing is per environment. Promoting from Development to Production needs a shared connection in Production too.
  • Upgrading from SDK 0.3? Delete the sharedConnectionIds prop. It never did anything and 0.4.0 removes it.

Who owns what

You own: which accounts to share, what to call them, and whether each app is shared, provided or left to users.

ByteChef owns: the entitlement merge, the ownership and admin checks, and a Hub, builder and activation dialog that respect all of it.

Your part is one switch in a dialog and two flags in your UI.

Next up in the series: Permission Expressions and Internal-Only Inputs, for filtering which integrations, automations and inputs each user sees at all.

ByteChef is an open-source workflow automation and AI agent platform (Apache 2.0). Star it on GitHub and read the full guide on the ByteChef blog.