curl --request POST \
--url https://{notifuseDomain}/api/contacts.upsert \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"workspace_id": "ws_1234567890",
"contact": {
"email": "user@example.com",
"external_id": "user_12345",
"timezone": "America/New_York",
"language": "en-US",
"first_name": "John",
"last_name": "Doe",
"phone": "+15551234567",
"address_line_1": "123 Main St",
"address_line_2": "Apt 4B",
"country": "US",
"postcode": "10001",
"state": "NY",
"job_title": "Software Engineer",
"lifetime_value": 1250.5,
"orders_count": 5,
"last_order_at": "2023-05-15T14:30:00Z",
"custom_string_1": "Premium tier",
"custom_string_2": "<string>",
"custom_string_3": "<string>",
"custom_string_4": "<string>",
"custom_string_5": "<string>",
"custom_number_1": 42,
"custom_number_2": 123,
"custom_number_3": 123,
"custom_number_4": 123,
"custom_number_5": 123,
"custom_datetime_1": "2023-06-01T09:00:00Z",
"custom_datetime_2": "2023-11-07T05:31:56Z",
"custom_datetime_3": "2023-11-07T05:31:56Z",
"custom_datetime_4": "2023-11-07T05:31:56Z",
"custom_datetime_5": "2023-11-07T05:31:56Z",
"custom_json_1": {
"preferences": {
"theme": "dark",
"notifications": true
}
},
"custom_json_2": {},
"custom_json_3": {},
"custom_json_4": {},
"custom_json_5": {},
"created_at": "2023-01-15T10:30:00Z",
"updated_at": "2023-04-22T15:45:00Z"
}
}'
{
"action": "created",
"contact": {
"email": "user@example.com",
"external_id": "user_12345",
"timezone": "America/New_York",
"language": "en-US",
"first_name": "John",
"last_name": "Doe",
"phone": "+15551234567",
"address_line_1": "123 Main St",
"address_line_2": "Apt 4B",
"country": "US",
"postcode": "10001",
"state": "NY",
"job_title": "Software Engineer",
"lifetime_value": 1250.5,
"orders_count": 5,
"last_order_at": "2023-05-15T14:30:00Z",
"custom_string_1": "Premium tier",
"custom_string_2": "<string>",
"custom_string_3": "<string>",
"custom_string_4": "<string>",
"custom_string_5": "<string>",
"custom_number_1": 42,
"custom_number_2": 123,
"custom_number_3": 123,
"custom_number_4": 123,
"custom_number_5": 123,
"custom_datetime_1": "2023-06-01T09:00:00Z",
"custom_datetime_2": "2023-11-07T05:31:56Z",
"custom_datetime_3": "2023-11-07T05:31:56Z",
"custom_datetime_4": "2023-11-07T05:31:56Z",
"custom_datetime_5": "2023-11-07T05:31:56Z",
"custom_json_1": {
"preferences": {
"theme": "dark",
"notifications": true
}
},
"custom_json_2": {},
"custom_json_3": {},
"custom_json_4": {},
"custom_json_5": {},
"created_at": "2023-01-15T10:30:00Z",
"updated_at": "2023-04-22T15:45:00Z"
},
"error": null
}
Creates a new contact or updates an existing one based on email address. Returns information about whether the contact was created or updated.
curl --request POST \
--url https://{notifuseDomain}/api/contacts.upsert \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"workspace_id": "ws_1234567890",
"contact": {
"email": "user@example.com",
"external_id": "user_12345",
"timezone": "America/New_York",
"language": "en-US",
"first_name": "John",
"last_name": "Doe",
"phone": "+15551234567",
"address_line_1": "123 Main St",
"address_line_2": "Apt 4B",
"country": "US",
"postcode": "10001",
"state": "NY",
"job_title": "Software Engineer",
"lifetime_value": 1250.5,
"orders_count": 5,
"last_order_at": "2023-05-15T14:30:00Z",
"custom_string_1": "Premium tier",
"custom_string_2": "<string>",
"custom_string_3": "<string>",
"custom_string_4": "<string>",
"custom_string_5": "<string>",
"custom_number_1": 42,
"custom_number_2": 123,
"custom_number_3": 123,
"custom_number_4": 123,
"custom_number_5": 123,
"custom_datetime_1": "2023-06-01T09:00:00Z",
"custom_datetime_2": "2023-11-07T05:31:56Z",
"custom_datetime_3": "2023-11-07T05:31:56Z",
"custom_datetime_4": "2023-11-07T05:31:56Z",
"custom_datetime_5": "2023-11-07T05:31:56Z",
"custom_json_1": {
"preferences": {
"theme": "dark",
"notifications": true
}
},
"custom_json_2": {},
"custom_json_3": {},
"custom_json_4": {},
"custom_json_5": {},
"created_at": "2023-01-15T10:30:00Z",
"updated_at": "2023-04-22T15:45:00Z"
}
}'
{
"action": "created",
"contact": {
"email": "user@example.com",
"external_id": "user_12345",
"timezone": "America/New_York",
"language": "en-US",
"first_name": "John",
"last_name": "Doe",
"phone": "+15551234567",
"address_line_1": "123 Main St",
"address_line_2": "Apt 4B",
"country": "US",
"postcode": "10001",
"state": "NY",
"job_title": "Software Engineer",
"lifetime_value": 1250.5,
"orders_count": 5,
"last_order_at": "2023-05-15T14:30:00Z",
"custom_string_1": "Premium tier",
"custom_string_2": "<string>",
"custom_string_3": "<string>",
"custom_string_4": "<string>",
"custom_string_5": "<string>",
"custom_number_1": 42,
"custom_number_2": 123,
"custom_number_3": 123,
"custom_number_4": 123,
"custom_number_5": 123,
"custom_datetime_1": "2023-06-01T09:00:00Z",
"custom_datetime_2": "2023-11-07T05:31:56Z",
"custom_datetime_3": "2023-11-07T05:31:56Z",
"custom_datetime_4": "2023-11-07T05:31:56Z",
"custom_datetime_5": "2023-11-07T05:31:56Z",
"custom_json_1": {
"preferences": {
"theme": "dark",
"notifications": true
}
},
"custom_json_2": {},
"custom_json_3": {},
"custom_json_4": {},
"custom_json_5": {},
"created_at": "2023-01-15T10:30:00Z",
"updated_at": "2023-04-22T15:45:00Z"
},
"error": null
}
API token for authentication
Contact upserted successfully
The response is of type object
.