Skip to content

Update a contact

PATCH
/contacts/{id}
curl --request PATCH \
--url https://app.surveyrock.com/api/v1/contacts/example \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: example' \
--header 'If-Match: example' \
--data '{ "email": "hello@example.com", "first_name": "example", "last_name": "example", "customFields": {} }'

Requires an If-Match header: the contact’s current ETag, from any read of it (the ETag header, or meta.etag in the body), or * to skip the check. An update whose ETag is stale (the contact was written since) is refused with 412 and changes nothing. A contact’s ETag changes with every write to it, including its custom-field values. The response carries the next ETag.

id
required
string
Idempotency-Key
required
string
>= 1 characters <= 128 characters

1 to 128 characters, chosen by the caller. A retry with the same key and body replays the first response instead of applying the write twice; the same key with a different body is a 409

If-Match
required
string

The contact’s current ETag (from a read), or *

Media typeapplication/json
object
email
string format: email
first_name
string
last_name
string
customFields

Values keyed by the id of one of the workspace’s custom fields; an id that is not one is a 422

object
Examplegenerated
{
"email": "hello@example.com",
"first_name": "example",
"last_name": "example",
"customFields": {}
}

Contact updated

ETag
string
Example
"element:abc123:1790690123456789"

The resource’s current version, as a strong validator. Opaque: send it back unchanged as If-Match. Also returned as meta.etag in the body, for a client that only sees the body.

Contact not found

The ETag in If-Match is stale: the contact was written since

A customFields key is not a custom field of this workspace: each error names the field

If-Match header required