Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.sahut.id/llms.txt

Use this file to discover all available pages before exploring further.

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.

List contacts

GET /contacts

Query parameters

q
string
Search query. Matches against name, phone number, and email.
tag
string
Filter contacts by tag name.
page
integer
Page number. Default: 1.
per_page
integer
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
  }
}

Get a contact

GET /contacts/{id}
id
string
required
Contact ID.

Create a contact

POST /contacts

Request body

name
string
required
Contact’s full name.
phone
string
Phone number in E.164 format (e.g., +628123456789).
email
string
Email address.
company
string
Company name.
tags
array
Array of tag strings to apply (e.g., ["vip", "prospect"]).
custom_attributes
object
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"
  }
}

Update a contact

PUT /contacts/{id}
id
string
required
Contact ID to update.
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"]
  }'