Skip to content
Klozzo API
OpenAPI Postman

Reference

Messages

Messages are individual entries in a conversation. Each carries a channel (sms, email, whatsapp, etc.), direction (inbound or outbound), and lifecycle timestamps (sent_at, delivered_at, read_at). Outbound messages are routed by ChannelRouter to the appropriate provider integration.

List messages in a conversation

Lists the messages of one conversation, oldest first, cursor-paginated by id. For infinite scroll, page backwards using prev_cursor.

GET /api/conversations/{conversation_id}/messages

Path parameters

  • conversation_id integer required

    Conversation ID.

    Example: 17

Query parameters

  • per_page integer

    Rows per page. Default 50, maximum 200. See Lists, paging and filters.

    Example: 50

  • cursor string

    Opaque cursor from a previous response.

    Example: architecto

curl --request GET \
    --get "https://klozzo.com/api/conversations/17/messages?per_page=50&cursor=architecto" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
{
    "data": [
        {
            "id": 9001,
            "conversation_id": 17,
            "channel": "whatsapp",
            "direction": "outbound",
            "body": "Hi Ada, your appointment is confirmed.",
            "attachments": null,
            "status": "delivered",
            "provider_message_id": "wamid.HBgN...",
            "sent_at": "2026-06-05T13:42:00+00:00",
            "delivered_at": "2026-06-05T13:42:02+00:00",
            "read_at": null,
            "error": null,
            "user_id": 7,
            "created_at": "2026-06-05T13:42:00+00:00"
        }
    ],
    "next_cursor": "eyJpZCI6OTAwMSwiX3BvaW50c1RvTmV4dEl0ZW1zIjp0cnVlfQ",
    "prev_cursor": null
}
  • data object[]

    • id integer

    • conversation_id integer

    • channel string

    • direction string

    • body string

    • attachments string

    • status string

    • provider_message_id string

    • sent_at string

    • delivered_at string

    • read_at string

    • error string

    • user_id integer

    • created_at string

  • next_cursor string

  • prev_cursor string

Send a message

Records the outbound message immediately (returning 201) and dispatches delivery via the appropriate provider asynchronously. Poll the message resource for delivered_at / read_at updates, or subscribe to outbound webhooks (message.delivered, message.read).

POST /api/conversations/{conversation_id}/messages

If recipient is omitted, it is inferred from the contact:

  • emailcontact.email
  • everything else → contact.phone_e164 or contact.phone

Path parameters

  • conversation_id integer required

    Conversation ID.

    Example: 17

Body parameters

  • channel string required

    Channel to send on. One of sms, email, whatsapp, messenger, instagram, gmb.

    Example: whatsapp

  • body string required

    Message body (plain text). Max 8000 chars.

    Example: Hi Ada, your appointment is confirmed.

  • attachments string[]

    Optional list of attachment URLs. Provider-specific support.

    Example: ["architecto"]

  • recipient string

    Override destination (e.g. specific email or phone). Defaults to the contact's primary handle for the channel.

    Example: architecto

curl --request POST \
    "https://klozzo.com/api/conversations/17/messages" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"channel\": \"whatsapp\",
    \"body\": \"Hi Ada, your appointment is confirmed.\",
    \"attachments\": [
        \"architecto\"
    ],
    \"recipient\": \"architecto\"
}"
{
    "data": {
        "id": 9001,
        "conversation_id": 17,
        "channel": "whatsapp",
        "direction": "outbound",
        "body": "Hi Ada, your appointment is confirmed.",
        "attachments": null,
        "status": "queued",
        "provider_message_id": null,
        "sent_at": null,
        "delivered_at": null,
        "read_at": null,
        "error": null,
        "user_id": 7,
        "created_at": "2026-06-05T13:42:00+00:00"
    }
}
  • data object

    • id integer

    • conversation_id integer

    • channel string

    • direction string

    • body string

    • attachments string

    • status string

    • provider_message_id string

    • sent_at string

    • delivered_at string

    • read_at string

    • error string

    • user_id integer

    • created_at string