Complete a connect session
Record the connected account once consent has finished, as a secret of kind connection bound to the integration’s hosts. Pass the reference the consent window reported. Without it the call answers status: pending until Anlyon has been told the consent finished, so a client can poll. Idempotent: completing twice returns the same secret.
/api/v2/connections/sessions/{sessionId}/completeAuthorizationBearer token (Anlyon API key) · headerrequiredWorkspace API key sent as Authorization: Bearer <key>.
better-auth.session_tokenAPI key · cookierequiredBrowser session used by dashboard-only operations.
sessionIdstringrequiredThe session id returned when the session was started.
X-Request-IdstringOptional caller correlation ID. Unsafe or oversized values are replaced.
application/jsonreferencestringThe value the consent window reported when it finished.
The session's state
successbooleanrequiredtruedataConnectSessionCompletionrequiredShow propertiesHide properties
statusstringrequiredpendingcompletedsecretSecret | nullrequiredThe connected-account secret once completed; null while pending.
Show propertiesHide properties
idstringrequirednamestringrequireddescriptionstring | nullrequiredallowedHostsstring[] | nullrequiredHosts this secret may be sent to. Null means any public host.
allowedPlacementsstring[] | nullrequiredWhere in the request this secret may appear. Null means anywhere.
kindstringrequiredstatic holds a value you stored. connection is a connected account: its value is an access token fetched at dispatch, its hosts come from the integration, and it may only appear in a header. PUT cannot change a secret's kind.
staticconnectionconnectionobject | nullrequiredFor a signed-in account, which integration it is and whether it still works. status mirrors health.status, which is the one record of it for both kinds of connected account. Null for a static secret, including one connected with an API key.
Show propertiesHide properties
integrationIdstringrequiredstatusstringrequiredThe same value as health.status. Reconnect the account to use it again.
activeneeds_reauthhealthobject | nullrequiredWhether the connected account still works, whichever way it was connected. active, or needs_reauth with a reason once the provider refused the credential or the connector service could not refresh it. A dispatch that uses a needs_reauth account fails before anything is sent. Reconnect it with POST /api/v2/connections/{secretName}/reconnect. Null for a secret you stored directly, which Anlyon cannot check.
Show propertiesHide properties
statusstringrequiredactiveneeds_reauthcheckedAtstring<date-time> | nullrequiredWhen Anlyon last asked the provider whether the credential works. Null when it never has.
reasonstring | nullrequiredSet while status is needs_reauth. key_rejected: the provider refused the stored key. access_revoked: the provider no longer honours the signed-in account's grant. refresh_failed: the connector service could not refresh its token.
key_rejectedaccess_revokedrefresh_failednullintegrationIdstring | nullrequiredThe integration this secret was connected for, by signing in or with an API key. Null for a secret you stored directly. A secret connected with an API key is static with this set.
lastUsedAtstring<date-time> | nullrequiredcreatedAtstring<date-time>requiredupdatedAtstring<date-time>requirednullBad Request - Invalid input data
successbooleanrequiredrequestIdstringrequiredCorrelation ID matching the X-Request-Id response header.
errorobjectrequiredShow propertiesHide properties
codestringmessagestringdetailsobjectUnauthorized - Invalid or missing API key
successbooleanrequiredrequestIdstringrequiredCorrelation ID matching the X-Request-Id response header.
errorobjectrequiredShow propertiesHide properties
codestringmessagestringdetailsobjectPayment Required - Usage quota exceeded
successbooleanrequiredrequestIdstringrequiredCorrelation ID matching the X-Request-Id response header.
errorobjectrequiredShow propertiesHide properties
codestringmessagestringdetailsobjectAuthenticated credential lacks the required scope or workspace access.
successbooleanrequiredrequestIdstringrequiredCorrelation ID matching the X-Request-Id response header.
errorobjectrequiredShow propertiesHide properties
codestringmessagestringdetailsobjectNot Found - Resource does not exist
successbooleanrequiredrequestIdstringrequiredCorrelation ID matching the X-Request-Id response header.
errorobjectrequiredShow propertiesHide properties
codestringmessagestringdetailsobjectThe request conflicts with current resource state or a concurrent decision.
successbooleanrequiredrequestIdstringrequiredCorrelation ID matching the X-Request-Id response header.
errorobjectrequiredShow propertiesHide properties
codestringmessagestringdetailsobjectThe session expired, or belongs to another workspace or environment (CONNECTION_SESSION_EXPIRED). Start a new one.
successbooleanrequiredrequestIdstringrequiredCorrelation ID matching the X-Request-Id response header.
errorobjectrequiredShow propertiesHide properties
codestringmessagestringdetailsobjectToo Many Requests - Rate limit exceeded
successbooleanrequiredrequestIdstringrequiredCorrelation ID matching the X-Request-Id response header.
errorobjectrequiredShow propertiesHide properties
codestringmessagestringdetailsobjectConnected accounts are not configured on this deployment (CONNECTIONS_UNAVAILABLE).
successbooleanrequiredrequestIdstringrequiredCorrelation ID matching the X-Request-Id response header.
errorobjectrequiredShow propertiesHide properties
codestringmessagestringdetailsobjectThe connected-account service did not answer (CONNECTION_PROVIDER_ERROR).
successbooleanrequiredrequestIdstringrequiredCorrelation ID matching the X-Request-Id response header.
errorobjectrequiredShow propertiesHide properties
codestringmessagestringdetailsobject
