VocalDocscontracts 1.65.0

Start the authorization of a Connection

POST /v1/connections/{connection_id}/authorize

PropertyValue
Operationauthorize_connection
GroupConnections
Scopeintegrations:write
Route classcontrol
IdempotencyIdempotency-Key accepted: a retry with the same key replays the first answer
AuditAudited integrations.connection.authorize (mutation)
Released in1.60.0
Phase 0 hostServed (the hosted api pins 1.65.0)

Answers the vendor's authorization URL for the Member's browser (1.60.0; integrations.md section 7): PKCE (S256), a single-use state valid 10 minutes (a target) bound to the Organization, the Member and the Connection, and the scopes of enabled_tools, nothing more. Session only: every API key is refused with forbidden, and a Member who is neither an owner nor an admin with the detail owner_or_admin_required. A Connection whose strategy is not OAuth is validation_failed with connection_not_authorizable. The edge role's callback completes the exchange; the Connection becomes active and writes connection.authorized.

Request

Set VOCAL_API to the base URL of your API and VOCAL_API_KEY to an API key with the integrations:write scope (Authentication and keys). Replace each placeholder, such as agt_... or <name>, with your own value.

curl -X POST "$VOCAL_API/v1/connections/con_.../authorize" \
  -H "Authorization: Bearer $VOCAL_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"

Parameters

NameInTypeRequiredDescription
connection_idpathConnectionIdyesThe id of a Connection: con_ and the row's UUIDv7 in 26 Crockford base32 characters. Opaque and safe to log.
idempotency-keyheaderstringnoA client-chosen key, kept 24 hours per Organization, environment and route. A replay returns the stored response.

Responses

StatusContent typeShapeError codes
200application/jsonConnectionAuthorization
400application/jsonErrorEnvelopeinvalid_request
401application/jsonErrorEnvelopeunauthenticated
403application/jsonErrorEnvelopeforbidden, org_suspended
404application/jsonErrorEnvelopenot_found
409application/jsonErrorEnvelopeconnection_revoked, idempotency_in_progress, idempotency_key_reused
422application/jsonErrorEnvelopevalidation_failed
429application/jsonErrorEnveloperate_limited
500application/jsonErrorEnvelopeinternal_error

Fields of the 200 answer

The shape is ConnectionAuthorization.

FieldTypeRequiredDescription
authorization_urlstring (uri)yesThe vendor's authorization URL with PKCE (S256), the single-use state and the requested scopes, to open in the Member's browser.
connection_idConnectionIdyes
expires_atTimestampyesWhen the state stops being accepted: 10 minutes after issue (a target).
object"connection_authorization"yes
scopesarray of VendorScopeyes