---
title: "Batch import contacts"
method: POST
path: "/api/contacts.import"
---

# Batch import contacts

`POST /api/contacts.import`

Creates or updates multiple contacts in a single batch operation. This is significantly more efficient than individual upsert operations. Optionally subscribes all contacts to specified lists.

## Request body

- BatchImportContactsRequest
  - `workspace_id` string, required — The ID of the workspace
  - `contacts` ContactInput[], required — Array of contacts to import (create or update)
    - `email` string, email, required — Email address of the contact. This is the contact's unique identifier — upserts always match contacts by email address.
    - `external_id` string, nullable — Optional identifier for the contact in your own system (e.g. your user ID). Stored and searchable, but not unique and never used to match contacts during upserts — sending an existing external_id with a new email address creates a second contact.
    - `timezone` string, nullable — Timezone of the contact
    - `language` string, nullable — Preferred language of the contact
    - `first_name` string, nullable — First name of the contact
    - `last_name` string, nullable — Last name of the contact
    - `full_name` string, nullable — Full name of the contact (for systems that don't have separate first/last names)
    - `phone` string, nullable — Phone number of the contact
    - `address_line_1` string, nullable — First line of address
    - `address_line_2` string, nullable — Second line of address
    - `country` string, nullable — Country of the contact
    - `postcode` string, nullable — Postal code
    - `state` string, nullable — State or province
    - `job_title` string, nullable — Job title of the contact
    - `custom_string_1` string, nullable — Custom string field 1
    - `custom_string_2` string, nullable — Custom string field 2
    - `custom_string_3` string, nullable — Custom string field 3
    - `custom_string_4` string, nullable — Custom string field 4
    - `custom_string_5` string, nullable — Custom string field 5
    - `custom_number_1` number, float, nullable — Custom number field 1
    - `custom_number_2` number, float, nullable — Custom number field 2
    - `custom_number_3` number, float, nullable — Custom number field 3
    - `custom_number_4` number, float, nullable — Custom number field 4
    - `custom_number_5` number, float, nullable — Custom number field 5
    - `custom_datetime_1` string, date-time, nullable — Custom datetime field 1
    - `custom_datetime_2` string, date-time, nullable — Custom datetime field 2
    - `custom_datetime_3` string, date-time, nullable — Custom datetime field 3
    - `custom_datetime_4` string, date-time, nullable — Custom datetime field 4
    - `custom_datetime_5` string, date-time, nullable — Custom datetime field 5
    - `custom_json_1` object, nullable — Custom JSON field 1 (must be a JSON object or array)
    - `custom_json_2` object, nullable — Custom JSON field 2 (must be a JSON object or array)
    - `custom_json_3` object, nullable — Custom JSON field 3 (must be a JSON object or array)
    - `custom_json_4` object, nullable — Custom JSON field 4 (must be a JSON object or array)
    - `custom_json_5` object, nullable — Custom JSON field 5 (must be a JSON object or array)
  - `subscribe_to_lists` string[] — Optional array of list IDs to subscribe all contacts to

## Response `200`

Batch import completed (may include partial failures)

- BatchImportContactsResponse
  - `operations` UpsertContactOperation[] — Array of operation results, one for each contact in the request
    - `email` string, email — Email address of the contact
    - `action` 'create' | 'update' | 'error' — The action that was performed: 'create' for new contacts, 'update' for existing contacts, 'error' for failed operations
    - `error` string, nullable — Error message if this specific contact operation failed
  - `error` string, nullable — Global error message if the entire operation failed

## Other responses

- `400` — Bad request - validation failed
- `401` — Unauthorized - invalid or missing authentication token
- `500` — Internal server error

## Changes

- **2025-12-02** `c9edbbd76e08` — 4 warning
  - removed the request property `contacts/items/contact_lists`
  - removed the request property `contacts/items/contact_segments`
  - removed the request property `contacts/items/created_at`
  - removed the request property `contacts/items/updated_at`
- **2025-12-01** `bca4a43d9d46` — 2 info
  - added the new optional request property `contacts/items/contact_segments`
  - added the new optional request property `contacts/items/full_name`
- **2025-11-29** `c39acad12e49` — 3 warning
  - removed the request property `contacts/items/last_order_at`
  - removed the request property `contacts/items/lifetime_value`
  - removed the request property `contacts/items/orders_count`
- **2025-11-01** `6d2b86adbdc3` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/pierre-b/apis/notifuse-api/changes/api/contacts.import/post.md)

---

[API](https://skmtc.dev/pierre-b/apis/notifuse-api.md) · [All operations](https://skmtc.dev/pierre-b/apis/notifuse-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/pierre-b/notifuse-api/revisions/d26605f2fc47/schema)
