Skip to content

Getting started

The public API lives at https://api.thesocialmediapp.com. Every route starts with /v1, accepts and returns JSON, and only answers over HTTPS.

An API key belongs to one organization and carries a set of scopes, such as posts:read or posts:write. An owner or an admin of the organization creates it, and the full key (tsma_...) is shown once, at creation.

Owners and admins of an organization create keys in the web app: Settings → API keys (user menu, /settings/api-keys).

  1. Name the key after the system that will use it (2 to 60 characters).
  2. Choose its reach: every workspace of the organization, or only the current workspace.
  3. Tick the scopes the system needs. Scopes your role does not hold cannot be ticked.
  4. Optionally set an expiry date (it must be in the future): the key works through the end of that day in your display time zone. After it the key stops working and shows as expired.
  5. Copy the key from the dialog and store it in a secret manager or an environment variable. The key is shown once: it is never stored in clear text, and the lists show only its prefix (tsma_ + 7 characters). If you lose it, create a new key and revoke the old one.

The same page lists every key of the organization with its scopes, reach, creator, creation date, expiry, last use and status (active, expired, revoked), and revokes a key after a confirmation. Revocation is immediate. The creator is shown with the same display name as in the members list (today the account e-mail); once the creator is no longer a member of the organization, or their account no longer exists, the page shows a neutral label instead.

Other members (publisher, editor, viewer) see a no-access message on that page. Keys are managed only in the web app: the public API never creates, lists or revokes keys.

Scope Allows
products:read (alias workspaces:read) list and read workspaces (/v1/products), read a workspace’s plan
products:write create and edit workspaces
connections:read · connections:write · connections:remove see, connect and disconnect social accounts
posts:read · posts:write · posts:publish read posts and publication status, create and edit drafts, schedule and publish
media:read · media:write see the media library, upload media
analytics:read · analytics:refresh read post metrics, request a refresh (under the refresh window)
webhooks:read · webhooks:write see and manage webhooks
workspace:export request and download a workspace export

Listing the workspaces a key can reach (GET /v1/workspaces) needs no scope: any valid API key may call it. posts:approve and members:* are never granted to a key: team approvals and member management stay in the web app. Each operation in the API reference ends with the scope it requires.

Changed 2026-11: POST /v1/cost-estimates was removed; it now answers 404 with an empty body, like any path that is not an endpoint (see Errors). GET /v1/billing/usage, GET /v1/billing/statements[/{id}] and GET/PUT /v1/budget-caps were removed too (the same 404), and billing:read / billing:write are no longer scopes: a new key cannot be granted them (api_key_scopes_invalid), and a key created with them keeps working with its other scopes, which are the only ones it lists.

A key never has more permission than its creator. On every request its effective scopes are the granted scopes ∩ the scopes of the creator’s current role in the key’s organization. A demoted creator’s key loses the dropped scopes at once; a removed member’s keys are revoked. A missing scope is 403 common_forbidden. An archived or plan-blocked organization refuses writes, and an organization pending deletion refuses the key (403 organization_pending_deletion).

Send the key as a bearer token in the Authorization header. This call lists the workspaces the key can reach:

Terminal window
curl https://api.thesocialmediapp.com/v1/workspaces \
-H "Authorization: Bearer $TSMA_API_KEY" \
-H "Accept-Language: en"

A missing, wrong, expired or revoked key gets 401 (with WWW-Authenticate: Bearer). A key without the scope an endpoint needs gets 403. Only API keys are accepted: a web app session, an MCP token or a cookie never authenticates a /v1 call.

Request and response properties are snake_case (product_id, scheduled_at). Instants are ISO 8601 with an offset; a schedule also carries its IANA time zone, and a date without a time zone is refused.

Each key may send 600 requests per minute, and all keys of one organization together 1,200. Above that the answer is 429 common_rate_limited with a Retry-After header in seconds.