ads

POST /v1/ads/connections/{connection_id}/disconnect

Disconnect an ad account; its token and all its data are deleted.

All ads endpoints

All developer docs →

Zinn®, our Viking, hammering at his anvil beside an API endpoint sending events to several listeners.

Authentication

Send an API key as a bearer token. The key must carry the ads.manage permission; a key without it is refused with 403, not 404.

This endpoint takes no organisation id. Your key already identifies the organisation it belongs to, and the response is scoped to it.

Try it

Replace anything in angle brackets with your own values, and the key placeholder with a key from your dashboard.

curl -X POST https://api.zinndigital.com/v1/ads/connections/{connection_id}/disconnect \
  -H "Authorization: Bearer zdk_live_…"

Signed in? The API console in your dashboard fills in your real organisation id and your own key, and runs the request against the live API so you can see the actual response. Open this endpoint in the API console

Details

Gated on ads.manage; audit actions ads.connection_disconnect and (once a revoke is final) ads.grant_revoke. Our copy of the token is forgotten and every row of the account's data is deleted (deleted counts rows per table). za-97: when this was the LAST live connection, in any organisation, made with that person's sign-in, the grant is revoked at the network too (Google, Meta, X); a network revoke withdraws the person's WHOLE grant to our app, so it is never sent while another connection still uses it (Q475). revoke says what happened: revoked, already_invalid (nothing left there), retrying (the network did not answer; retried on Temporal, never blocking the disconnect) or kept with its reason — shared (another connection uses the sign-in, or the same person is choosing accounts on the picker right now: the revoke then waits and goes ahead only if that picker is abandoned with nothing picked), unsupported (Microsoft, Pinterest: no revoke we may call) or unconfirmed (we could not prove no other connection uses it); remove_url is the network's own page where the person can remove Zinn® Ads themselves.

Parameters

NameTypeRequiredWhat it is
connection_id (path)stringYes—

Response

NameTypeRequiredWhat it is
idstringYes—
statusstring<disconnected>Yes—
forgottenbooleanYes—
deletedobjectYes—
revokeAdsGrantRevokeOutcomeYesza-97: what Disconnect did with the person's grant at the network.

Errors this endpoint can return

401 · 403 · 404 · 422 · 429