All pages

API reference

Change a contact

PATCH /v1/contacts/{contact_id}

View as Markdown

Change what you send and keep the rest. attributes is replaced whole: send every attribute the person should have. Campaigns already made keep the details they copied; the next one, and the next inbound call, read these. Needs contacts:write and a live key.

Parameters

Name In Type Required Description
contact_id path string (uuid) Yes

Body

Sent as JSON. A field this operation does not take is refused, so a typo fails loudly.

Field Type Required Description
attributes object or null No Replaces every attribute they had: send the whole set.
name string or null No
phone string or null No
timezone string or null No Send null for your organization's own time zone.

Answer

200 with Contact.

Errors

Every error is a problem document with a stable code.

Status When
401 The key is missing, mistyped, unknown, revoked or expired.
403 A test key, or a key limited to some agents.
404 This key reaches no such contact.
409 Another contact in the project has the new number, or it is frozen.
422 Not a phone number, or not a time zone.
429 Too many requests for this key or its organization; see Retry-After.
500 Something went wrong on our side. Quote the request_id to support.

Examples

Change a contact
#!/bin/sh
# Change a contact. attributes is replaced whole: send every one they should have.
curl -sS --fail-with-body -X PATCH "https://api.aigently.ai/v1/contacts/5d7f9b1c-3e5a-4c7e-9b1d-3f5a7c9e1b3d" \
  -H "Authorization: Bearer $AIGENTLY_API_KEY" \
  --json '{
  "attributes": {
    "first_name": "Sara",
    "member_since": "2021"
  }
}'

Try it

Sends this request to the API from your browser, with a test key. Nothing it does rings a phone.