SnozeDevelopers
API referenceConnected Accounts

Connect an external account

Stores a manual API key for the signed-in user and activates it in the workspace the connect flow started in. The caller must be a member of that workspace. Providers Snoze installs through OAuth or an app installation (GitHub, Slack, Google, Discord, ...) are refused here: their accounts are provisioned by the install callback from provider-verified material. A manual key is always a personal `api_key` credential: it cannot be shared with the workspace (`shareWithWorkspace: true` is a validation error) and an automation pinned to it only sends it to the hosts listed in `allowedHosts`. Reconnecting the same provider account replaces the stored secret, bumps its secret version and clears its failure state rather than creating a duplicate.

POST
/v1/workspaces/{workspaceId}/connected-accounts

Authorization

apiKey
headerAuthorizationBearer <snoze_sk_…>

Workspace API key created in Workspace settings → API keys. Scopes on the key bound what it can read and write.

Path Parameters

workspaceId*string

Request Body

application/json
  1. body
provider*string
externalAccountId*string
label*string
secret*
scopes?array<string>|null
manifest?|null
allowedHosts?array<string>|null
shareWithWorkspace?boolean|null

Response Body

Success

application/json
  1. response
data*
Example Request
curl -X POST 'https://api.snoze.dev/v1/workspaces/string/connected-accounts' \  -H 'Content-Type: application/json' \  -d '{  "provider": "string",  "externalAccountId": "string",  "label": "string",  "secret": {}}'
Example Response
{  "data": {    "id": "string",    "provider": "string",    "label": "string",    "authKind": "oauth",    "shareable": true,    "hasSecret": true,    "health": "unknown",    "failureReason": "revoked",    "scopes": [      "string"    ],    "activeWorkspaceIds": [      "string"    ],    "sharedWorkspaceIds": [      "string"    ],    "createdAt": "string",    "updatedAt": "string"  }}