> ## Documentation Index
> Fetch the complete documentation index at: https://docs.postsyncer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect social accounts

> Connect accounts with a link for yourself or a client, keep them signed in, reconnect them and put them back on their posts.

Posts go out through the social accounts connected to a workspace. You can connect them in the [app](https://app.postsyncer.com) under **Accounts**, or make a connect link through the API and send it to whoever owns the account.

## Make a connect link

A connect link is a page where a person signs in to one network and picks the accounts to add, such as two of their Facebook Pages. They don't need a PostSyncer login. It's the same link as **Accounts → Invite** in the app.

The key needs `accounts:create`, and its person must be an owner or a manager in the workspace.

```bash theme={null}
curl -X POST "https://postsyncer.com/api/v1/accounts/connect-links" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "workspace_id": 4815, "provider": "instagram" }'
```

```json 201 theme={null}
{
  "url": "https://app.postsyncer.com/connect/invite?token=8f1c...&provider=instagram",
  "provider": "instagram",
  "workspace_id": 4815,
  "mastodon_instance": null,
  "expires_at": "2030-03-22T09:00:00+00:00"
}
```

* `provider` is one of the 12 networks: `twitter` (X), `instagram`, `facebook`, `linkedin`, `tiktok`, `youtube`, `pinterest`, `threads`, `bluesky`, `mastodon`, `telegram` or `google_business` (Google Business Profile).
* Mastodon also needs `mastodon_instance`, the server the account is on, such as `mastodon.social`.
* A link works for one sign-in, then stops. It expires after 7 days.
* On Telegram, the person adds a channel through the PostSyncer bot instead of signing in. [Telegram](https://docs.postsyncer.com/platforms/telegram.md) has the steps.

Send `url` to the person, or open it yourself on another device. See [Create a connect link](https://docs.postsyncer.com/api-reference/accounts/connect-link.md).

### At the account limit

The Free plan has 2 accounts across all the owner's workspaces. Paid plans have more: see [Plan limits](https://docs.postsyncer.com/plan-limits.md#paid-plans). At the limit, making a link answers `403` with `"error": "plan_limit_reached"` and `"limit": "accounts"`, so you never send a link that would fail after the person signs in.

## Know when it's connected

Subscribe a [webhook](https://docs.postsyncer.com/api-reference/webhooks/create.md) to `account.connected`. It carries the new `account`. Then [list the accounts](https://docs.postsyncer.com/api-reference/accounts/list.md) to get its `id` for posts.

A social account can be in one PostSyncer workspace at a time. Signing in with one that is already in another workspace is refused. Signing in again with one already in this workspace renews its sign-in, which is how a reconnect works.

## Keep accounts working

[Get account](https://docs.postsyncer.com/api-reference/accounts/get.md) and [List accounts](https://docs.postsyncer.com/api-reference/accounts/list.md) show each account's health:

| Field | What it means | What to do |
| - | - | - |
| `needs_reconnect` | The sign-in no longer works. `reconnect_reason` says why, when the network said. | Reconnect it. Until then, it can't be scheduled or published to. |
| `renewal_failing` | The network refused to renew a sign-in that still works. It keeps posting until `works_until`. | Reconnect it before `works_until`, or it will need reconnecting. |
| `sign_in_ends_at` | When the network ends the sign-in itself, such as LinkedIn after a year. `null` when the network doesn't say. | Reconnect it before then. |
| `platform_hold` | The network put the account on hold, for example until its owner acts in the network's app. The sign-in still works. | The owner sorts it out on the network. PostSyncer checks again at `next_check_at`. |
| `analytics_unavailable` | Its post numbers can't be read, with a `reason` and a `message`, such as a private X account. | See [Read analytics](https://docs.postsyncer.com/guides/analytics.md#when-numbers-cant-be-read). |

These webhooks tell you without polling:

| Event | Sent when |
| - | - |
| `account.needs_reconnect` | An account has to be connected again. |
| `account.expires_soon` | A sign-in that can't renew ends soon. |
| `account.paused` | The network put publishing on hold for an account. |
| `account.disconnected` | An account was removed. |

[Webhook events](https://docs.postsyncer.com/webhooks/events.md) shows what each one carries.

### Posts and an account that needs reconnecting

When you schedule or publish a post, an account that needs reconnecting is left out. The post still goes to its other accounts, and the answer lists the one left out in `skipped_accounts`, with a `reconnect_url` and a `message` to show the user. Only when every account still to be sent to needs reconnecting is the request refused with `422`. A draft keeps such accounts.

## Reconnect an account

Reconnect in the app (**Accounts → Reconnect**), or make a connect link for the same network and sign in with the same account. Either way the account keeps its `id`, its posts and its settings, and `needs_reconnect` goes back to `false`.

Then send again the posts that failed on it: see [Send failed accounts again](https://docs.postsyncer.com/guides/publish-a-post.md#send-failed-accounts-again), and add it back to posts that left it out.

## Remove an account

[Delete account](https://docs.postsyncer.com/api-reference/accounts/delete.md) (`accounts:delete`) disconnects it from the workspace:

* Scheduled posts that go only to this account become drafts. They keep their time, so they can be scheduled again.
* Scheduled posts that also go to other accounts still go out there.

Get the account first: its `scheduled_posts` says how many posts each case covers, so you can tell the user before you delete. The answer has `posts_moved_to_drafts` and `posts_kept_on_other_accounts`.

## Put an account back on its posts

When the same profile is connected again to the same workspace within 90 days of being removed, PostSyncer offers to put it back on the posts it was on:

1. The workspace gets an `account.posts_to_put_back` webhook, and [Get account](https://docs.postsyncer.com/api-reference/accounts/get.md) shows the offer in `posts_to_put_back`.
2. Ask the user. Nothing changes until someone chooses.
3. [Put back account posts](https://docs.postsyncer.com/api-reference/accounts/put-back-posts.md) adds the account back. It needs `posts:update` and `posts:schedule`. Send `"dismiss": true` to close the offer instead.

Putting back never publishes anything right away. Posts the account had already published come back on their own when it's reconnected, with their links, numbers and comments.

## With MCP

The MCP tools do the same, with the same permissions: `create-account-connect-link`, `list-accounts`, `get-account`, `delete-account` and `put-back-account-posts`. See the [MCP tools reference](https://docs.postsyncer.com/mcp/tools-reference.md).

## Related

> [card] [Accounts](https://docs.postsyncer.com/api-reference/accounts/list.md)
>
> The account object and its fields.

> [card] [Verify account ownership](https://docs.postsyncer.com/oauth-delegation.md)
>
> Prove a user owns an account without connecting it.

> [card] [Publish a post](https://docs.postsyncer.com/guides/publish-a-post.md)
>
> Send posts to the accounts you connected.

> [card] [Platforms](https://docs.postsyncer.com/platforms/overview.md)
>
> What each network posts and needs.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.