List conversation messages

Paginate messages of one conversation. Useful when the message thread is large.

GET /api/v1/conversations/:id/messages

Paginate the messages of a single conversation. Useful when the conversation has hundreds of messages and you don't want to load the whole thread at once.

Scope: conversations:read

Sort order

This endpoint returns messages oldest first, the natural reading order of a chat thread. This is the opposite of the conversation list endpoint (which is newest first).

Path parameters

ParamTypeNotes
:idstringConversation ID.

Query parameters

ParamTypeDefaultNotes
cursorstringMessage ID from a previous response's meta.next_cursor. Format: msg_<24 hex>.
limitinteger50Page size. Range 1–100.

Example request

curl 'https://dashboard.getmacha.com/api/v1/conversations/conv_6a392325.../messages?limit=20' \
  -H "Authorization: Bearer $MACHA_API_KEY"

Example response

{
  "data": [
    {
      "id": "msg_64f1c0...",
      "role": "user",
      "content": "process ticket 549",
      "tool_calls": null,
      "tool_call_id": null,
      "tool_name": null,
      "connector_type": null,
      "model": null,
      "created_at": "2026-06-10T05:25:59.500Z"
    },
    {
      "id": "msg_64f1c1...",
      "role": "assistant",
      "content": "",
      "tool_calls": [
        { "id": "call_abc", "name": "zendesk_get_ticket", "arguments": "{\"id\":549}", "status": "completed" }
      ],
      "tool_call_id": null,
      "tool_name": null,
      "connector_type": null,
      "model": "gpt-5",
      "created_at": "2026-06-10T05:26:01.100Z"
    },
    {
      "id": "msg_64f1c2...",
      "role": "tool",
      "content": "{\"id\":549,\"subject\":\"Refund please\",\"status\":\"open\"}",
      "tool_call_id": "call_abc",
      "tool_name": "zendesk_get_ticket",
      "connector_type": "zendesk",
      "created_at": "2026-06-10T05:26:01.450Z"
    }
  ],
  "meta": {
    "request_id": "req_...",
    "next_cursor": "msg_64f1c2..."
  }
}

Tool messages, parse the content

For role: "tool" messages, content is a JSON-stringified blob containing the tool's response. Attempt JSON.parse before treating it as text:

function parseMessageContent(msg) {
  if (msg.role !== 'tool') return msg.content;
  try { return JSON.parse(msg.content); }
  catch { return msg.content; } // not JSON, return raw string
}

Errors

StatusCodeWhen
404conversation_not_foundUnknown conversation ID.
422validation_failedBad cursor, limit out of range, etc.

© 2026 AGZ Technologies Private Limited