Social accounts
OAuth into partner social accounts, list them, and revoke when the customer disconnects.
The social-accounts API is how Layers stores and refreshes the credentials your end-customers grant on TikTok and Instagram. Once a social account is connected to a project, its socialAccountId is what you pass as a target on every scheduling, metrics, and revocation call — the same opaque ID regardless of whether the account was authorized via OAuth or provisioned by Layers as a leased account.
The endpoints in this section cover the full lifecycle: mint an authorize URL, poll for completion, list connected accounts, refresh expired tokens, and disconnect. The OAuth handshake is the most involved — if you haven't wired one yet, start with the quickstart below; it walks through the full server glue end-to-end with TypeScript and Python samples.
Start here: Connect your first social account — a 15-minute walkthrough from "Connect" button to a live socialAccountId.
For background on how Layers represents OAuth-connected and leased accounts in one shape, see Social accounts concepts.
In this section
POST oauth-url
Mint an authorize URL with an opaque state token. Strict returnUrl allowlist.
GET oauth-status
Poll until the state token flips to completed or failed. Returns the new socialAccountId.
GET list
Every connected and leased account on a project, with status.
POST reauth-url
Reconnect when a token expires — preserves the socialAccountId.
GET health
Per-account token + provisioning state for monitoring.
DELETE revoke
Disconnect an account. Cancels queued posts on it in one transaction.