Update a contact
PATCH/api/v1/contacts/{id}
PATCH /contacts/{id}
curl -X PATCH 'https://www.unitpost.com/api/v1/contacts/con_123' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'User-Agent: my-app/1.0' \
-H 'Content-Type: application/json' \
-d '{
"unsubscribed": true
}'Response · 200
{
"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"
}Update a contact's standard or custom field values. Top-level fields you omit are left as-is, but custom_fields REPLACES the contact's whole map: read the contact first and send every key you want to keep. phone sets the contact's SMS number (consent is recorded separately); phone: null removes every SMS number it has, with Unitpost-Strict: true (without it the numbers are kept and Unitpost-Warning says so). Unknown keys are ignored. The {id} accepts a contact id or email. To manage a contact's subscription preferences instead, use Set a contact's topic preference. Requires the contacts:write capability.
Parameters1 field
| Field | Type | Description |
|---|---|---|
idrequired | string · path | — |
Request body5 fields
| Field | Type | Description |
|---|---|---|
phone | string | null | — |
first_name | string | null | — |
last_name | string | null | — |
unsubscribed | boolean | — |
custom_fields | object | — |
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 | — |
200401404409422