API Reference

Threads

Email threads group related messages into conversations. Threads are created automatically when emails share the same subject line or reply chain.

Thread Object

FieldTypeDescription
iduuidUnique thread identifier
inbox_iduuidParent inbox ID
subjectstringThread subject line
last_attimestampTime of the most recent message
msg_countintTotal number of messages in the thread
GET/api/v1/inboxes/{id}/threadsAPI Key

List Threads

List all conversation threads in an inbox, ordered by most recent activity.

Path Parameters

iduuid

Inbox ID

cURL
curl https://api.agentemail.email/api/v1/inboxes/{id}/threads \
  -H "X-API-Key: ak_your_key"

Response

{
  "success": true,
  "data": [{
    "id": "thread-uuid...",
    "subject": "Re: Account verification",
    "last_at": "2026-03-27T16:00:00Z",
    "msg_count": 3
  }]
}
GET/api/v1/inboxes/{id}/threads/{tid}API Key

Get Thread

Get a specific thread with all its messages in chronological order.

Path Parameters

iduuid

Inbox ID

tiduuid

Thread ID

cURL
curl https://api.agentemail.email/api/v1/inboxes/{id}/threads/{tid} \
  -H "X-API-Key: ak_your_key"

Response

{
  "success": true,
  "data": {
    "id": "thread-uuid...",
    "subject": "Re: Account verification",
    "messages": [{
      "id": "msg-1...",
      "direction": "inbound",
      "from": "support@example.com",
      "body_text": "Please verify..."
    }, ...]}
}
POST/api/v1/inboxes/{id}/threads/{tid}/replyAPI Key

Reply to Thread

Send a reply within an existing thread. The reply is sent to the original sender.

Path Parameters

iduuid

Inbox ID

tiduuid

Thread ID

Request Body

bodystring*

Plain text reply body

htmlstring

HTML reply body (optional)

cURL
curl -X POST https://api.agentemail.email/api/v1/inboxes/{id}/threads/{tid}/reply \
  -H "X-API-Key: ak_your_key" \
  -H "Content-Type: application/json" \
  -d '{"body":"Thanks, I have verified my account."}'

Response

{
  "success": true,
  "data": {
    "id": "msg-uuid...",
    "direction": "outbound",
    "thread_id": "thread-uuid..."
  }
}