Update a contact

Example Request & Response

$ curl https://api.intercom.io/contacts/<id> \\\n-X PUT \\\n-H 'Authorization:Bearer <Your access token>' \\\n-H 'Accept:application/json'\n-H 'Content-Type: application/json' -d\n\n{\n\t\"role\": \"user\",\n\t\"external_id\": \"25\",\n\t\"email\": \"email@example.com\",\n\t\"phone\": \"+1123456789\",\n\t\"name\": \"Joe Example\",\n\t\"avatar\": \"https://example.org/128Wash.jpg\",\n\t\"last_seen_at\": 1571069751,\n\t\"signed_up_at\": 1571069751,\n\t\"owner_id\": 127,\n\t\"unsubscribed_from_emails\": false,\n\t\"custom_attributes\": {\n\t\t\"paid_subscriber\": true,\n\t\t\"monthly_spend\": 155.5,\n\t\t\"team_mates\": 1\n\t}\n}\n

Example Errors

HTTP/1.1 404 FOUND
{
  "type": "error.list",
  "request_id": "9a3d0816-9707-4598-977e-c009ba630148",
  "errors": [
    {
      "code": "not_found",
      "message": "Contact Not Found"
    }
  ]
}
HTTP/1.1 409 CONFLICT
{
  "type": "error.list",
  "request_id": "80ec9d92-99ff-4da9-9a0e-c0ab7c42f7e7",
  "errors": [
    {
      "code": "conflict",
      "message": "A contact matching those details already exists with id=5da6f18e3d7cf967e4582d05"
    }
  ]
}
HTTP/1.1 400 UNPROCESSABLE ENTITY
{
  "type": "error.list",
  "request_id": "00043csj9iva7pl9mmmg",
  "errors": [
    {
      "code": "client_error",
      "message": "Contact with user role can't be converted to a lead"
    }
  ]
}
HTTP/1.1 400 BAD REQUEST
{
  "type": "error.list",
  "request_id": "00043csj9iva7pl9mmmg",
  "errors": [
    {
      "code": "parameter_invalid",
      "message": "The owner specified is not a member of the workspace"
    }
  ]
}

You can update an existing contact (ie. user or lead).

Request Path Parameters

ParameterTypeRequired?Description
idStringYesThe unique identifier for the contact which is given by Intercom

Request Body Parameters

AttributeTypeRequired?Description
roleStringYesThe role of the contact. Accepted values are user or lead (only if lead already).
external_idStringYes - if role is user and email is blankA unique identifier for the contact which is given to Intercom.
emailStringYes - if role is lead, or if role is user and external_id is blankThe contacts email.
phoneStringNoThe contacts phone.
nameStringNoThe contacts name.
avatarStringNoAn image URL containing the avatar of a contact.
owner_idStringNoThe id of an admin that has been assigned account ownership of the contact.
signed_up_atDate (UNIX timestamp)NoThe time specified for when a contact signed up.
last_seen_atDate (UNIX timestamp)NoThe time when the contact was last seen (either where the Intercom Messenger was installed or when specified manually).
owner_idIntegerNoThe id of an admin that has been assigned account ownership of the contact.
unsubscribed_from_emailsBooleanNoWhether the contact is unsubscribed from emails.
custom_attributesObjectNoThe custom attributes which are set for the contact.
Creating new Custom Data Attributes

You can only write to custom data attributes that already exist on the workspace. If you need to create new attributes to write to, you should Create Data Attributes through the data Attributes API.

Response

This will return a Contact model of the contact you just updated.