← Back to API Reference

POST /contacts/upsert-batch

Upsert Contacts Batch

Create or update multiple contacts keyed by external IDs.

Request (cURL)

curl -X POST "http://localhost:8080/v1/contacts/upsert-batch" \
  -H "Authorization: Bearer <API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
  "contacts": [
    {
      "external_id": "wc_customer_42",
      "audience_id": "aud_123",
      "email": "customer@example.com",
      "first_name": "Jane",
      "last_name": "Buyer",
      "topics": [
        "renewal_reminders"
      ],
      "properties": {
        "source": "woocommerce",
        "lifetime_value": 199.99
      }
    }
  ]
}'

Response Example

{
  "id": "id_123"
}

Request Body Example

{
  "contacts": [
    {
      "external_id": "wc_customer_42",
      "audience_id": "aud_123",
      "email": "customer@example.com",
      "first_name": "Jane",
      "last_name": "Buyer",
      "topics": [
        "renewal_reminders"
      ],
      "properties": {
        "source": "woocommerce",
        "lifetime_value": 199.99
      }
    }
  ]
}