Skip to main content
PUT
/
api
/
contacts
/
{id}
curl --request PUT \
  --url https://api.automatechats.com/api/contacts/{id} \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "firstName": "Jane",
  "lastName": "Smith",
  "email": "jane.smith@example.com"
}
'
{
  "status": "success",
  "code": 200,
  "message": "Contact updated successfully",
  "data": {
    "contact": {
      "id": "65e0bc51c12e4d70834b070e",
      "firstName": "John",
      "lastName": "Doe",
      "chatName": "John Doe",
      "email": "john.doe@example.com",
      "phoneNumber": "9876543210",
      "countryCode": "+91",
      "source": "manual",
      "subscribed": true,
      "tagsId": [
        "65e0bc51c12e4d70834b070e"
      ],
      "tags": [
        {
          "tagId": "65e0bc51c12e4d70834b070e",
          "name": "VIP",
          "text_color": "#ffffff",
          "background_color": "#ef4444"
        }
      ],
      "customFields": [
        {
          "id": "65f12ab3c9e4f1a2b3c4d5e6",
          "label": "Company Name",
          "value": "Google Deepmind"
        }
      ],
      "dob": "1990-01-15",
      "anniversary": "2020-06-20",
      "workspaceId": 246,
      "createdBy": "6996aeeedf12574080a99d81",
      "createdAt": "2026-05-18T15:00:00.000Z",
      "updatedAt": "2026-05-18T15:05:00.000Z"
    }
  },
  "timestamp": "2023-11-07T05:31:56Z"
}
{
"status": "error",
"code": 400,
"message": "Invalid input: field first_name is required.",
"error": "<unknown>",
"timestamp": "2026-05-18T15:00:00.000Z"
}
{
"status": "error",
"code": 401,
"message": "Unauthorized access: Invalid or missing authentication credentials.",
"timestamp": "2026-05-18T15:00:00.000Z"
}
{
"status": "error",
"code": 400,
"message": "Invalid input: field first_name is required.",
"error": "<unknown>",
"timestamp": "2026-05-18T15:00:00.000Z"
}
{
"status": "error",
"code": 400,
"message": "Invalid input: field first_name is required.",
"error": "<unknown>",
"timestamp": "2026-05-18T15:00:00.000Z"
}
Use this endpoint to modify an existing contact’s profile. You must provide the unique 24-character contact id in the URL path. All body parameters are optional. You only need to send the specific fields you want to change. This is a unified endpoint. You can update standard profile fields, assign or remove tags, and modify custom field values in a single request. To update tags, you must provide the complete array of tagsId that the contact should have. To update custom fields, you only need to pass the specific fields you wish to update within the customFields array.

Authorizations

X-API-Key
string
header
required

Path Parameters

id
string
required

The unique 24-character ID of the contact to update.

Body

application/json
firstName
string

Contact's first name

Required string length: 2 - 50
Example:

"John"

lastName
string

Contact's last name

Maximum string length: 50
Example:

"Doe"

chatName
string

Formatted name used in active chats

Maximum string length: 100
Example:

"John Doe"

email
string<email>

Contact's email address

Example:

"john.doe@example.com"

phoneNumber
string

Phone number without country code

Example:

"9876543210"

countryCode
string

Country code including '+'

Example:

"+91"

source
string

Custom source identifier

Maximum string length: 50
Example:

"website"

subscribed
boolean

WhatsApp subscription status

tagsId
string[]

Complete updated list of 24-character hexadecimal MongoDB Tag IDs.

Example:
["65e0bc51c12e4d70834b070e"]
customFields
object[]

Complete list of custom fields to update/override. If a custom field is not supplied, its value is retained.

dob
string<date>

Date of Birth (YYYY-MM-DD)

Example:

"1990-01-15"

anniversary
string<date>

Anniversary date (YYYY-MM-DD)

Example:

"2020-06-20"

Response

Contact updated successfully

status
string
Example:

"success"

code
integer
Example:

200

message
string
Example:

"Contact updated successfully"

data
object
timestamp
string<date-time>