connections
POST /v1/connections/{provider}
Validate or store a provider access token.
Autenticação
Envie uma chave de API como um token de portador. A chave deve ter a permissão connections.manage; uma chave sem ela é recusada com 403, e não 404.
Onde vai o ID da sua organização
Este endpoint aceita org_id como parâmetro de consulta. Omita-o e a chamada abrangerá toda a sua subárvore de locatários; envie-o para restringir a chamada a uma única organização.
O ID da sua organização está na tela de chaves de API no seu painel, ao lado da própria chave. É o mesmo ID em todas as chamadas que você fizer.
Experimente
Substitua qualquer item entre colchetes por seus próprios valores e o espaço reservado para a chave por uma chave do seu painel.
curl -X POST https://api.zinndigital.com/v1/connections/{provider} \
-H "Authorization: Bearer zdk_live_…"Conectado? O console da API no seu painel preenche o ID da sua organização real e a sua própria chave, e executa a requisição contra a API de produção para que você possa ver a resposta real. Abra este endpoint no console da API
Detalhes
With `validate_only` the token is checked and nothing is stored, and the result is returned with 200 **even when the token is invalid** — an invalid token is an answer the caller renders, not a request error. Without it the token is re-validated and then stored in Vault, returning 201; a token that fails validation is rejected with `TOKEN_INVALID` and never persisted. The token itself is never logged or echoed. Requires `connections.manage`.
Parâmetros
| Nome | Tipo | Obrigatório | O que é |
|---|---|---|---|
provider (path) | ConnectionProvider | Sim | The third-party provider whose connections are addressed. |
org_id (query) | Uuid | Não | Which organization this connected account belongs to. Required when the caller manages connections for more than one — a reseller or an agency by construction — because a creden… |
Idempotency-Key (header) | string | Não | Client-generated key that makes an unsafe request replay-safe: the server stores the first response and returns it verbatim for repeats. |
Resposta
| Nome | Tipo | Obrigatório | O que é |
|---|---|---|---|
valid | boolean | Sim | — |
account_login | object | Sim | The account the token authenticates as, when valid. |
scopes | string[] | Sim | — |
missing_scopes | string[] | Sim | Required scopes the token lacks. Empty when the token is valid, and also empty when the provider could not enumerate its permissions — in that case the connection is usable but… |
message | object | Sim | Human-readable explanation, or null when valid. |
permissions | PermissionReport | null | Não | The per-permission checklist, exercised against the provider. ⛔ `null` means **we cannot test this provider's permissions** — it does not mean "nothing is required". The two rea… |
Erros que este endpoint pode retornar
401 · 403 · 422 · 429 · 503