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

# Onboard Client Social Accounts

> Use the MCP Server to onboard clients' social accounts under sub-profiles with a JWT social-linking URL.

Integrators on a Business or Enterprise plan can onboard their clients' social accounts under **sub-profiles**. Using the [MCP Server](https://www.ayrshare.com/docs/additional/mcp-action-server.md), an agent creates a sub-profile, targets it, and mints a single sign-on linking URL the client opens to connect their accounts.

## Flow

**1. Create a sub-profile**

Call `create_profile` (account-level — no `profileKey`). It returns a **profile key** for the new sub-profile.

**2. Target the sub-profile**

Use the returned profile key on subsequent calls — either via the `Profile-Key` header on the connection or as a per-call `profileKey` argument. See [Connect & Setup](https://www.ayrshare.com/docs/additional/mcp-action-connect.md#precedence-argument-wins-over-header) for precedence.

**3. Mint a social-linking URL**

Call `generate_jwt_social_linking_url` to mint a single sign-on linking URL. The JWT signing key and onboarding domain are derived **server-side** — the caller supplies **no** `X-Ayrshare-*` headers and no private key or domain.

**4. Client links their accounts**

The client opens the URL and authorizes (OAuths) their social accounts. The connected accounts are linked to the sub-profile.

## Requirements

> [!WARNING]
>
> `generate_jwt_social_linking_url` **requires** a `profileKey`. If none resolves, the call returns **400** with the message **"Profile Key is required…"**.
>
> A **social-linking domain must be provisioned** for your account. This is available on the **Business** and **Enterprise** plans.

### Error states

| Condition | Response |
| - | - |
| No provisioned domain | **400** — "No social-linking domain is provisioned for this account (available on Business/Enterprise plans)." |
| No signing key | **400** — "No signing key found for this account's social-linking domain." |

## Next steps

> [card] [Connect & Setup](https://www.ayrshare.com/docs/additional/mcp-action-connect.md)
>
> Authentication and profile targeting.

> [card] [Tool Catalog](https://www.ayrshare.com/docs/additional/mcp-action-tools.md)
>
> The 33 tools grouped by domain, with scope and purpose.


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