Create a contact
POST/api/v1/contacts
curl -X POST 'https://www.unitpost.com/api/v1/contacts' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'User-Agent: my-app/1.0' \
-H 'Content-Type: application/json' \
-d '{
"email": "customer@example.com",
"first_name": "Ada",
"last_name": "Lovelace"
}'{
"object": "contact",
"id": "id_123",
"email": "customer@example.com",
"phone": "string",
"first_name": "string",
"last_name": "string",
"unsubscribed": false,
"unsubscribed_at": "2026-01-01T00:00:00.000Z",
"unsubscribe_reason": "USER",
"custom_fields": {},
"created_at": "2026-01-01T00:00:00.000Z",
"updated_at": "2026-01-01T00:00:00.000Z"
}Add a single contact to your workspace. Set an email plus any standard or custom field values, and optionally its SMS number (phone). A number is contact data, not consent: record SMS consent with Record SMS consent. Custom fields must already exist (define them with Create a custom contact field). Emails are unique per workspace, so creating one that already exists returns 409 — use Update a contact to change an existing contact, or Start an async contact import to add many at once. A sync that can't know which of the two it is can send update_if_exists: true: the contact that already has the email is updated with the fields in the body instead of the 409, and the response is 200 rather than 201. Requires the contacts:write capability.
Request body7 fields
| Field | Type | Description |
|---|---|---|
emailrequired | string | — |
phone | string | null | — |
first_name | string | — |
last_name | string | — |
unsubscribed | boolean | — |
custom_fields | object | — |
update_if_exists | boolean | `true` updates the contact that already has this email instead of answering `409`: the fields you send are merged onto it (what you leave out is untouched, and `custom_fields` merges key by key), and the response is `200` rather than the `201` of a real create. Default `false`: a duplicate email is a `409`. It is not a way around an opt-out — `unsubscribed: false` on a suppressed address is still refused. |
Response · 200 fields12 fields
| Field | Type | Description |
|---|---|---|
objectrequired | string | — |
idrequired | string | — |
emailrequired | string | null | — |
phone | string | null | — |
first_namerequired | string | null | — |
last_namerequired | string | null | — |
unsubscribedrequired | boolean | — |
unsubscribed_atrequired | string | null | — |
unsubscribe_reasonrequired | enum | null | — |
custom_fieldsrequired | object | — |
created_atrequired | string | — |
updated_atrequired | string | — |