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

# クライアントのソーシャルアカウントをオンボーディング

> MCP Server を使用して JWT ソーシャルリンキング URL でサブプロファイル配下にクライアントのソーシャルアカウントをオンボーディングします。

Business または Enterprise プランのインテグレーターは、クライアントのソーシャルアカウントを **サブプロファイル** 配下にオンボーディングできます。[MCP Server](/additional/mcp-action-server) を使用すると、エージェントがサブプロファイルを作成し、対象を指定して、クライアントが開いてアカウントを接続するためのシングルサインオンリンキング URL を発行します。

## フロー

<Steps>
  <Step title="サブプロファイルを作成">
    `create_profile` を呼び出します（アカウントレベル — `profileKey` なし）。新しいサブプロファイルの **profile key** が返されます。
  </Step>

  <Step title="サブプロファイルをターゲットにする">
    以降の呼び出しでは、返された profile key を使用します — 接続の `Profile-Key` ヘッダー経由、または呼び出しごとの `profileKey` 引数として指定します。優先順位については [Connect & Setup](/additional/mcp-action-connect#precedence-argument-wins-over-header) を参照してください。
  </Step>

  <Step title="ソーシャルリンキング URL を発行">
    `generate_jwt_social_linking_url` を呼び出してシングルサインオンリンキング URL を発行します。JWT の署名鍵およびオンボーディングドメインは **サーバー側** で導出されます — 呼び出し側は `X-Ayrshare-*` ヘッダー、秘密鍵、ドメインを一切提供しません。
  </Step>

  <Step title="クライアントがアカウントを連携">
    クライアントは URL を開き、ソーシャルアカウントを認可（OAuth）します。接続されたアカウントはサブプロファイルに紐付けられます。
  </Step>
</Steps>

## 要件

<Warning>
  `generate_jwt_social_linking_url` は `profileKey` を **必須** とします。解決できない場合、呼び出しは **400** と **"Profile Key is required…"** メッセージを返します。

  アカウントに **ソーシャルリンキング用ドメインがプロビジョニングされている必要があります**。これは **Business** および **Enterprise** プランで利用できます。
</Warning>

### エラー状態

| 条件             | レスポンス                                                                                                          |
| -------------- | -------------------------------------------------------------------------------------------------------------- |
| ドメインが未プロビジョニング | **400** — "No social-linking domain is provisioned for this account (available on Business/Enterprise plans)." |
| 署名鍵なし          | **400** — "No signing key found for this account's social-linking domain."                                     |

## 次のステップ

<CardGroup cols={2}>
  <Card title="Connect & Setup" icon="plug" href="/additional/mcp-action-connect" horizontal>
    認証とプロファイルターゲティング。
  </Card>

  <Card title="Tool Catalog" icon="list" href="/additional/mcp-action-tools" horizontal>
    ドメイン別にグループ化された 27 のツール、スコープと目的。
  </Card>
</CardGroup>
