# A social media API for agencies and SaaS (one workspace per client, with your brand up front)

If you run an agency or a product that posts to social media on behalf of others, writing the post isn't the problem. It's everything around it: getting each client to connect their accounts without handing you their password, keeping one client's accounts from getting mixed up with another's, and finding out whether a post went out or failed without checking network by network.

Building it yourself means registering an app on every network, getting through their reviews and maintaining eight different integrations. This guide shows how it works with the wyro API partner API: your system is what your clients see, and wyro API works behind the scenes.

## The model: one workspace per client

Each of your clients gets their own *workspace*, with its own key. Accounts connected with that key exist only in that workspace: when you list accounts with client A's key, client B's never show up, and an account can't be moved from one workspace to another.

You store two things, always on your backend:

- A **partner token**, which is only used to create and manage workspaces.
- **Each client's key**, which is used for everything else: connecting networks, publishing and checking statuses.

## 1. Create the client's workspace

```bash
curl -X POST https://wyroapi.com/v1/partner/workspaces \
  -H "Authorization: Bearer $PARTNER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"external_id":"client-123","webhook_url":"https://api.your-agency.com/webhooks/social"}'
```

`external_id` is the client's identifier in your system. The call is idempotent: if you send the same `external_id` again, you get the workspace that already exists instead of a duplicate.

The first response includes the `workspace_id`, the client's `api_key` and a `webhook_secret`. Store them right away, because they aren't shown again. If you ever need to rotate the key, `POST /v1/partner/workspaces/{id}/key` generates a new one and the old one stops working immediately.

## 2. Send them a connection link

With the client's key, you request a link for the network they want to connect:

```bash
curl -X POST https://wyroapi.com/v1/connect \
  -H "Authorization: Bearer $CLIENT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"platform":"instagram","return_url":"https://app.your-agency.com/social/connected"}'
```

The response includes a `connect_url`. You show it as a button in your product or send it to the client. Here's what happens when they open it:

1. They don't have to create an account or sign in to wyro API.
2. They go straight to the network's official authorization screen (Instagram's, LinkedIn's, whichever applies). They never give you their password.
3. When they're done, they land back on your `return_url` with the result in the URL: `wyro_status=connected` along with the `account_id`, the network and the username, or `wyro_status=error` with the reason (for example, `cancelled`).

The link is signed and expires after 24 hours: it can't be tampered with to point to another client or another network. `return_url` must be `https`.

## 3. Publish with account_ids

With the client's key, `GET /v1/accounts` returns their connected accounts. To publish, you specify the exact accounts:

```bash
curl -X POST https://wyroapi.com/v1/posts \
  -H "Authorization: Bearer $CLIENT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"New collection","account_ids":["acc_..."],"media":[{"url":"https://your-server.com/photo.jpg"}],"scheduled_at":"2026-11-20T10:00:00-05:00"}'
```

Without `scheduled_at`, the post goes out right away. With `account_ids` you pick the exact account, even if the client has several on the same network.

If the one publishing is an AI agent, each workspace also comes with its own MCP server address (`mcp_url`, in the creation response). The agent working for a client only sees that client's accounts.

## 4. Previews for client approval

To show a post before it exists on the real account, use a test key: `POST https://wyroapi.com/v1/sandbox` returns one with no sign-up, valid for 72 hours, with simulated accounts on all 8 networks. Every post you create with it returns a `preview_url`: a public link showing what the post looks like on each network, which you can send to the client. Once they approve, you publish the same thing with their workspace key.

Partner workspaces don't have simulated accounts: everything you publish there is real.

## 5. Get the status by webhook

At the `webhook_url` you set when creating the workspace (or set later with `PUT /v1/webhooks`), you receive these events:

- `post.published`, `post.partial` and `post.failed`, when a post reaches its final status. Each network comes with its status, the link to the published post or the error.
- `account.connected` and `account.disconnected`.

Every event includes your `external_id`, so you know which client it belongs to without looking it up. Deliveries are signed: they arrive with the `X-Wyro-Timestamp` and `X-Wyro-Signature` headers, and the signature is the HMAC-SHA256 of the string `<timestamp>.<body>` using your `webhook_secret`. Verify it and reject timestamps older than 5 minutes.

One design tip: respond quickly with a 2xx, process in the background and, if a status really matters to you, confirm it with `GET /v1/posts/{id}`.

## When a client leaves

- `DELETE /v1/posts/{id}` cancels a scheduled post.
- `DELETE /v1/accounts/{id}` disconnects an account.
- `DELETE /v1/partner/workspaces/{id}` shuts down the whole workspace: it disconnects its accounts and revokes the key. The history is kept.

## How to get access and what it costs

The partner token isn't generated from the dashboard: we enable it ourselves for each agency or product. wyro API's public price is $5 per connected account per month; for agencies and products with lots of accounts, terms depend on your volume. To request it, [get in touch from the agencies page](https://wyroapi.com/en/agencies).

In the meantime, you can try the whole publishing side with a test key, free and with no sign-up.

## FAQ

**Do my clients need to create a wyro API account?** No. They open the connection link and authorize directly on the network. The link passes through the wyro API domain before reaching the network's official screen, and then they return to your product.

**Do I need to register apps with Meta, TikTok or LinkedIn?** No. Accounts connect through the access wyro API already has. More details in [Publish without app reviews](https://wyroapi.com/en/no-app-review).

**Which networks does it cover?** Instagram, Facebook, TikTok, LinkedIn, X, Threads, YouTube and Pinterest, with the same call. Each network has its own page, for example [Instagram](https://wyroapi.com/en/instagram-api) and [TikTok](https://wyroapi.com/en/tiktok-api).

More: [Agencies page](https://wyroapi.com/en/agencies) · [How to automate your clients' social media with AI](https://wyroapi.com/en/blog/ai-social-media-automation-for-agencies) · [Publish to multiple networks at once](https://wyroapi.com/en/docs/multiple-networks).

---
Published on 2026-11-16 at https://wyroapi.com/en/blog/white-label-social-media-api-for-agencies
