Managing conversations

The send endpoint returns a conversation_id. It is the conversation’s display id, the same number your agents see in the dashboard, and every endpoint on this page takes it in the path. All of them accept the same api_access_token header as the send endpoint.

Read a conversation

$curl https://your-installation.example.com/api/v1/accounts/1/developer/conversations/1234 \
> -H "api_access_token: $HAMS_TOKEN"

The can_reply field tells you whether a plain text message would be delivered right now. Read it before you send, instead of handling outside_messaging_window after the fact.

Reply in a thread

POST /accounts/{account_id}/developer/conversations/{conversation_id}/messages
1{ "content": "It is on its way." }

Prefer the send endpoint with conversation_id. It accepts the same input and also checks the messaging window before it accepts the request. Use the endpoint above when you want a private note, which agents read and the customer never receives:

1{ "content": "Customer called about this too.", "private": true }

Change the status

POST /accounts/{account_id}/developer/conversations/{conversation_id}/toggle_status
1{ "status": "resolved" }

Valid values are open, resolved, pending, and snoozed. Snoozing takes an extra snoozed_until, a Unix timestamp in seconds. The API rejects an ISO-8601 string.

Resolving changes threading. The next message you send to that contact opens a new conversation rather than continuing this one.

Set priority, labels, and assignment

Priority

POST .../toggle_priority with {"priority": "urgent"}. Send null to clear it.

Labels

GET .../labels lists them. POST .../labels with {"labels": ["vip", "refund"]} replaces the whole set, so send every label you want to keep.

Assignment

POST .../assignments with {"assignee_id": 7}, or {"team_id": 3} for a team. Send {"assignee_id": null} to unassign.

Custom attributes

POST .../custom_attributes with {"custom_attributes": {"crm_id": "9912"}}. Replaces the whole object.