WWaSparks Social Developers

For partners

Operator mode and X-Tenant-Id

Use one partner key for everything, and name the client org on each content call with a header.

One key, one header

A partner account in operator mode needs only its partner key. Every request sends Authorization: Bearer <partner key>. Which endpoint you call decides the rest:

Endpoints Send Does
/v1/partner/** the key alone Create and manage your client orgs, plans, redirect URIs, usage and your partner webhook.
everything else under /v1/** the key and X-Tenant-Id: <org external_ref> Acts as that org: connect its social accounts, upload media, publish, handle comments and direct messages.

Operator mode is switched on by WaSparks for your partner account. If a content call with your partner key returns 403 partner_key_not_allowed, it is not on yet: write to us.

What X-Tenant-Id is

X-Tenant-Id is the external_ref you set when you create an org: your own id for that client. You never have to store an id of ours. If you did not set an external_ref, set one with PATCH /v1/partner/orgs/{orgId}.

POST /v1/partner/orgs
{ "name": "Acme Coffee", "external_ref": "acme-001", "plan_code": "growth" }

GET /v1/org
Authorization: Bearer <partner key>
X-Tenant-Id: acme-001

The rules:

First calls, in order

All with the partner key. The first four need no header.

  1. List plans GET /v1/partner/plans shows the plans you can put orgs on. POST /v1/partner/plans creates your own.
  2. Create a client org POST /v1/partner/orgs. Set external_ref to your id for that client. Repeat for every client.
  3. Register a redirect URI POST /v1/partner/redirect-uris with the HTTPS URL users return to after the consent screen. It applies to all your orgs.
  4. Register one webhook POST /v1/partner/webhook-subscriptions, for all your clients (see below).

From here on, add X-Tenant-Id: <that client's external_ref>:

  1. Check you are in GET /v1/org returns the org the header names.
  2. Connect accounts POST /v1/connect/sessions, send the user to url, then read the session and connect their accounts. See Connect social accounts.
  3. Publish and listen Publish posts, then handle comments and messages.

The Postman collection follows the same order. Download it from the API reference, put your key in partner_key, and run the Quickstart folder.

One webhook for all clients

A single partner subscription can carry both kinds of event:

Every delivery has org_id and, for content events, workspace_id. Route on org_id: the org record has your external_ref. Webhooks covers signatures and retries.

Keep the partner key safe

The partner key can act on every one of your clients. Keep it on your server, never in a browser or mobile app. If it leaks, tell us right away so we can rotate it.

Your clients should know that, in operator mode, your software can read and act on their content. That is the point of the mode, and your own terms with them should say so.

Per-org keys instead

If you want a credential that is limited to one client, create an org key with POST /v1/partner/orgs/{orgId}/api-keys. With an org key you drop X-Tenant-Id, and the key can only reach that org. You can use both approaches side by side. See Provisioning clients.

Next: Provisioning clients