# Invite creators

> Invite hand-picked creators to a live campaign: up to 8 per campaign in all. Invites are free; each creator gets the offer and has 2 days to say yes. You only pay when you start a deal with someone who said yes (on yapfactory.com). The result lists who was invited and who couldn't be, with why. For use once the person has agreed the list.

```http
POST https://yapfactory.com/api/v1/campaigns/{campaignId}/invites
```

|   |   |
| --- | --- |
| Who can use it | Brands |
| Tier | `outbound`: Reaches other people: an email, a notification or a public post. |
| Scope | `campaigns:write`, or `write` |
| Idempotency-Key | **Required** |
| Rate limit | Writes: 20 a minute, of which outbound: 10 a minute |
| MCP tool | [`invite_creators`](https://yapfactory.com/developers/tools.md#invite_creators) |

> This reaches other people or the public. If an agent makes the call, it should confirm the details with the person first.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `campaignId` | path | `uuid` | yes | The campaign's id. |
| `creatorIds` | body | `uuid[]` | yes | Creator ids from search_creators or get_campaign. 1 to 8 items. |

## Example request

```bash
curl -X POST "https://yapfactory.com/api/v1/campaigns/8f14e45f-ceea-4e7a-9b1d-2c3b4a5d6e7f/invites" \
  -H "Authorization: Bearer $YAP_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "creatorIds": [
      "c9f0f895-fb98-4ab3-8e3c-1d2f3a4b5c6d"
    ]
  }'
```

## Response

`200` with the result in `data`: the same object the MCP tool returns.

```json
{
  "data": {
    "invited": [
      {
        "creatorId": "c9f0f895-fb98-4ab3-8e3c-1d2f3a4b5c6d",
        "dealId": "3b2f6c1e-7a54-4d0b-9f1a-6e5d4c3b2a19",
        "url": "https://yapfactory.com/deals/3b2f6c1e-7a54-4d0b-9f1a-6e5d4c3b2a19"
      }
    ],
    "failed": [],
    "next": "Creators have 2 days to answer. When one says yes, start the deal on its page to secure payment."
  }
}
```

An example: fields that don't apply are `null`, and new fields can be added at any time, so ignore ones you don't know. Every response carries `Request-Id` and the `RateLimit-*` headers.

## Errors

| Code | Status | When |
| --- | --- | --- |
| `invalid_request` | 400 | A field failed validation (see `meta.issues`), an unknown query parameter, or no `Idempotency-Key`. |
| `unauthorized` | 401 | No token, or it's wrong, expired, revoked or from the other environment. |
| `insufficient_scope` | 403 | The token doesn't have `campaigns:write` (or `write`). |
| `forbidden` | 403 | Only for brands, or the account can't do this yet (email not confirmed, paused). |
| `not_found` | 404 | No such campaign, or it isn't yours. |
| `conflict` | 409 | Its current state doesn't allow this. `message` says why, in words you can show. |
| `idempotency_conflict` | 409 | The same `Idempotency-Key` came with a different body. |
| `rate_limited` | 429 | Over the limit. Wait for `Retry-After` seconds. |
| `internal` | 500 | Our fault. Retry later, and send us the `requestId` if it keeps happening. |

Every error has the same shape. See [Errors](https://yapfactory.com/developers/errors.md) for what to do about each one.

---

HTML version: https://yapfactory.com/developers/api/invite_creators
