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

# Profiles API Overview

> 複数の User Profiles を作成・管理します。

export const PlansAvailable = ({plans = [], maxPackRequired}) => {
  let displayPlans = plans;
  if (plans && plans.length === 1) {
    const lowerCasePlan = plans[0].toLowerCase();
    if (lowerCasePlan === "business") {
      displayPlans = ["Launch", "Business", "Enterprise"];
    } else if (lowerCasePlan === "premium") {
      displayPlans = ["Premium", "Launch", "Business", "Enterprise"];
    }
  }
  return <Note>
Available on {displayPlans.length === 1 ? "the " : ""}
{displayPlans.join(", ").replace(/\b\w/g, l => l.toUpperCase())}{" "}
{displayPlans.length > 1 ? "plans" : "plan"}.

{maxPackRequired && <span onClick={() => window.open('https://www.ayrshare.com/docs/additional/maxpack', '_self')} className="flex items-center mt-2 cursor-pointer">
 <span className="px-1.5 py-0.5 rounded text-sm" style={{
    backgroundColor: '#C264B6',
    color: 'white',
    fontSize: '12px'
  }}>
   Max Pack required
 </span>
</span>}
</Note>;
};

<PlansAvailable plans={["business"]} maxPackRequired={false} />

<Info>
  API 呼び出しで User Profile を指定するには、[ヘッダーに Profile Key を追加](/apis/overview#profile-key-format) します。
</Info>

User Profiles は Ayrshare の中核概念の 1 つで、複数のユーザーを作成・管理できます。あなたのプラットフォームの各ユーザーは、1 つ以上の Ayrshare User Profile を持ちます。各 User Profile は、サポートされているすべてのソーシャルネットワークに 1 つずつ接続を持つことができます。

## Profile Key

/user、/analytics、/delete などの多くのエンドポイントは、[ヘッダーに "Profile-Key" パラメータを追加](/apis/overview#profile-key-format) することで、Profile アカウントに代わって呼び出すことができます。

例えば /delete エンドポイントは、指定した *Profile Key* で指定した *post* *id* の Profile アカウントの投稿を削除するために呼び出せます。

```javascript theme={"system"}
const API_KEY = "API_KEY";
const PROFILE_KEY = "PROFILE_KEY";
const id = "Post ID";

fetch("https://api.ayrshare.com/api/delete", {
      method: "DELETE",
      headers: {
        "Content-Type": "application/json",
        "Authorization": `Bearer ${API_KEY}`
        "Profile-Key": PROFILE_KEY
      },
      body: JSON.stringify({
        id: id
      }),
    })
      .then((res) => res.json())
      .then((json) => console.log(json))
      .catch(console.error);
```

## ソーシャルネットワークの有効化・無効化

ソーシャルネットワークは、グローバルレベルまたは User Profile レベルで有効化・無効化できます。

<ul class="custom-bullets">
  <li>ダッシュボードで[ソーシャルアカウントのアクセスをグローバルに管理](/multiple-users/manage-user-profiles#set-social-networks-access) します。</li>
  <li>User Profile の[作成](/apis/profiles/create-profile) または [更新](/apis/profiles/update-profile) 時に、User Profile のソーシャルアカウントのアクセスを管理します。</li>
</ul>

ダッシュボードから設定するグローバル設定で無効化されたソーシャルネットワークは、User Profile 設定を上書きすることに注意することが重要です。

例えばダッシュボードで TikTok アクセスを無効化すると、User Profile は TikTok にアクセスできなくなります。一方、ダッシュボードで TikTok アクセスを有効化しつつ特定の User Profile で無効化すると、その特定のプロファイル以外のすべての User Profiles が TikTok にアクセスできます。

## 連携されたソーシャルアカウントの取得

[/profiles endpoint](/apis/profiles/get-profiles) または [/user endpoint](/apis/user/profile-details) を使用して、User Profile が連携しているソーシャルアカウントを取得します。

## User Profile への投稿

[/post](/apis/post/post) エンドポイントを使用して、ヘッダーに Profile Key を追加することで User Profile に投稿できます。返り値は、全体的なステータスとともに、投稿またはエラー結果の配列となります。すべての投稿が成功した場合は "success"、いずれかの投稿が失敗した場合は "error" になります。

ユーザーの Profile Key は、[/create-profile](/apis/profiles/create-profile) エンドポイントでプロファイル作成時に取得するか、Ayrshare の Web Dashboard GUI でプロファイルに切り替えて **Profile Key** ページにアクセスすることで取得できます。
