> ## 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](/additional/mcp-action-server), an agent creates a sub-profile, targets it, and mints a single sign-on linking URL the client opens to connect their accounts.

## Flow

<Steps>
  <Step title="Create a sub-profile">
    Call `create_profile` (account-level — no `profileKey`). It returns a **profile key** for the new sub-profile.
  </Step>

  <Step title="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](/additional/mcp-action-connect#precedence-argument-wins-over-header) for precedence.
  </Step>

  <Step title="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.
  </Step>

  <Step title="Client links their accounts">
    The client opens the URL and authorizes (OAuths) their social accounts. The connected accounts are linked to the sub-profile.
  </Step>
</Steps>

## 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.
</Warning>

### 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

<CardGroup cols={2}>
  <Card title="Connect & Setup" icon="plug" href="/additional/mcp-action-connect" horizontal>
    Authentication and profile targeting.
  </Card>

  <Card title="Tool Catalog" icon="list" href="/additional/mcp-action-tools" horizontal>
    The 27 tools grouped by domain, with scope and purpose.
  </Card>
</CardGroup>
