With Contact Center AI Platform (CCAI Platform), you can programmatically retrieve email sessions and messages. This can be useful in the following cases:
Running an external orchestration or automation workflow that needs to read the content of an inbound email to make content-aware routing or handling decisions.
Pulling the sender, subject, body, or attachment details of an email into a downstream system.
Enumerating the individual messages in an email conversation and then getting one of them.
Use the following read-only endpoints to get email sessions and messages:
Get an email session (
GET /apps/api/v1/email/sessions/EMAIL_SUPPORT_ID). Returns email session summary information and a list of message IDs with metadata. To get the full content of a message, use itsemail_thread_idin a subsequent call to the Get an email message endpoint.Get an email message (
GET /apps/api/v1/email/messages/EMAIL_THREAD_ID). Returns the full content of a single message.
These endpoints use basic authentication. The endpoints return email information for the instance that the API credentials came from.
Get an email session
Get email session summary information and a list of message IDs with metadata.
Message IDs for draft messages aren't included. To get the full content of a
message, use its email_thread_id in a subsequent call to the Get an email
message endpoint.
To get an email session, follow these steps:
Send a
GETrequest to the following endpoint. Authenticate using basic authentication.https://YOUR_CCAAS_HOST/apps/api/v1/email/sessions/EMAIL_SUPPORT_IDReplace the following:
YOUR_CCAAS_HOST. Your Contact Center AI Platform (CCAI Platform) host.EMAIL_SUPPORT_ID. The email session identifier.
The following code sample shows a successful response:
{ "email_support_id": 12345, "status": "active", "created_at": "2026-03-25T09:30:00.000+00:00", "updated_at": "2026-03-25T10:15:00.000+00:00", "email_account_id": 42, "total_thread_numbers": 2, "email_threads": [ { "email_thread_id": 67890, "message_id": "<CAE1234@mail.example.com>", "received_at": "2026-03-25T09:30:00.000+00:00", "direction": "inbound" }, { "email_thread_id": 67891, "message_id": "<CAE5678@mail.company.com>", "received_at": "2026-03-25T09:45:00.000+00:00", "direction": "outbound" } ] }Response fields:
email_support_id. The session identifier.status. The status of the session. Values:unopened,active,paused,resolved,closed, andreopened.created_at. The date the session was created.updated_at. The date the session was last updated.email_account_id. The mailbox identifier.total_thread_numbers. The message (thread) count, excluding drafts.email_threads. An array of email messages (threads) from the session. Each array element contains the following:email_thread_id. The message identifier assigned by CCAI Platform.message_id. The message identifier from the RFC 5322 header.received_at. The time that the message was received.direction. The direction of the message. Values:inboundandoutbound.
Use one of the
email_thread_idvalues from theemail_threadsarray forEMAIL_THREAD_IDin a subsequent call to the/apps/api/v1/email/messages/EMAIL_THREAD_IDendpoint. For more information, see Get an email message.
Get an email message
Get the full content of a single email message.
To get an email message, send a GET request to the following endpoint.
Authenticate using basic authentication.
https://YOUR_CCAAS_HOST/apps/api/v1/email/messages/EMAIL_THREAD_ID
Replace the following:
YOUR_CCAAS_HOST. Your Contact Center AI Platform (CCAI Platform) host.EMAIL_THREAD_ID. A message identifier returned by your previous call to the/apps/api/v1/email/sessions/EMAIL_SUPPORT_IDendpoint. For more information, see Get an email session.
The following code sample shows a successful response:
{
"email_thread_id": 67890,
"email_support_id": 12345,
"message_id": "<CAE1234@mail.example.com>",
"direction": "inbound",
"received_at": "2026-03-25T09:30:00.000+00:00",
"from": "consumer@example.com",
"from_name": "Jane Consumer",
"to": ["support@company.com"],
"cc": [],
"bcc": [],
"subject": "Order inquiry #98765",
"body": "I have a question about my recent order...",
"content_type": "text/plain; charset=utf-8",
"attachment_count": 1,
"email_attachments": [
{
"file_name": "receipt.pdf",
"file_type": "application/pdf",
"size_bytes": 45678,
"url": null
}
]
}
Response fields:
email_thread_id. The message identifier assigned by CCAI Platform.email_support_id. The session identifier.message_id. The message identifier from the RFC 5322 header.direction. The direction of the message thread. Values:inboundandoutbound.received_at. The time received.from. The email address of the sender.from_name. The name of the sender.to. The email address in the email's To field.cc. The email address in the email's CC field.bcc. The email address in the email's BCC field.subject. The email subject.body. The email body.content_type. The email content type.attachment_count. The number of email attachments.email_attachments. An array of email attachments. Each array element contains the following:file_name,file_type,size_bytes, andurl. Theurlfield returns null.