Overview
This endpoint allows you to update an existing contact’s information in your Setter AI account. You can update contact details like name, email, phone number, timezone, and custom metadata fields.
Contact Identification: You must provide at least one identifier (ID, WhatsApp ID, or SMS phone number) to locate the contact.
You can identify a contact using any of these methods:
Use the internal contact ID for direct lookup:
{
"id": 123,
"firstName": "John"
}
By WhatsApp ID
Use the WhatsApp ID for contacts from WhatsApp integrations:
{
"waId": "1234567890",
"email": "john@example.com"
}
By SMS Phone Number
Use the SMS phone number for contacts from SMS integrations:
{
"smsPhoneNumber": "1234567890",
"fullName": "John Doe"
}
Updatable Fields
All contact fields are optional in the update request. Only provided fields will be updated:
- firstName - Contact’s first name
- lastName - Contact’s last name
- fullName - Contact’s full name
- phoneNumber - Contact’s phone number
- email - Contact’s email address (must be valid format)
- defaultTimeZone - Contact’s default timezone (IANA format)
- metadata - Custom key-value pairs for additional contact data
Important Notes
- Authentication: All requests require a Bearer token in the Authorization header
- Unique Contact: If multiple contacts match the identifier, the operation fails with a 409 error
- Access Control: Only contacts that your organization has access to can be updated
- Validation: Email addresses are validated for proper format
- Metadata: The metadata field supports custom key-value pairs for storing additional contact information
Error Handling
The endpoint provides specific error responses for different scenarios:
- 400: Missing identifier or invalid field format
- 404: No contacts found with the provided identifier
- 409: Multiple contacts matched the identifier
- 401/403: Authentication or authorization errors
Getting Your API Key
API keys can be generated from your Setter AI dashboard under Settings > API Keys. Keep your API key secure and never expose it in client-side code.
Example Usage
curl -X PUT https://chat.trysetter.com/api/v1/contacts \
-H "Authorization: Bearer your_api_key" \
-H "Content-Type: application/json" \
-d '{
"id": 123,
"firstName": "John",
"lastName": "Smith",
"email": "john.smith@example.com"
}'
curl -X PUT https://chat.trysetter.com/api/v1/contacts \
-H "Authorization: Bearer your_api_key" \
-H "Content-Type: application/json" \
-d '{
"waId": "1234567890",
"metadata": {
"source": "updated_via_api",
"campaign": "winter2024",
"last_interaction": "2024-01-15"
}
}'
Bearer token authentication using your API key
Contact ID for direct lookup
WhatsApp ID for contact lookup
SMS phone number for contact lookup
Contact's default timezone
Custom key-value pairs to store with the contact
Example:{
"source": "website",
"campaign": "summer2024"
}
Contact updated successfully
Example:"Contact updated successfully"