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

# ブースト委任を作成

> 支払者のプロフィールが自身の広告アカウントで他のプロフィールの投稿をブーストできるようにします。Primary Profile の API Key で送信。

ブースト委任を使用すると、アカウント内の1つのプロフィール(支払者)が、アカウント内の他のプロフィールが公開した投稿をブーストできます。支払者とは、その広告アカウントで広告費用を支払うプロフィールです。

委任は Primary Profile(プライマリープロフィール)の API Key で管理します。リクエストは `Profile-Key` を付けずに送信してください。

## ヘッダーパラメータ

**Authorization** `string` *required*

[API Key](https://www.ayrshare.com/docs/apis/overview.md#authorization) of the Primary Profile.

Format: `Authorization: Bearer API_KEY`

## ボディパラメータ

**owners** `array | string` *required*

支払者が投稿をブーストできる User Profile(ユーザープロフィール)。`refId` を持つオブジェクトを最大1,000件含むリスト、または支払者を除く現時点でアカウント内にあるすべての User Profile を表す `"all"` のいずれかを指定します。Primary Profile をオーナーにすることはできません。

1,000件の上限は `"all"` にも適用されます。支払者以外の User Profile がアカウント内に1,000件を超えて存在する場合、リクエストは code 101 で拒否され、何も作成されません。その場合は、1回のリクエストにつき最大1,000件のプロフィールのリストとして `owners` を送信してください。

`"all"` には、後から作成したプロフィールは含まれません。それらを追加するには、リクエストを再度送信してください。

**payer** `object`

支払いを行うプロフィール。`refId` を持つオブジェクトとして指定します。省略すると Primary Profile が使用されます。

**platforms** `array` *required*

委任する広告プラットフォーム(例: `["instagram"]`)。[代理ブースト](https://www.ayrshare.com/docs/apis/ads/delegations/boost-on-behalf.md)に対応するネットワークのみ受け付けます。それ以外は `101` を返します。オーナーとプラットフォームの
組み合わせごとに1件の委任が作成されます。

プロフィールは、[プロフィールの作成](https://www.ayrshare.com/docs/apis/profiles/create-profile.md)または[プロフィールの取得](https://www.ayrshare.com/docs/apis/profiles/get-profiles.md)時に返される `refId` で指定します。

オーナーとプラットフォームの組み合わせごとに個別の委任が作成され、それぞれに固有の `id` が付与されます。リクエストを再度送信すると、不足している委任のみが作成され、既存の委任は変更されずに返されます。ただし例外が1つあります。オーナーがネットワーク上で権限を拒否した場合、その委任の `permission` は `unknown` に戻り、次回のブースト時に再度権限が求められます。オーナーがアカウントを再リンクした後にリクエストを送信してください。このリクエストに含まれるオーナーとプラットフォームの委任が取り消し済みの場合、その委任は同じ `id` のまま再び有効になります。そのオーナーの他のプラットフォームで取り消し済みの委任は、取り消されたままです。

```bash cURL theme={"system"}
curl \
-H "Authorization: Bearer API_KEY" \
-H "Content-Type: application/json" \
-X POST https://api.ayrshare.com/api/ads/delegations \
-d '{"owners": [{"refId": "140b8709bd6ade099b242d895e268fb886130c53"}], "platforms": ["instagram"]}'
```

```javascript JavaScript theme={"system"}
const API_KEY = "API_KEY";

fetch("https://api.ayrshare.com/api/ads/delegations", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Authorization": `Bearer ${API_KEY}`
  },
  body: JSON.stringify({
    owners: [{ refId: "140b8709bd6ade099b242d895e268fb886130c53" }],
    platforms: ["instagram"]
  })
})
  .then((res) => res.json())
  .then((json) => console.log(json))
  .catch(console.error);
```

```json 200 theme={"system"}
{
  "status": "success",
  "delegations": [
    {
      "id": "Kx3v9QpL2mZ7tR1wYb4N",
      "owner": { "refId": "140b8709bd6ade099b242d895e268fb886130c53", "title": "Agent One" },
      "payer": { "refId": "9f1c3e7a2b4d", "title": "Agency" },
      "platform": "instagram",
      "permission": "unknown",
      "status": "active"
    }
  ]
}
```

```json 400 theme={"system"}
{
  "action": "ads",
  "status": "error",
  "code": 400,
  "message": "These owner profiles are not found in this account: 140b8709bd6ade."
}
```


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