Begin oauth2 authorization on a connection provider
Begins an expiring hosted OAuth 2.0 authorization ceremony for an OAuth 2.0 ConnectionProvider.
Begins an expiring hosted OAuth 2.0 authorization ceremony for an OAuth 2.0 ConnectionProvider. Returns an authorization_url carrying an expiring one-use state token handled by GET /v1/connections/oauth2:callback.
- Path
POST https://api.sylphx.com/v1/orgs/acme/connection_providers/connection-provider:beginOauth2Authorization - Scope
connections:write - Effect
write— a successful call changes state. - Collection connection_providers
Request
| Field | Type | What it is |
|---|---|---|
name | string | OAuth 2.0 ConnectionProvider resource name. Required. |
connection_id | string | Target Connection id to create or reauthorize on callback; server-assigned when empty. |
post_authorize_redirect_uri | string | Optional HTTPS redirect destination after callback completion. |
scopes | string[] | Optional scopes overriding the provider defaults. |
extra_authorize_params | map<string, string> | Additional per-request query parameters appended to authorize_url. |
provider_metadata | map<string, string> | Optional non-secret metadata persisted onto the resulting Connection. |
external_account_id | string | Optional non-secret external account id recorded on creation. |
Response
| Field | Type | What it is |
|---|---|---|
authorization_url | string | Full authorization URL to open in a browser; carries a one-use expiring state. |
callback_url | string | Hosted callback URL handled by Sylphx Connections. |
expire_time | timestamp | When the authorization state expires (ten minutes after begin). |
Errors
UNAUTHENTICATED— No valid key or token was presented.PERMISSION_DENIED— The key lacks the method's permission.INVALID_FIELD— A field failed validation.INVALID_STATE— The Resource is in a state that forbids the call.RESOURCE_NOT_FOUND— The named Resource does not exist or is not visible.RESOURCE_ALREADY_EXISTS— A Resource with this name exists.
Every error arrives in the body Errors describes.
Examples
curl -X POST "https://api.sylphx.com/v1/orgs/acme/connection_providers/connection-provider:beginOauth2Authorization" \
-H "Authorization: Bearer $SYLPHX_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'