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
| Field | Type | Description |
|---|---|---|
| id | uuid | Unique thread identifier |
| inbox_id | uuid | Parent inbox ID |
| subject | string | Thread subject line |
| last_at | timestamp | Time of the most recent message |
| msg_count | int | Total number of messages in the thread |
GET
/api/v1/inboxes/{id}/threadsAPI KeyList Threads
List all conversation threads in an inbox, ordered by most recent activity.
Path Parameters
iduuidInbox 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 KeyGet Thread
Get a specific thread with all its messages in chronological order.
Path Parameters
iduuidInbox ID
tiduuidThread 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 KeyReply to Thread
Send a reply within an existing thread. The reply is sent to the original sender.
Path Parameters
iduuidInbox ID
tiduuidThread ID
Request Body
bodystring*Plain text reply body
htmlstringHTML 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..." } }