# Build a campaign recipient list `POST /api/v1/campaigns/{id}/build-recipients` Replaces the campaign's recipient list. Sources can include entered addresses, team members, or contacts from lists. ## Permissions Send your API key in `X-API-Key`. Required permissions are **Campaigns → Write**. ## Headers - `X-Sport-Id` (integer, required) — The sport ID from [List sports](/api/sports/list.md). Use the sport the record belongs to. ## Path parameters - `id` (integer, required) — ID of the campaign. ## Body parameters - `custom_emails` (array of strings) — Email addresses to add directly. - `team_ids` (array of integers) — Team IDs in the selected sport. Supply include when using teams. - `list_ids` (array of integers) — Contact list IDs in the selected sport. Use lists or teams. - `include` (map) — When using teams, set one or more of athletes, parents, coaches, or staff to true. Supply at least one recipient source. Custom addresses can be combined with teams or lists. ## Request Set ASDINCLOUD_API_KEY and any variables named in the example before running it. ```sh curl --request POST \ --url "https://api.asdincloud.com/api/v1/campaigns/${ID:?Set ID}/build-recipients" \ --header "X-API-Key: $ASDINCLOUD_API_KEY" \ --header "X-Sport-Id: ${SPORT_ID:?Set SPORT_ID}" \ --header "Content-Type: application/json" \ --data '{"custom_emails":["reader@example.com"]}' ``` ## Response **200 OK** Returns the updated configuration, total recipients, and counts for sources and skipped addresses. Example with fictional data and selected fields. ```json { "campaign_id": 24, "status": "ready", "status_effective": "ready", "recipient_config": { "source": "groups", "team_ids": [], "include": { "athletes": false, "parents": false, "coaches": false, "staff": false }, "custom_emails": [ "reader@example.com" ], "list_id": null, "list_ids": [] }, "inserted": 1, "skipped_invalid": 0, "skipped_duplicate": 0, "skipped_suppressed": 0, "total_recipients": 1, "sources": { "custom": 1, "athletes": 0, "parents": 0, "coaches": 0, "staff": 0, "lists": 0 } } ``` ## Errors - `401` — The API key is missing or invalid. - `403` — The API key lacks the required permission. - `404` — The requested record was not found. - `409` — The campaign's current state does not allow this operation. - `422` — The input contains incompatible sources or no eligible recipients. - `500` — The campaign operation could not be completed.