Deployments.ai Docs
Providers

Start provider authorization

POST /v1/connections · SDK beginProviderAuthorization · CLI deployments connection authorize

POST
/v1/connections

Authorization

platformBearer
headerAuthorizationBearer <token>

Platform bearer credential accepted as an opaque API key or JWT.

Header Parameters

x-deployments-environment*string
Match^[0-7][0-9A-HJKMNP-TV-Z]{25}$
idempotency-key*string
Length1 <= length <= 512

Request Body

application/json
  1. body
providerApplicationId?string
Match^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$
providerKey*string
Match^[a-z0-9](?:[a-z0-9._-]{0,126}[a-z0-9])?$
requestedResource?string
Match^\S[\s\S]*\S$|^\S$|^$
Length1 <= length <= 2048
requestedScopes?array<>
returnTo?string

Absolute https URL the OAuth callback sends the browser to. Its origin must exactly match an entry of the deployment's PLATFORM_OAUTH_RETURN_ORIGINS allowlist, without userinfo or a fragment; otherwise the request fails with 422 invalid_return_to. The callback answers 303 to this URL with connection_id and provider query parameters on success, or error=access_denied (the user declined) or error=authorization_failed on failure; existing query parameters are kept. Omit it to have the callback render a static result page instead.

Response Body

BeginProviderAuthorizationResponse

application/json
  1. response
authorizationUrl*string
expiresAt*string
Match^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$
Formatdate-time
curl -X POST "https://example.com/v1/connections" \  -H "x-deployments-environment: string" \  -H "idempotency-key: string" \  -H "Content-Type: application/json" \  -d '{    "providerKey": "string"  }'
{  "authorizationUrl": "string",  "expiresAt": "2019-08-24T14:15:22Z"}