Hanzo AI
OpenapiProvider

Create credential

Is the direct intake path: a customer-held token/setup-token (Verify) or an externally obtained OAuth bundle from the CLI's local PKCE (Adopt).

POST /v1/connection/{provider}/credential

Addresshttps://api.hanzo.ai/v1/connection/{provider}/credential
MethodPOST
Operationpost_connection_by_provider_credential
AuthAuthorization: Bearer $HANZO_API_KEY

Is the direct intake path: a customer-held token/setup-token (Verify) or an externally obtained OAuth bundle from the CLI's local PKCE (Adopt). ALWAYS verify-before-store: a bad credential is refused and NOTHING is persisted (connectByCredential's fail-closed order).

Request

9 fields, body application/json (required).

FieldInTypeRequiredDescription
providerpathstringyesProvider is the user-scoped provider's registry id, from the path.
accountIdbodystringAccountID scopes the credential where the provider's Verify needs one.
labelbodystringLabel names this connection; empty means "default".
oauthbodyprovider.oauthBundleIn
oauth.accessbodystringAccess is the access token.
oauth.accountbodystringAccount is the account label the flow reported; sanitized on ingest.
oauth.refreshbodystringRefresh is the refresh token.
providerbodystringProvider is the user-scoped provider's registry id, from the path.
tokenbodystringToken is the customer-held credential for the Verify path.

Response

StatusBodyMeaning
200provider.credentialOutok
defaultproblem-detailsrefused

200 body — 10 fields.

FieldInTypeAlwaysDescription
connectedbodybooleanConnected is always true — a failed verification is a 400 and stores nothing.
connectorbodyprovider.connectionView
connector.accountbodystringAccount is the human label of the connected third-party account (the Slack team name, the GitHub org login).
connector.connectedAtbodystringConnectedAt is when the connection was last (re)established, RFC 3339 UTC.
connector.expiresAtbodystringExpiresAt is when the access token expires, RFC 3339 UTC; empty for a credential that does not expire.
connector.externalIdbodystringExternalID is the provider's own id for the account (Slack team.id, GitHub installation_id) — the value inbound webhooks are mapped back to this org by.
connector.idbodystringID is provider + ":" + label, the address every connection route takes.
connector.labelbodystringLabel is the caller's own name for this connection ("default", "work").
connector.providerbodystringProvider is the connected provider's registry id.
connector.scopesbodystring[]Scopes are the permissions the provider granted.

Failure carries the platform error shape — see Errors.

Examples

hanzo connection credential <provider>

Provider API · All Hanzo APIs · Interactive reference

How is this guide?

On this page