API referenceThreads

Get one thread with its messages

Fetches one thread by threadId (a UUID) together with its messages, oldest first.

Endpoint
GET https://api.dairo.app/v1/threads/{threadId}

Fetches one thread by threadId (a UUID) together with its messages, oldest first. The response is the thread object — subject, status, messageCount, lastMessageAt, and timestamps — with a messages array inlined, where each message is the summary shape (from, to, subject, a 160-character textPreview, and hasHtml/hasAttachments flags) rather than the full body. At most the 100 oldest messages are returned and this array is not paginated, so for a longer thread — or to read a full textBody/htmlBody and its attachments — list messages filtered by threadId or fetch each message by id. Returns 404 when the thread does not exist or belongs to another account, and 400 when threadId is not a valid UUID. Requires the messages:read scope; see messages and threads.

Scope: messages:read. Send the API key as a bearer token; Scopes lists what each one reaches.

Request

cURL
curl "https://api.dairo.app/v1/threads/3fa85f64-5717-4562-b3fc-2c963f66afa6" \
  -H "Authorization: Bearer $DAIRO_API_KEY"

Path parameters

NameTypeRequiredDescription
threadIdstringyesThe thread's ID.

Response

200 Success. Body: application/json, ThreadResponse.

FieldTypeRequiredDescription
object"thread"no
idstring (uuid)yes
inboxIdstring (uuid)yes
subjectstringyes
messageCountintegeryes(minimum 0)
lastMessageAtstring (date-time) or nullyes
updatedAtstring (date-time)yes
statusstringyes
lastMessagePreviewstring or nullyes
createdAtstring (date-time)yes
channel"email", "a2a"yesThe channel this message transited: "email" (external, over SES) or "a2a" (internal Dairo-to-Dairo, which skips SES). Reserved future values (sms, whatsapp, …) are not yet wired.
messagesarray of Messageyes
200
{
  "object": "thread",
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "inboxId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "subject": "Hello from Acme",
  "messageCount": 0,
  "lastMessageAt": "2026-10-19T09:30:00Z",
  "updatedAt": "2026-10-19T09:30:00Z",
  "status": "string",
  "lastMessagePreview": "string",
  "createdAt": "2026-10-19T09:30:00Z",
  "channel": "email",
  "messages": [
    {
      "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "inboxId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "threadId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "direction": "inbound",
      "status": "string",
      "from": {
        "address": "support@yourapp.com",
        "name": "Ada Lovelace"
      },
      "to": [
        "string"
      ],
      "cc": [
        "string"
      ],
      "bcc": [
        "string"
      ],
      "subject": "Hello from Acme",
      "textPreview": "string",
      "hasHtml": true,
      "hasAttachments": true,
      "receivedAt": "2026-10-19T09:30:00Z",
      "createdAt": "2026-10-19T09:30:00Z",
      "textBody": null,
      "htmlBody": null,
      "attachments": [
        {
          "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "filename": null,
          "contentType": null,
          "sizeBytes": null,
          "contentId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "createdAt": "2026-10-19T09:30:00Z",
          "messageId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "disposition": "attachment"
        }
      ],
      "structured": {},
      "extractionStatus": "skipped",
      "channel": "email",
      "channelMetadata": {}
    }
  ]
}

Errors

Every error has the same body, {"error": {"type", "code", "message", "param"}}; branch on code. Errors lists every code.

StatusMeaning
400The request is malformed or a value is invalid (invalid_request, invalid_domain, idempotency_key_mismatch).
401The API key is missing or invalid.
403The key lacks the scope this endpoint needs (scope_missing) or may not do this (not_permitted).
404No such resource in this account (resource_not_found).
422The request is well-formed but a field failed validation (validation_failed).
429Rate limit, plan limit, budget or spend cap reached (rate_limited, plan_limit_reached, budget_exceeded, spend_cap_reached).
500An unexpected error; retry with backoff, then contact support (internal_error).

On this page