Skip to main content
PATCH
Merge Contact Data
Use this endpoint when an external system needs to update only part of the state stored against a caller’s phone number. PATCH merges top-level fields into the existing object without replacing unrelated fields. Set a field to null to delete that field. If no data exists yet, the patch starts with an empty object. A PATCH without ttlSeconds preserves the existing expiration; provide a new value to replace it. The data is scoped to your organization and the phone number. A previously unknown number gets a contact automatically. US numbers can be formatted or sent as digits. Non-US numbers must include the + country code. URL-encode the + when it appears in the path.
For example, if the stored object is {"five9ConversationId":"conv-48291","routingStatus":"queued"}, the request above leaves {"routingStatus":"completed"}. The response contains the normalized phone number, the merged object, its revision, and expiration metadata:
The serialized data object may be at most 64 KiB. When supplied, ttlSeconds must be an integer from 60 seconds through 90 days. Without an explicit TTL, a record has no expiry by default or keeps its current expiry when patching an existing record. The endpoint returns 401 when authentication fails and 422 when the phone number or request body is invalid.

Authorizations

Authorization
string
header
required

Path Parameters

phoneNumber
string
required

The caller's phone number. US numbers may be formatted or sent as digits; non-US numbers must include the + country code.

Body

application/json
data
object
required

The JSON object to store. Its serialized UTF-8 size may not exceed 64 KiB.

ttlSeconds
integer

Optional expiration in seconds. Omit for no expiry; allowed values range from 60 seconds through 90 days.

Required range: 60 <= x <= 7776000

Response

Contact data merged.

phoneNumber
string
required

The normalized phone number in E.164 format.

data
object
required

The stored JSON object.

revision
integer
required

The revision number of this value.

Required range: x >= 1
ttlSeconds
integer | null
required

Remaining TTL in seconds, or null when the record has no expiry.

expiresAt
string<date-time> | null
required

Expiration timestamp in UTC, or null when the record has no expiry.