The Contacts API lets you manage customer profiles in Sahut. Use it to sync contacts from your CRM, update contact details when customers change their info, or search for contacts before creating a new conversation.
Query parameters
Search query. Matches against name, phone number, and email.
Filter contacts by tag name.
Results per page. Default: 25. Max: 100.
Example request
curl "https://api.sahut.id/v1/contacts?q=budi&per_page=5" \
-H "Authorization: Bearer YOUR_API_KEY"
Example response
{
"data": [
{
"id": "ct_01HX3C0L4N6P8Q",
"name": "Budi Santoso",
"email": "budi@example.com",
"phone": "+628123456789",
"company": "PT Contoh Indonesia",
"tags": ["vip", "reseller"],
"created_at": "2024-01-10T10:00:00Z"
}
],
"meta": {
"total": 1,
"page": 1,
"per_page": 5,
"total_pages": 1
}
}
Request body
Phone number in E.164 format (e.g., +628123456789).
Array of tag strings to apply (e.g., ["vip", "prospect"]).
Key-value pairs for any custom attributes defined in your workspace.
Example request
curl -X POST https://api.sahut.id/v1/contacts \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Siti Rahma",
"phone": "+628987654321",
"email": "siti@example.com",
"tags": ["prospect"],
"custom_attributes": {
"customer_tier": "silver"
}
}'
Example response
{
"data": {
"id": "ct_01HX4D1M5O7Q9R",
"name": "Siti Rahma",
"phone": "+628987654321",
"email": "siti@example.com",
"company": null,
"tags": ["prospect"],
"custom_attributes": {
"customer_tier": "silver"
},
"created_at": "2024-03-15T10:00:00Z"
}
}
The request body accepts the same fields as POST /contacts. Only include the fields you want to update — omitted fields remain unchanged.
Example request
curl -X PUT https://api.sahut.id/v1/contacts/ct_01HX3C0L4N6P8Q \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"company": "PT Baru Indonesia",
"tags": ["vip", "reseller", "platinum"]
}'