DoneTalk Developers Sign in

Messages

Send a template to a phone

POST /v1/c/{slug}/messages/template · Scopes: messages:send_template

In the contact's open conversation, or a new one handled the way the number handles what arrives. The contact is created if missing. idempotencyKey (or the Idempotency-Key header) prevents sending twice.

Path parameters

FieldNotes
slugThe company's identifier in DoneTalk (the key's own).

Request body

FieldTypeRequiredNotes
phonestringyes
contactNamestringnoup to 200 characters
channelIdstring (uuid)no
templateIdstring (uuid)yes
bodylist of stringnoup to 20; default []
headerlist of stringnoup to 5; default []
buttonsobjectnodefault {}
handlingone of number, teamnodefault "number"
assigneeEmailstring (email)noup to 320 characters
idempotencyKeystringyesup to 200 characters

Request example

curl -X POST "https://api.donetalk.com/v1/c/demo/messages/template" \
  -H "Authorization: Bearer $DONETALK_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "phone": "+5548999990001",
  "contactName": "Ana Souza",
  "templateId": "01a0cad0-0000-7000-8000-000000000002",
  "body": [
    "Ana",
    "ANA10"
  ],
  "idempotencyKey": "pedido-88213-lembrete"
}'

Response 201

{
  "message": {
    "id": "01a3c0de-8b22-7c33-9d44-0e55f6677889",
    "status": "queued"
  },
  "conversation": {
    "id": "01a3c0de-7a11-7b22-8c33-9d44e55f6677"
  },
  "replay": false
}

Possible errors

  • 401 unauthorized
  • 403 insufficient_scope
  • 409 template_not_approved
  • 422 validation_failed
  • 429 rate_limited

A message's status and reply

GET /v1/c/{slug}/messages/{id} · Scopes: conversations:read · messages:send_template · messages:send_text

Path parameters

FieldNotes
slugThe company's identifier in DoneTalk (the key's own).
idThe record's id.

Request example

curl -X GET "https://api.donetalk.com/v1/c/demo/messages/:id" \
  -H "Authorization: Bearer $DONETALK_KEY"

Response 200

{
  "message": {
    "id": "01a3c0de-8b22-7c33-9d44-0e55f6677889",
    "conversationId": "01a3c0de-7a11-7b22-8c33-9d44e55f6677",
    "channelId": "01a0cccc-0000-7000-8000-000000000002",
    "direction": "outbound",
    "from": null,
    "type": "template",
    "text": "Oi Ana! Seu cupom ANA10 vale até sexta. Quer usar agora?",
    "status": "read",
    "errorCode": null,
    "createdAt": "2026-10-23T13:02:11.000Z",
    "sentAt": "2026-10-23T13:02:12.000Z",
    "deliveredAt": "2026-10-23T13:02:13.000Z",
    "readAt": "2026-10-23T13:05:40.000Z",
    "reply": {
      "id": "01a0d05a-3ee3-75bd-9db5-dc9856f079c9",
      "type": "button",
      "text": "Quero o cupom",
      "at": "2026-10-23T13:05:52.000Z"
    }
  }
}

Possible errors

  • 401 unauthorized
  • 403 insufficient_scope
  • 422 validation_failed
  • 429 rate_limited

A phone's messages

GET /v1/c/{slug}/messages · Scopes: conversations:read

A phone's messages since a moment, newest first (with or without Brazil's ninth digit).

Path parameters

FieldNotes
slugThe company's identifier in DoneTalk (the key's own).

Query parameters

FieldTypeRequiredNotes
phonestringyes
sincestring (date-time)yes
channelIdstring (uuid)no
directionone of inbound, outboundno
limitintegernoup to 100; at least 1; default 20

Request example

curl -X GET "https://api.donetalk.com/v1/c/demo/messages" \
  -H "Authorization: Bearer $DONETALK_KEY"

Response 200

{
  "messages": [
    {
      "id": "01a3c0de-8b22-7c33-9d44-0e55f6677889",
      "conversationId": "01a3c0de-7a11-7b22-8c33-9d44e55f6677",
      "channelId": "01a0cccc-0000-7000-8000-000000000002",
      "direction": "outbound",
      "from": null,
      "type": "template",
      "text": "Oi Ana! Seu cupom ANA10 vale até sexta. Quer usar agora?",
      "status": "read",
      "errorCode": null,
      "createdAt": "2026-10-23T13:02:11.000Z",
      "sentAt": "2026-10-23T13:02:12.000Z",
      "deliveredAt": "2026-10-23T13:02:13.000Z",
      "readAt": "2026-10-23T13:05:40.000Z"
    }
  ]
}

Possible errors

  • 401 unauthorized
  • 403 insufficient_scope
  • 422 validation_failed
  • 429 rate_limited

This page as Markdown