Skip to main content
POST
/
api
/
contacts.import
Batch import contacts
curl --request POST \
  --url https://{notifuseDomain}/api/contacts.import \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "workspace_id": "ws_1234567890",
  "contacts": [
    {
      "email": "user1@example.com",
      "first_name": "John",
      "last_name": "Doe"
    },
    {
      "email": "user2@example.com",
      "first_name": "Jane",
      "last_name": "Smith"
    }
  ],
  "subscribe_to_lists": [
    "newsletter",
    "product_updates"
  ]
}'
{
"operations": [
{
"email": "user@example.com",
"action": "create",
"error": null
}
],
"error": null
}

Authorizations

Authorization
string
header
required

API token for authentication

Body

application/json
workspace_id
string
required

The ID of the workspace

Example:

"ws_1234567890"

contacts
object[]
required

Array of contacts to import (create or update)

Minimum length: 1
Example:
[
{
"email": "user1@example.com",
"first_name": "John",
"last_name": "Doe"
},
{
"email": "user2@example.com",
"first_name": "Jane",
"last_name": "Smith"
}
]
subscribe_to_lists
string[]

Optional array of list IDs to subscribe all contacts to

Example:
["newsletter", "product_updates"]

Response

Batch import completed (may include partial failures)

operations
object[]

Array of operation results, one for each contact in the request

error
string | null

Global error message if the entire operation failed

Example:

null