Connect the provider
Connects the tenant to the banking provider with the tenant’s client credentials.
How it works
- Configure the tenant’s provider client credentials before you call it.
- The call checks that the credentials get an access token and stores it. It sets the provider
company_idfrom the CNPJ (legalDocument) of the organization inX-Organization-Id. That organization owns the provider account. - Connecting again with another organization replaces the
company_id. The last successful connect wins. - Send an empty JSON object as the body:
{}. A missing body,nullor any field is refused. - Where the deployment verifies provider accounts, the credentials must resolve to exactly one usable account.
account_verifiedsays whether the account was verified. When it istrue,provider_account_idnames the account. - When
account_verifiedisfalse, the connection works but the account was not verified, andprovider_account_idis absent. Do not treat the account as validated. Contact support to enable verification. - Multi-tenant deployments only: the answer has
webhook_urlandwebhook_subscription_registered. The URL has a token that identifies the tenant, so treat the response body as a secret. - The service creates a signing key for each connection and registers the URL and the key at the provider. The provider signs each delivery body with HMAC-SHA256. The key is never returned.
- Each connect rotates the connection: new
webhook_url, new signing key. The previous pair keeps working for a grace window (30 minutes by default), so deliveries in flight are not lost. webhook_subscription_registeredsays whether this call registered the new pair. When it isfalse, the previous pair stops working when the grace window closes.- If the URL or the key may have leaked, call
POST /v1/admin/providers/webhooks/{provider_type}/cancelfirst, then connect. A connect made before the cancel is cut by it too. Rotation alone does not stop the exposed pair: it keeps working until the grace window closes. If the cancel gets403PBP-0004, call connect anyway, and contact support if the exposure cannot wait for the window to close. - This operation is not idempotent. An
Idempotency-Keyis ignored. A retry creates a new connection and replaces the one the provider may be using.
Cabeçalhos
Corpo
The body is of type object.
Resposta
OK. The tenant is connected. Read account_verified before you treat the account as validated. On multi-tenant deployments, keep the body secret: it has the webhook URL.
Whether the subscription pointing the provider at webhook_url was written at the provider. ABSENT means no per-tenant webhook connection was issued, so there was nothing to register. TRUE means the provider holds webhook_url and the signing key the service generated for this connection. FALSE means the connect succeeded and webhook_url is valid, but the provider was not told where to deliver events, so deliveries to webhook_url may not arrive yet. Depending on the cause, the registration is retried automatically or needs an operator. Do not reconnect: that rotates the connection again. If deliveries do not start, call POST /v1/admin/providers/webhooks/{provider_type}/resubscribe or contact support.

