Skip to main content
POST
Create or update a contact

Authorizations

Authorization
string
header
required

A workspace API token (sk_live_...) or an OAuth access token (oat_live_...). Create workspace tokens in Settings > API. Send either as Authorization: Bearer <token>.

Headers

Idempotency-Key
string

A unique value (a UUID works) that makes retrying this request safe. A repeat with the same key and body within 24 hours returns the original response instead of acting twice; the same key with a different body is a 409 idempotency_key_reused.

Maximum string length: 255

Query Parameters

expand
string | null

Comma-separated relationships to inline in the response, e.g. organization. Unexpanded relations are still identified by their *_id field.

Example:

"organization"

Body

application/json

Body for POST /v1/contacts/upsert.

Matched on external_id when you send one, otherwise on phone. Phones are unique per workspace and normalized before comparison, so (11) 98765-4321 and +55 11 98765-4321 are the same key. A phone match without an external_id yet is given yours. A deleted contact that matches is restored.

first_name
string
required

Required; a nameless contact is not useful.

Minimum string length: 1
phone
string
required

Required. Any format; normalized to E.164.

address
string | null
city
string | null
company_name
string | null

Legacy alias for organization. The text is kept on the contact, and a contact that has no organization yet is also linked to the organization this name matches, or to a new one when none does. To say which organization a contact belongs to, send organization, which also tells you how the name was resolved.

custom_fields
Custom Fields · object
email
string | null
external_id
string | null

Your own id for this record, e.g. its id in your system. Unique per workspace and resource; send null to clear it.

Required string length: 1 - 255
Example:

"crm-48213"

job_title
string | null
last_name
string | null
on_match
enum<string>
default:update

What to do when the contact already exists.

Available options:
update,
ignore
organization
OrganizationReference · object | null

The organization this contact belongs to: {"id": ...} to link one you picked, or {"name": ...} to match or create it by name. Send exactly one. The response carries organization_resolution. Do not combine with organization_id.

organization_id
string | null

Unique identifier for an organization.

Pattern: ^org_[0-9a-f]{32}$
Example:

"org_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4"

owner_id
string | null

Unique identifier for an user.

Pattern: ^usr_[0-9a-f]{32}$
Example:

"usr_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4"

state
string | null
visibility
enum<string>
default:company

Who in the workspace can see a record: only its owner, the owner's team, the team and its sub-teams, or everyone.

Available options:
private,
team,
team_and_subteams,
company

Response

Successful Response

A contact as returned by create, update and upsert.

The same object as on reads, plus organization_resolution when the request carried organization.

created_at
string<date-time>
required
id
string
required

Unique identifier for a contact.

Pattern: ^con_[0-9a-f]{32}$
Example:

"con_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4"

status
enum<string>
required

Where the contact stands.

Available options:
open,
on_hold,
won,
lost
updated_at
string<date-time>
required
visibility
enum<string>
required

Who in the workspace can see this record. A workspace token sees every record regardless; an OAuth token sees what the person who authorized it can see.

Available options:
private,
team,
team_and_subteams,
company
address
string | null
avatar_url
string | null

Short-lived signed URL; do not store it.

channels
ContactChannel · object[]
city
string | null
company_name
string | null

Legacy alias for organization. The text is kept on the contact, and a contact that has no organization yet is also linked to the organization this name matches, or to a new one when none does. To say which organization a contact belongs to, send organization, which also tells you how the name was resolved.

custom_fields
Custom Fields · object

Every custom field defined on contacts in this workspace, keyed by field key and typed from its definition. Unset fields are null, so reading any contact shows the full set of keys in use.

email
string | null
external_id
string | null

Your own id for this record, when you set one.

first_name
string | null
job_title
string | null
last_name
string | null
lost_reason
string | null

Name of the reason, when status is lost.

name
string | null

Display name. Derived from first_name and last_name.

object
string
default:contact
Allowed value: "contact"
organization
Organization · object | null

Populated only when organization is in expand.

organization_id
string | null

Unique identifier for an organization.

Pattern: ^org_[0-9a-f]{32}$
Example:

"org_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4"

organization_resolution
ContactOrganizationResolution · object | null

How organization was resolved. Present only when the request sent organization.

owner
Owner · object | null

Whoever is responsible for this record. Always populated when the record has an owner — this is not an expand target.

owner_id
string | null
deprecated

Unique identifier for an user.

Pattern: ^usr_[0-9a-f]{32}$
Example:

"usr_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4"

phone
string | null

E.164. Normalized on write.

score
enum<string> | null

How warm a contact is.

Available options:
cold,
warm,
hot
state
string | null
tags
Tag · object[]