Skip to main content
Every email conversation is stored as a thread — a chronological sequence of messages. Your AI reads the full thread before drafting a reply, ensuring it always has complete context.

Thread Structure

Thread
├── message (inbound — from recipient)
├── message (outbound — sent by AI)
├── message (inbound — reply from recipient)
└── draft (pending AI reply)

Thread States

StatusMeaning
openActive conversation, no pending draft
needs_reviewA draft is pending human approval
closedConversation resolved

Reading Threads

# List all threads
curl https://api.actionlayer.dev/v1/threads \
  -H "Authorization: Bearer YOUR_API_KEY"

# Get a specific thread with full message history
curl https://api.actionlayer.dev/v1/threads/{thread_id} \
  -H "Authorization: Bearer YOUR_API_KEY"
The thread detail response includes all messages in order, plus any pending draft.

Filtering

# Threads needing review
curl "https://api.actionlayer.dev/v1/threads?needs_review=true" \
  -H "Authorization: Bearer YOUR_API_KEY"

# Threads for a specific identity
curl "https://api.actionlayer.dev/v1/threads?identity_id=IDENTITY_ID" \
  -H "Authorization: Bearer YOUR_API_KEY"

Thread Continuity

ActionLayer matches inbound replies to existing threads using standard email In-Reply-To and References headers. New emails to an identity’s address without a matching thread create a new thread automatically.

Message Object

Each message in a thread includes:
FieldDescription
idUnique message ID
directioninbound or outbound
from_addressSender email
subjectEmail subject
body_textPlain text body
received_atTimestamp