Deployments.ai Docs
Agent Email

Search inbox messages

POST /v1/agent-email/inboxes/{inboxId}/messages/search · SDK searchAgentEmailMessages · CLI deployments inbox search

POST
/v1/agent-email/inboxes/{inboxId}/messages/search

Requires agent-email:read. A suspended organization can still call it.

Authorization

platformBearer
headerAuthorizationBearer <token>

Platform bearer credential accepted as an opaque API key or JWT.

Path Parameters

inboxId*string
Match^[0-7][0-9A-HJKMNP-TV-Z]{25}$

Header Parameters

x-deployments-environment*string
Match^[0-7][0-9A-HJKMNP-TV-Z]{25}$

Request Body

application/json
  1. body
cursor?string
Length1 <= length <= 4096
direction?string
Value in"inbound""outbound"
from?string
Match^\S[\s\S]*\S$|^\S$|^$
Length3 <= length <= 320
hasAttachments?boolean
limit?integer
Range1 <= value <= 100
participants?array<>
Itemsitems <= 50
query?string
status?string
Value in"accepted""bounced""complained""delivered""failed""queued""received""scheduled""sending"
to?string
Match^\S[\s\S]*\S$|^\S$|^$
Length3 <= length <= 320

Response Body

AgentEmailMessagePageResponse

application/json
  1. response
items*array<>
nextCursor?|null
curl -X POST "https://example.com/v1/agent-email/inboxes/string/messages/search" \  -H "x-deployments-environment: string" \  -H "Content-Type: application/json" \  -d '{}'
{  "items": [    {      "acceptedAt": "2019-08-24T14:15:22Z",      "attachments": [        {          "byteSize": 0,          "contentId": "string",          "contentType": "string",          "disposition": "attachment",          "fileName": "string",          "id": "string",          "messageId": "string",          "sha256": "string"        }      ],      "bccAddresses": [        "string"      ],      "ccAddresses": [        "string"      ],      "clientId": "string",      "createdAt": "2019-08-24T14:15:22Z",      "deliveredAt": "2019-08-24T14:15:22Z",      "direction": "inbound",      "draftId": "string",      "failureCode": "string",      "failureReason": "string",      "fromAddress": "string",      "htmlBody": "string",      "id": "string",      "inboxId": "string",      "inReplyTo": "string",      "internetMessageId": "string",      "lastReprocessedAt": "2019-08-24T14:15:22Z",      "organizationId": "string",      "providerMessageId": "string",      "rawPurgedAt": "2019-08-24T14:15:22Z",      "rawRetentionExpiresAt": "2019-08-24T14:15:22Z",      "receivedAt": "2019-08-24T14:15:22Z",      "references": [        "string"      ],      "replyToAddresses": [        "string"      ],      "reprocessCount": 0,      "scheduledAt": "2019-08-24T14:15:22Z",      "status": "accepted",      "subject": "string",      "textBody": "string",      "threadId": "string",      "threadKey": "string",      "toAddresses": [        "string"      ],      "updatedAt": "2019-08-24T14:15:22Z"    }  ],  "nextCursor": "string"}