Skip to main content
POST
create-connection

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
type
enum<string>
Available options:
connector,
mcp,
browser
name
string
meta
object
authOptionKey
string
oauthClientId
string
key
string | null
Required string length: 1 - 100
integrationKey
string
connectorId
string
connectorUuid
string
connectorKey
string
connectorVersion
string
externalAppId
string
externalAppUuid
string
credentials
any

The authentication result the connector produces from input and connectorParameters when the connection is established — a token, a header, a signed value, whatever that connector’s auth code returns. Encrypted at rest and never echoed back. A value a person supplies is an ingredient of this, not this: it belongs in input or connectorParameters, whichever auth schema declares it, and the connector derives credentials from it on connect.

connectorParameters
any

Values for the auth option’s connectorParametersSchema — app-level configuration shared by everyone using this connector, such as an OAuth client id, client secret, or scope list. A JSON object keyed exactly as that schema declares — the object itself, never a string containing it; read the schemas from connection-options. Replaces the stored object, so a key you omit is dropped: to keep a stored value, send back the { set: true } marker get-connection returned for it. Writing this does not authenticate the connection.

input
any

Values for the auth option’s inputSchema — what the connect form asks a person for, such as an API key, an account subdomain, or an API URL. A raw access token belongs here too when the schema declares one. A JSON object keyed exactly as that schema declares — the object itself, never a string containing it; read the schemas from connection-options. Replaces the stored object, so a key you omit is dropped: to keep a stored value, send back the { set: true } marker get-connection returned for it. Writing this does not authenticate the connection.

intent
string

[Experimental] Intent-based instruction for an agent to configure this element.

connector
object

Inline connector spec. Creates and links one when no connectorId exists; otherwise updates the linked connector.

externalApp
object

Inline external-app spec. Creates and links one when no externalAppId exists; otherwise updates the linked app.

appUrl
string

URL or domain of the app to connect to (e.g. "https://slack.com" or "slack.com"). Resolved to an external app server-side before creating a connection.

Required string length: 1 - 2000
buildingAgentSessionId
string

Agent session building this connection. The element’s BUILDING state is projected from it, and a later build for this connection reuses that session instead of starting a second one.

Response

200 - application/json

Create a connection to an external app. Target it by connector/integration/app id, by appUrl (e.g. "https://slack.com", resolved server-side), or by type: "mcp" with input: { mcpServerUrl } — a connector-less connection whose operations arrive as tools. ALWAYS creates a new one: to act through an existing connection find it with list-connections; to finish or repair one use update-connection or offer connect. Pass input / connectorParameters for configuration the connector declares; never pass a credential — an API key, token, client secret or password is refused here, because tool arguments are stored in the transcript verbatim. To get a credential onto the connection, create it without one and offer connect, which writes what the person enters straight to that connection. If the app has no connector, build one from its API docs and pass connector (and externalApp) by value here — creating both together, docs preserved; do it inline, never hand the build to another session. Returns the connection with its projected state and ask. For a user-facing button, offer connect.

id
string
required

Internal database ID of the element. Assigned by the API; unique per element.

name
string
required
status
enum<string>
required

Lifecycle status. broken is reserved for provider-confirmed credential or configuration rejection.

Available options:
connected,
broken,
disconnecting,
disconnected
credentialsError
object | null
required

Provider-confirmed credential or configuration rejection. Non-null if and only if status is broken.

consecutiveRefreshFailuresCount
integer
required

Consecutive scheduled credential-refresh failures, used only for backoff arithmetic.

Required range: 0 <= x <= 9007199254740991
tenantId
string
ownerName
string | null
type
enum<string>
Available options:
connector,
mcp,
browser
key
string
grantedScopes
string[]
providerPermissionChecks
object[]
connected
boolean

Whether the connection is authenticated and usable. Projection of status === "connected".

hasDocs
boolean
docsCount
number
docsSummary
string
state
enum<string>

Shared element-state projection of the connection lifecycle and its overlays.

Available options:
BUILDING,
CLIENT_ACTION_REQUIRED,
CONFIGURATION_ERROR,
SETUP_FAILED,
READY,
DISCONNECTING
errors
object[]

Validation or setup errors when state is not READY.

connectorId
string
externalAppId
string
connectorVersion
string
authOptionKey
string
oauthClientId
string
oauthClientVersionId
string
oauthClientName
string
createdAt
string
updatedAt
string
nextCredentialsRefreshAt
string

When the connection credentials are next scheduled for proactive refresh.

canTest
boolean

Whether the connection supports a connectivity test through its connector.

browserProvider
enum<string>
Available options:
browserbase,
puppeteer
canRefreshCredentials
boolean

Whether the connection credentials can be refreshed through its connector refresh flow.

archivedAt
string

When the connection was archived (soft-deleted).

isDeactivated
boolean

True when the connection or an ancestor was deactivated; a deactivated connection has no state.

meta
object
buildingAgentSessionId
string

Session ID for building the element via intent-based endpoints (create/update with intent). Present when state is BUILDING.

ask
object

The next connection step, projected from lifecycle state.

logoUri
string

Resolved app logo for this element (integration -> connector -> external app -> favicon).

input
object

Connect-form fields for this connection. Credential-carrying fields report { "set": true } presence only; their values are never returned.

connectorParameters
object

Connector parameters for this connection. Each field reports { "set": true } presence only; values are never returned.

credentialsSchema
object

Shape of this connection’s stored credentials: field names, types, and descriptions, never values. Use a field name here as the credential path when binding a credential into a command with the with-credentials CLI tool.