---
title: "Add Contacts"
method: POST
path: "/campaign/campaigns/{campaign_id}/contacts"
tags: ["contacts"]
---

# Add Contacts

`POST /campaign/campaigns/{campaign_id}/contacts`

## Request

- Base URL: `https://api.anyreach.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.anyreach.ai/campaign/campaigns/{campaign_id}/contacts`
- Auth: HTTP bearer

Upsert contacts to a campaign by ID or external_id.

Use campaign_id="default" to add contacts without a campaign (ad-hoc calls);
each such contact must name its agent with agent_id or agent_config.
Updates contacts if id or external_id matches, inserts otherwise.

Contacts must include phone_numbers as a pre-validated E.164 list.

## Path parameters

- `campaign_id` string, required

## Headers

- `x-anyreach-org` string, nullable: Organization ID for user PATs (pat_ prefix tokens)

## Request body

- ContactBulkCreate
  - `contacts` ContactInput[], required
    - `external_id` string, nullable
    - `phone_numbers` string[]
    - `timezone` string, nullable
    - `scheduled_at` string, date-time, nullable
    - `agent_id` string, nullable
    - `agent_config` object, nullable
    - `agent_number` string, nullable
    - `agent_version` integer, nullable
    - `initial_context` string, nullable
    - `data` object

## Response `201`

Successful Response

- ContactUpsertResult
  - `inserted` integer, required
  - `updated` integer, required
  - `failed` FailedContact[]
    - `index` integer, required
    - `external_id` string, nullable
    - `errors` string[], required
  - `warnings` FailedContact[]
    - `index` integer, required
    - `external_id` string, nullable
    - `errors` string[], required
  - `contact_ids` string[]

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/anyreach/apis/anyreach-api.md) - [All operations](https://skmtc.dev/anyreach/apis/anyreach-api/llms.txt) - [OpenAPI document](https://skmtc.dev/anyreach/apis/anyreach-api/revisions/2eddf40c8c93?raw)
