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 Sahut REST API lets you integrate Sahut programmatically into your systems. Use the API to sync contacts from your CRM, send proactive messages, retrieve conversation history, or build a chatbot that responds automatically to customer messages. All API requests are made over HTTPS. The API returns JSON for all responses.

Base URL

https://api.sahut.id/v1
All endpoints in this reference are relative to this base URL.

Request format

Send requests as JSON with the Content-Type: application/json header. For GET requests, pass parameters as query string parameters.
# Example: list conversations
curl https://api.sahut.id/v1/conversations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"

Response format

All responses return a JSON object. Successful responses include a data field containing the result. Error responses include an error object. Success response:
{
  "data": {
    "id": "conv_01HX2B9K3M5N7P",
    "status": "open",
    "created_at": "2024-03-15T08:30:00Z"
  }
}
Error response:
{
  "error": {
    "code": "not_found",
    "message": "Conversation not found",
    "status": 404
  }
}

Error codes

HTTP StatusError codeMeaning
400bad_requestRequest is missing required fields or has invalid values
401unauthorizedMissing or invalid API key
403forbiddenYour API key doesn’t have permission for this action
404not_foundThe requested resource doesn’t exist
422validation_errorRequest data failed validation
429rate_limitedToo many requests — slow down
500server_errorSahut server error — try again later

Rate limits

The API enforces rate limits per API key:
PlanRequests per minute
Starter60
Pro300
Business1,000
When you exceed the rate limit, the API returns 429 Too Many Requests with a Retry-After header indicating how many seconds to wait.

Pagination

List endpoints return paginated results. Use the page and per_page query parameters to navigate:
GET /conversations?page=2&per_page=25
Responses include pagination metadata:
{
  "data": [...],
  "meta": {
    "total": 142,
    "page": 2,
    "per_page": 25,
    "total_pages": 6
  }
}

Timestamps

All timestamps in the API are in ISO 8601 format (UTC): 2024-03-15T08:30:00Z.