Docs menu

SocialWire API

One REST API for publishing, scheduling and answering on 14 social platforms. Base URL https://api.zaynstack.com/v1. The dashboard runs on the same API, so anything you can click, you can script.

Requests and answers are JSON. Times are RFC 3339 with a time zone. Platforms are named instagram, facebook, threads, tiktok, youtube, twitter (X), bluesky, linkedin, telegram, whatsapp, google (Google Business Profile), zalo, pinterest and app_store_connect. x and google_business are accepted as input too.

Authentication

Create a key in the dashboard under API & webhooks and send it as a bearer token. Keys start with sh_live_. A key can be limited to some scopes and some brands; a key with neither limit has full access.

curl https://api.zaynstack.com/v1/accounts \
  -H "Authorization: Bearer sh_live_…"

The same header also takes an OAuth access token issued to an MCP client (see MCP server). OAuth tokens act for the person who approved them, with full access to their workspace.

Keys limited to some brands see only those brands' accounts, posts and inbox. An account outside them answers 404 account.not_found, as if it did not exist. Operations that span every brand (keys, brands, invites, workspace settings) need a full-access key.

Authentication errors

Authentication error codes
CodeStatusWhen
auth.missing_header401No Authorization header, or one that does not start with Bearer.
auth.empty_token401The header is just "Bearer" with nothing after it.
auth.invalid_token401The token is not an API key, an OAuth access token or a session token, or it has expired.
auth.invalid_key401A key that starts with sh_live_ but is unknown or revoked.
auth.user_not_found401The OAuth token belongs to someone who is no longer a member of the workspace.
auth.insufficient_scope403The key lacks the scope the endpoint needs (meta.required_scope), or a brand-limited key called an all-brand operation.
auth.session_required403The endpoint is for the dashboard only.
auth.cross_origin403A dashboard cookie request that changes data came from another site. Use an API key.

The full list of codes, grouped, is on Errors.

Pagination

Lists answer { data: [...] } plus next_cursor when there is another page (most lists also send has_more). Pass next_cursor back as cursor to get the next page. Cursors are opaque: do not build or change them.

  • limit sets the page size. Most lists default to 25 or 50 and allow at most 100. A larger number is lowered to the maximum; 0, a negative number or text uses the default.
  • A cursor that this API did not return answers 400 validation.field_invalid with meta.field cursor.
GET /v1/posts?limit=50
→ { "data": [ … ], "has_more": true, "next_cursor": "WyIyMDI2LTExLTIwVDA5OjAwOjAwWiIsIjEyMyJd" }

GET /v1/posts?limit=50&cursor=WyIyMDI2LTExLTIwVDA5OjAwOjAwWiIsIjEyMyJd

Request ids

Every answer carries an X-Request-ID header, and errors repeat it as request_id. It is 8 lowercase hex characters. Send your own X-Request-ID (1 to 64 letters, digits, - or _) and it is used instead. Quote it when you ask for help.

Analytics

Counts are read from the platforms and stored, so the numbers are as fresh as the last sync. Some platforms need extra permissions for insights: an account connected before they were requested must reconnect.

GET /v1/analytics/overview
GET /v1/posts/{post_id}/metrics
GET /v1/accounts/{account_id}/analytics
GET /v1/brands/{brand_id}/analytics

AI agents

Point any MCP client at https://api.zaynstack.com/mcp. It signs in with OAuth or an API key and offers the same operations as tools. Details: MCP server; client setup for Claude, ChatGPT, Cursor and more: AI agents guide.