Layers
Partner APIAPI reference

Social accounts

OAuth into partner social accounts, list them, and revoke when the customer disconnects.

View as Markdown

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

On this page