v1

latestOpenAPI 3.0.02026-08-067074272.5 KB
Contacts

Add or remove a group, contact tag, or custom field to a contact with the given phone number

Adds or removes a group, contact tag, or custom field to a contact (depending on the secondary boolean value in the request body).

patch/dashboards/{dashboard_id}/contacts/{phone_number}

Path parameters

dashboard_idinteger required
Example:121

Id of dashboard

phone_numberstring required

Phone number

Request body

groupsinteger[]

An array of group identifiers that reference group membership to add or remove from the contact.

add_group_to_contactboolean

Whether to add or remove the contact tag from the contact. True means add. False means remove. This will only do something if a value for group is provided.

contact_tagsstring[]

An array of the contact's tags to add or remove from the contact.

add_tag_to_contactboolean

Whether to add or remove the contact tag from the contact. True means add. False means remove. This will only do something if a value for contact_tag is provided.

custom_field_idstring

A custom field identifier for a custom field to edit/add to this contact. This argument is optional and can be omitted or set to null, which will cause no change to the contact's custom fields.

custom_field_valueboolean

The new value for the custom field. This will only do something if a value for custom_field_id is provided.

Example request

{
  "groups": [
    12,
    26
  ],
  "add_group_to_contact": true,
  "contact_tags": [
    "a8608167-caf8-485c-a0c5-d97fb0fc9069",
    "54b35406-189d-4e70-a170-c87e231f8ca3"
  ],
  "add_tag_to_contact": true,
  "custom_field_id": "cc63eb7d-3575-478f-b42e-1e64e40d41c9"
}

Response

The new/updated contact.

phone_numberstring

The contact's phone number.

first_namestring

The contact's first name.

last_namestring

The contact's last name.

display_namestring

The contact's display name.

thread_idstring

The id of the thread for this contact's conversation on this dashboard. To access the thread of this contact in the webapp, go to https://app.textrequest.com/app/thread/<thread_id>

is_suppressedboolean

Whether the contact is suppressed.

is_archivedboolean

Whether the contact is archived.

is_blockedboolean

Whether the contact is blocked.

suppressed_reasonstring

For notekeeping, a reason why the contact was suppressed.

notestring

Any text notes for the contact.

groupsinteger[]

An array of group identifiers that reference group membership.

contact_tagsstring[]

An array of the contact's tags.

is_resolvedboolean

Whether or not their conversation thread is currently resolved.

first_contact_utcstring

When the contact was first messaged. All dates are UTC.

opted_out_utcstring

When the contact opted out. Null if the contact has not and can receive messages.

last_msg_sent_utcstring date-time

When the contact was last sent a message.

last_msg_received_utcstring date-time

When this dashboard last received a message from a contact.

total_msgs_sentinteger

Total messages sent to a contact.

total_msgs_receivedinteger

Total messages received from a contact.

response_countinteger

Total number of response messages from the contact.

date_created_utcstring date-time

When the contact was created.

last_contact_date_utcstring date-time

When the contact was last contacted.

last_messageobject

Last message sent to or from this contact.

Example response

{
  "phone_number": "13216547890",
  "first_name": "John",
  "last_name": "Smith",
  "display_name": "John Smith",
  "thread_id": "166382ad-72ce-466a-bc64-ce5247905e43",
  "suppressed_reason": "Contact asked not to be texted.",
  "note": "Lead from newsletter",
  "groups": [
    12,
    26
  ],
  "contact_tags": [
    "a8608167-caf8-485c-a0c5-d97fb0fc9069",
    "54b35406-189d-4e70-a170-c87e231f8ca3"
  ],
  "custom_fields": [
    {
      "id": "cc63eb7d-3575-478f-b42e-1e64e40d41c9",
      "value": "john.doe@gmail.com"
    }
  ]
}