openapi: 3.1.0 info: title: API Reference agent inboxes > messages API version: 1.0.0 servers: - url: https://api.agentmail.to description: prod - url: https://x402.api.agentmail.to description: prod-x402 - url: https://mpp.api.agentmail.to description: prod-mpp - url: https://api.agentmail.eu description: eu-prod tags: - name: inboxes > messages paths: /v0/inboxes/{inbox_id}/messages: get: operationId: list summary: List Messages description: 'Lists messages in the inbox, most recent first. Pass `from`, `to`, or `subject` to filter by substring. Filtered requests are served by search, which caps `limit` at 100. For relevance-ranked full-text search across sender, recipients, subject, and message body, use `Search Messages`. **CLI:** ```bash agentmail inboxes:messages list --inbox-id ```' tags: - inboxes > messages parameters: - name: inbox_id in: path required: true schema: $ref: '#/components/schemas/type_inboxes:InboxId' - name: limit in: query required: false schema: $ref: '#/components/schemas/type_:Limit' - name: page_token in: query required: false schema: $ref: '#/components/schemas/type_:PageToken' - name: labels in: query required: false schema: $ref: '#/components/schemas/type_:Labels' - name: before in: query required: false schema: $ref: '#/components/schemas/type_:Before' - name: after in: query required: false schema: $ref: '#/components/schemas/type_:After' - name: ascending in: query required: false schema: $ref: '#/components/schemas/type_:Ascending' - name: include_spam in: query required: false schema: $ref: '#/components/schemas/type_:IncludeSpam' - name: include_blocked in: query required: false schema: $ref: '#/components/schemas/type_:IncludeBlocked' - name: include_unauthenticated in: query required: false schema: $ref: '#/components/schemas/type_:IncludeUnauthenticated' - name: include_trash in: query required: false schema: $ref: '#/components/schemas/type_:IncludeTrash' - name: from in: query description: Filter to messages whose sender contains this value (substring match). Repeatable; all values must match. required: false schema: type: array items: type: string - name: to in: query description: Filter to messages whose recipients (to, cc, or bcc) contain this value (substring match). Repeatable; all values must match. required: false schema: type: array items: type: string - name: subject in: query description: Filter to messages whose subject contains this value (substring match). Repeatable; all values must match. required: false schema: type: array items: type: string - name: Authorization in: header description: Bearer authentication required: true schema: type: string responses: '200': description: Response with status 200 content: application/json: schema: $ref: '#/components/schemas/type_messages:ListMessagesResponse' '404': description: Error response with status 404 content: application/json: schema: $ref: '#/components/schemas/type_:ErrorResponse' /v0/inboxes/{inbox_id}/messages/search: get: operationId: search summary: Search Messages description: 'Full-text search across messages in the inbox, ranked by relevance. The query is matched against the sender, recipients, and subject (substring) and the message body (tokenized full text). Spam, trash, blocked, and unauthenticated messages are always excluded. `limit` cannot exceed 100.' tags: - inboxes > messages parameters: - name: inbox_id in: path required: true schema: $ref: '#/components/schemas/type_inboxes:InboxId' - name: q in: query required: true schema: $ref: '#/components/schemas/type_:Query' - name: limit in: query required: false schema: $ref: '#/components/schemas/type_:Limit' - name: page_token in: query required: false schema: $ref: '#/components/schemas/type_:PageToken' - name: before in: query required: false schema: $ref: '#/components/schemas/type_:Before' - name: after in: query required: false schema: $ref: '#/components/schemas/type_:After' - name: Authorization in: header description: Bearer authentication required: true schema: type: string responses: '200': description: Response with status 200 content: application/json: schema: $ref: '#/components/schemas/type_messages:SearchMessagesResponse' '400': description: Error response with status 400 content: application/json: schema: $ref: '#/components/schemas/type_:ValidationErrorResponse' '404': description: Error response with status 404 content: application/json: schema: $ref: '#/components/schemas/type_:ErrorResponse' /v0/inboxes/{inbox_id}/messages/{message_id}: get: operationId: get summary: Get Message description: '**CLI:** ```bash agentmail inboxes:messages get --inbox-id --message-id ```' tags: - inboxes > messages parameters: - name: inbox_id in: path required: true schema: $ref: '#/components/schemas/type_inboxes:InboxId' - name: message_id in: path required: true schema: $ref: '#/components/schemas/type_messages:MessageId' - name: Authorization in: header description: Bearer authentication required: true schema: type: string responses: '200': description: Response with status 200 content: application/json: schema: $ref: '#/components/schemas/type_messages:Message' '404': description: Error response with status 404 content: application/json: schema: $ref: '#/components/schemas/type_:ErrorResponse' patch: operationId: update summary: Update Message description: '**CLI:** ```bash agentmail inboxes:messages update --inbox-id --message-id --add-label read --remove-label unread ```' tags: - inboxes > messages parameters: - name: inbox_id in: path required: true schema: $ref: '#/components/schemas/type_inboxes:InboxId' - name: message_id in: path required: true schema: $ref: '#/components/schemas/type_messages:MessageId' - name: Authorization in: header description: Bearer authentication required: true schema: type: string responses: '200': description: Response with status 200 content: application/json: schema: $ref: '#/components/schemas/type_messages:UpdateMessageResponse' '400': description: Error response with status 400 content: application/json: schema: $ref: '#/components/schemas/type_:ValidationErrorResponse' '404': description: Error response with status 404 content: application/json: schema: $ref: '#/components/schemas/type_:ErrorResponse' requestBody: content: application/json: schema: $ref: '#/components/schemas/type_messages:UpdateMessageRequest' delete: operationId: delete summary: Delete Message description: 'Permanently deletes a message. **CLI:** ```bash agentmail inboxes:messages delete --inbox-id --message-id ```' tags: - inboxes > messages parameters: - name: inbox_id in: path required: true schema: $ref: '#/components/schemas/type_inboxes:InboxId' - name: message_id in: path required: true schema: $ref: '#/components/schemas/type_messages:MessageId' - name: Authorization in: header description: Bearer authentication required: true schema: type: string responses: '200': description: Successful response '404': description: Error response with status 404 content: application/json: schema: $ref: '#/components/schemas/type_:ErrorResponse' /v0/inboxes/{inbox_id}/messages/batch-get: post: operationId: batch-get summary: Batch Get Messages description: 'Fetch metadata for up to 500 messages in one request. Missing or restricted IDs are silently omitted; compare `count` against `limit` to detect misses. **CLI:** ```bash agentmail inboxes:messages batch-get --inbox-id --message-id --message-id ```' tags: - inboxes > messages parameters: - name: inbox_id in: path required: true schema: $ref: '#/components/schemas/type_inboxes:InboxId' - name: Authorization in: header description: Bearer authentication required: true schema: type: string responses: '200': description: Response with status 200 content: application/json: schema: $ref: '#/components/schemas/type_messages:BatchGetMessagesResponse' '400': description: Error response with status 400 content: application/json: schema: $ref: '#/components/schemas/type_:ValidationErrorResponse' requestBody: content: application/json: schema: $ref: '#/components/schemas/type_messages:BatchGetMessagesRequest' /v0/inboxes/{inbox_id}/messages/batch-update: post: operationId: batch-update summary: Batch Update Messages description: 'Apply one label change to up to 50 messages in a single request. The same add_labels and remove_labels apply to every message id, and at least one of them must be provided. The update is atomic: either all resolved messages are updated or none are. Missing or restricted ids are silently excluded; compare `count` against `limit` to detect exclusions. **CLI:** ```bash agentmail inboxes:messages batch-update --inbox-id --message-id --message-id --add-label read --remove-label unread ```' tags: - inboxes > messages parameters: - name: inbox_id in: path required: true schema: $ref: '#/components/schemas/type_inboxes:InboxId' - name: Authorization in: header description: Bearer authentication required: true schema: type: string responses: '200': description: Response with status 200 content: application/json: schema: $ref: '#/components/schemas/type_messages:BatchUpdateMessagesResponse' '400': description: Error response with status 400 content: application/json: schema: $ref: '#/components/schemas/type_:ValidationErrorResponse' requestBody: content: application/json: schema: $ref: '#/components/schemas/type_messages:BatchUpdateMessagesRequest' /v0/inboxes/{inbox_id}/messages/{message_id}/attachments/{attachment_id}: get: operationId: get-attachment summary: Get Attachment description: '**CLI:** ```bash agentmail inboxes:messages get-attachment --inbox-id --message-id --attachment-id ```' tags: - inboxes > messages parameters: - name: inbox_id in: path required: true schema: $ref: '#/components/schemas/type_inboxes:InboxId' - name: message_id in: path required: true schema: $ref: '#/components/schemas/type_messages:MessageId' - name: attachment_id in: path required: true schema: $ref: '#/components/schemas/type_attachments:AttachmentId' - name: Authorization in: header description: Bearer authentication required: true schema: type: string responses: '200': description: Response with status 200 content: application/json: schema: $ref: '#/components/schemas/type_attachments:AttachmentResponse' '404': description: Error response with status 404 content: application/json: schema: $ref: '#/components/schemas/type_:ErrorResponse' /v0/inboxes/{inbox_id}/messages/{message_id}/raw: get: operationId: get-raw summary: Get Raw Message description: '**CLI:** ```bash agentmail inboxes:messages get-raw --inbox-id --message-id ```' tags: - inboxes > messages parameters: - name: inbox_id in: path required: true schema: $ref: '#/components/schemas/type_inboxes:InboxId' - name: message_id in: path required: true schema: $ref: '#/components/schemas/type_messages:MessageId' - name: Authorization in: header description: Bearer authentication required: true schema: type: string responses: '200': description: Response with status 200 content: application/json: schema: $ref: '#/components/schemas/type_messages:RawMessageResponse' '404': description: Error response with status 404 content: application/json: schema: $ref: '#/components/schemas/type_:ErrorResponse' /v0/inboxes/{inbox_id}/messages/send: post: operationId: send summary: Send Message description: '**CLI:** ```bash agentmail inboxes:messages send --inbox-id --to recipient@example.com --subject "Hello" --text "Body" ```' tags: - inboxes > messages parameters: - name: inbox_id in: path required: true schema: $ref: '#/components/schemas/type_inboxes:InboxId' - name: Authorization in: header description: Bearer authentication required: true schema: type: string responses: '200': description: Response with status 200 content: application/json: schema: $ref: '#/components/schemas/type_messages:SendMessageResponse' '400': description: Error response with status 400 content: application/json: schema: $ref: '#/components/schemas/type_:ValidationErrorResponse' '403': description: Error response with status 403 content: application/json: schema: $ref: '#/components/schemas/type_:ErrorResponse' '404': description: Error response with status 404 content: application/json: schema: $ref: '#/components/schemas/type_:ErrorResponse' '409': description: Error response with status 409 content: application/json: schema: $ref: '#/components/schemas/type_:ErrorResponse' requestBody: content: application/json: schema: $ref: '#/components/schemas/type_messages:SendMessageRequest' /v0/inboxes/{inbox_id}/messages/{message_id}/reply: post: operationId: reply summary: Reply To Message description: '**CLI:** ```bash agentmail inboxes:messages reply --inbox-id --message-id --text "Reply text" ```' tags: - inboxes > messages parameters: - name: inbox_id in: path required: true schema: $ref: '#/components/schemas/type_inboxes:InboxId' - name: message_id in: path required: true schema: $ref: '#/components/schemas/type_messages:MessageId' - name: Authorization in: header description: Bearer authentication required: true schema: type: string responses: '200': description: Response with status 200 content: application/json: schema: $ref: '#/components/schemas/type_messages:SendMessageResponse' '400': description: Error response with status 400 content: application/json: schema: $ref: '#/components/schemas/type_:ValidationErrorResponse' '403': description: Error response with status 403 content: application/json: schema: $ref: '#/components/schemas/type_:ErrorResponse' '404': description: Error response with status 404 content: application/json: schema: $ref: '#/components/schemas/type_:ErrorResponse' '409': description: Error response with status 409 content: application/json: schema: $ref: '#/components/schemas/type_:ErrorResponse' requestBody: content: application/json: schema: $ref: '#/components/schemas/type_messages:ReplyToMessageRequest' /v0/inboxes/{inbox_id}/messages/{message_id}/reply-all: post: operationId: reply-all summary: Reply All Message description: '**CLI:** ```bash agentmail inboxes:messages reply-all --inbox-id --message-id --text "Reply text" ```' tags: - inboxes > messages parameters: - name: inbox_id in: path required: true schema: $ref: '#/components/schemas/type_inboxes:InboxId' - name: message_id in: path required: true schema: $ref: '#/components/schemas/type_messages:MessageId' - name: Authorization in: header description: Bearer authentication required: true schema: type: string responses: '200': description: Response with status 200 content: application/json: schema: $ref: '#/components/schemas/type_messages:SendMessageResponse' '400': description: Error response with status 400 content: application/json: schema: $ref: '#/components/schemas/type_:ValidationErrorResponse' '403': description: Error response with status 403 content: application/json: schema: $ref: '#/components/schemas/type_:ErrorResponse' '404': description: Error response with status 404 content: application/json: schema: $ref: '#/components/schemas/type_:ErrorResponse' '409': description: Error response with status 409 content: application/json: schema: $ref: '#/components/schemas/type_:ErrorResponse' requestBody: content: application/json: schema: $ref: '#/components/schemas/type_messages:ReplyAllMessageRequest' /v0/inboxes/{inbox_id}/messages/{message_id}/forward: post: operationId: forward summary: Forward Message description: '**CLI:** ```bash agentmail inboxes:messages forward --inbox-id --message-id --to recipient@example.com ```' tags: - inboxes > messages parameters: - name: inbox_id in: path required: true schema: $ref: '#/components/schemas/type_inboxes:InboxId' - name: message_id in: path required: true schema: $ref: '#/components/schemas/type_messages:MessageId' - name: Authorization in: header description: Bearer authentication required: true schema: type: string responses: '200': description: Response with status 200 content: application/json: schema: $ref: '#/components/schemas/type_messages:SendMessageResponse' '400': description: Error response with status 400 content: application/json: schema: $ref: '#/components/schemas/type_:ValidationErrorResponse' '403': description: Error response with status 403 content: application/json: schema: $ref: '#/components/schemas/type_:ErrorResponse' '404': description: Error response with status 404 content: application/json: schema: $ref: '#/components/schemas/type_:ErrorResponse' '409': description: Error response with status 409 content: application/json: schema: $ref: '#/components/schemas/type_:ErrorResponse' requestBody: content: application/json: schema: $ref: '#/components/schemas/type_messages:SendMessageRequest' components: schemas: type_:IncludeUnauthenticated: type: boolean description: Include unauthenticated in results. title: IncludeUnauthenticated type_messages:Addresses: oneOf: - type: string - type: array items: type: string title: Addresses type_messages:SendMessageRequest: type: object properties: labels: $ref: '#/components/schemas/type_messages:MessageLabels' reply_to: $ref: '#/components/schemas/type_messages:SendMessageReplyTo' to: $ref: '#/components/schemas/type_messages:SendMessageTo' cc: $ref: '#/components/schemas/type_messages:SendMessageCc' bcc: $ref: '#/components/schemas/type_messages:SendMessageBcc' subject: $ref: '#/components/schemas/type_messages:MessageSubject' text: $ref: '#/components/schemas/type_messages:MessageText' html: $ref: '#/components/schemas/type_messages:MessageHtml' attachments: $ref: '#/components/schemas/type_messages:SendMessageAttachments' headers: $ref: '#/components/schemas/type_messages:SendMessageHeaders' title: SendMessageRequest type_messages:MessageLabels: type: array items: type: string description: Labels of message. title: MessageLabels type_:After: type: string format: date-time description: Timestamp after which to filter by. title: After type_messages:MessageCreatedAt: type: string format: date-time description: Time at which message was created. title: MessageCreatedAt type_attachments:Attachment: type: object properties: attachment_id: $ref: '#/components/schemas/type_attachments:AttachmentId' filename: $ref: '#/components/schemas/type_attachments:AttachmentFilename' size: $ref: '#/components/schemas/type_attachments:AttachmentSize' content_type: $ref: '#/components/schemas/type_attachments:AttachmentContentType' content_disposition: $ref: '#/components/schemas/type_attachments:AttachmentContentDisposition' content_id: $ref: '#/components/schemas/type_attachments:AttachmentContentId' required: - attachment_id - size title: Attachment type_messages:BatchGetMessagesRequest: type: object properties: message_ids: $ref: '#/components/schemas/type_messages:BatchGetMessagesMessageIds' required: - message_ids title: BatchGetMessagesRequest type_attachments:AttachmentResponse: type: object properties: attachment_id: $ref: '#/components/schemas/type_attachments:AttachmentId' filename: $ref: '#/components/schemas/type_attachments:AttachmentFilename' size: $ref: '#/components/schemas/type_attachments:AttachmentSize' content_type: $ref: '#/components/schemas/type_attachments:AttachmentContentType' content_disposition: $ref: '#/components/schemas/type_attachments:AttachmentContentDisposition' content_id: $ref: '#/components/schemas/type_attachments:AttachmentContentId' download_url: type: string description: URL to download the attachment. expires_at: type: string format: date-time description: Time at which the download URL expires. required: - attachment_id - size - download_url - expires_at title: AttachmentResponse type_messages:UpdateMessageRequest: type: object properties: add_labels: $ref: '#/components/schemas/type_messages:UpdateMessageLabels' description: Label or labels to add to message. remove_labels: $ref: '#/components/schemas/type_messages:UpdateMessageLabels' description: Label or labels to remove from message. title: UpdateMessageRequest type_:Before: type: string format: date-time description: Timestamp before which to filter by. title: Before type_messages:BatchUpdateMessagesResponse: type: object properties: limit: $ref: '#/components/schemas/type_:Limit' count: $ref: '#/components/schemas/type_:Count' updates: type: array items: $ref: '#/components/schemas/type_messages:UpdateMessageResponse' description: 'Updated messages with their new labels. Order matches `message_ids` in the request. Excluded ids are omitted, so `count` may be less than `limit`.' required: - limit - count - updates title: BatchUpdateMessagesResponse type_messages:MessageReferences: type: array items: type: string description: IDs of previous messages in thread. title: MessageReferences type_:IncludeSpam: type: boolean description: Include spam in results. title: IncludeSpam type_attachments:AttachmentSize: type: integer description: Size of attachment in bytes. title: AttachmentSize type_:Count: type: integer description: Number of items returned. title: Count type_messages:MessageSubject: type: string description: Subject of message. title: MessageSubject type_messages:BatchUpdateMessagesRequest: type: object properties: message_ids: $ref: '#/components/schemas/type_messages:BatchUpdateMessagesMessageIds' add_labels: $ref: '#/components/schemas/type_messages:UpdateMessageLabels' description: Label or labels to add to every message. remove_labels: $ref: '#/components/schemas/type_messages:UpdateMessageLabels' description: Label or labels to remove from every message. required: - message_ids title: BatchUpdateMessagesRequest type_messages:SendMessageBcc: $ref: '#/components/schemas/type_messages:Addresses' description: BCC recipient address or addresses. title: SendMessageBcc type_attachments:AttachmentContentId: type: string description: Content ID of attachment. title: AttachmentContentId type_messages:MessageHeaders: type: object additionalProperties: type: string description: Headers in message. title: MessageHeaders type_messages:MessagePreview: type: string description: Text preview of message. title: MessagePreview type_messages:MessageItem: type: object properties: inbox_id: $ref: '#/components/schemas/type_inboxes:InboxId' thread_id: $ref: '#/components/schemas/type_threads:ThreadId' message_id: $ref: '#/components/schemas/type_messages:MessageId' labels: $ref: '#/components/schemas/type_messages:MessageLabels' timestamp: $ref: '#/components/schemas/type_messages:MessageTimestamp' from: $ref: '#/components/schemas/type_messages:MessageFrom' to: $ref: '#/components/schemas/type_messages:MessageTo' cc: $ref: '#/components/schemas/type_messages:MessageCc' bcc: $ref: '#/components/schemas/type_messages:MessageBcc' subject: $ref: '#/components/schemas/type_messages:MessageSubject' preview: $ref: '#/components/schemas/type_messages:MessagePreview' attachments: $ref: '#/components/schemas/type_messages:MessageAttachments' in_reply_to: $ref: '#/components/schemas/type_messages:MessageInReplyTo' references: $ref: '#/components/schemas/type_messages:MessageReferences' headers: $ref: '#/components/schemas/type_messages:MessageHeaders' size: $ref: '#/components/schemas/type_messages:MessageSize' updated_at: $ref: '#/components/schemas/type_messages:MessageUpdatedAt' created_at: $ref: '#/components/schemas/type_messages:MessageCreatedAt' required: - inbox_id - thread_id - message_id - labels - timestamp - from - to - size - updated_at - created_at title: MessageItem type_messages:SendMessageTo: $ref: '#/components/schemas/type_messages:Addresses' description: Recipient address or addresses. title: SendMessageTo type_attachments:SendAttachment: type: object properties: filename: $ref: '#/components/schemas/type_attachments:AttachmentFilename' content_type: $ref: '#/components/schemas/type_attachments:AttachmentContentType' content_disposition: $ref: '#/components/schemas/type_attachments:AttachmentContentDisposition' content_id: $ref: '#/components/schemas/type_attachments:AttachmentContentId' content: type: string description: Base64 encoded content of attachment. url: type: string description: URL to the attachment. title: SendAttachment type_messages:ReplyAll: type: boolean description: Reply to all recipients of the original message. title: ReplyAll type_messages:MessageUpdatedAt: type: string format: date-time description: Time at which message was last updated. title: MessageUpdatedAt type_attachments:AttachmentFilename: type: string description: Filename of attachment. title: AttachmentFilename type_attachments:AttachmentContentDisposition: type: string enum: - inline - attachment description: Content disposition of attachment. title: AttachmentContentDisposition type_attachments:AttachmentId: type: string description: ID of attachment. title: AttachmentId type_:ErrorCode: type: string description: Stable, machine-readable error code in snake_case (for example, not_found or missing_permission). Branch on this rather than the message text. title: ErrorCode type_threads:ThreadId: type: string description: ID of thread. title: ThreadId type_messages:MessageHtml: type: string description: HTML body of message. title: MessageHtml type_:IncludeTrash: type: boolean description: Include trash in results. title: IncludeTrash type_inboxes:InboxId: type: string description: The ID of the inbox. title: InboxId type_messages:ListMessagesResponse: type: object properties: count: $ref: '#/components/schemas/type_:Count' limit: $ref: '#/components/schemas/type_:Limit' next_page_token: $ref: '#/components/schemas/type_:PageToken' messages: type: array items: $ref: '#/components/schemas/type_messages:MessageItem' description: Ordered by `timestamp` descending. required: - count - messages title: ListMessagesResponse type_messages:MessageTo: type: array items: type: string description: Addresses of recipients. In format `username@domain.com` or `Display Name `. title: MessageTo type_messages:MessageInReplyTo: type: string description: ID of message being replied to. title: MessageInReplyTo type_messages:ReplyAllMessageRequest: type: object properties: labels: $ref: '#/components/schemas/type_messages:MessageLabels' reply_to: $ref: '#/components/schemas/type_messages:SendMessageReplyTo' text: $ref: '#/components/schemas/type_messages:MessageText' html: $ref: '#/components/schemas/type_messages:MessageHtml' attachments: $ref: '#/components/schemas/type_messages:SendMessageAttachments' headers: $ref: '#/components/schemas/type_messages:SendMessageHeaders' title: ReplyAllMessageRequest type_messages:MessageText: type: string description: Plain text body of message. title: MessageText type_:ValidationErrorResponse: type: object properties: name: $ref: '#/components/schemas/type_:ErrorName' code: $ref: '#/components/schemas/type_:ErrorCode' message: $ref: '#/components/schemas/type_:ErrorMessage' errors: description: Validation errors. Each entry has a path and a message identifying the invalid field. fix: $ref: '#/components/schemas/type_:ErrorFix' docs: $ref: '#/components/schemas/type_:ErrorDocs' required: - name - errors title: ValidationErrorResponse type_:Query: type: string description: 'Full-text search query. Matched against the sender, recipients, and subject (substring) and the message body (tokenized full text).' title: Query type_:ErrorFix: type: string description: The concrete next action that resolves the error. title: ErrorFix type_:ErrorMessage: type: string description: Error message. title: ErrorMessage type_messages:MessageAttachments: type: array items: $ref: '#/components/schemas/type_attachments:Attachment' description: Attachments in message. title: MessageAttachments type_messages:SearchMessagesResponse: type: object properties: count: $ref: '#/components/schemas/type_:Count' limit: $ref: '#/components/schemas/type_:Limit' next_page_token: $ref: '#/components/schemas/type_:PageToken' messages: type: array items: $ref: '#/components/schemas/type_messages:SearchMessageItem' description: Ordered by relevance, best match first. required: - count - messages title: SearchMessagesResponse type_messages:SearchMessageHighlights: type: object properties: from: type: array items: type: string description: Matched fragments from the sender address. recipients: type: array items: type: string description: Matched fragments from the recipient addresses (to, cc, or bcc). subject: type: array items: type: string description: Matched fragments from the subject. text: type: array items: type: string description: Matched fragments from the message body. description: 'Matched fragments per field on a message search result, with matched terms wrapped in `**`. A field key is present only when the query matched that field, so the present keys also tell you which fields produced the hit.' title: SearchMessageHighlights type_messages:UpdateMessageLabels: oneOf: - type: string - type: array items: type: string description: Label or list of labels. title: UpdateMessageLabels type_:Limit: type: integer description: Limit of number of items returned. title: Limit type_messages:MessageBcc: type: array items: type: string description: Addresses of BCC recipients. In format `username@domain.com` or `Display Name `. title: MessageBcc type_messages:UpdateMessageResponse: type: object properties: message_id: $ref: '#/components/schemas/type_messages:MessageId' labels: $ref: '#/components/schemas/type_messages:MessageLabels' required: - message_id - labels title: UpdateMessageResponse type_messages:BatchUpdateMessagesMessageIds: type: array items: $ref: '#/components/schemas/type_messages:MessageId' description: 'IDs of messages to update. Maximum 50 ids per request. Duplicates are rejected with a validation error. IDs not found in the inbox (including cross-inbox or permission-restricted) are silently excluded from the update; callers detect exclusions by comparing `count` against `limit`.' title: BatchUpdateMessagesMessageIds type_messages:SendMessageResponse: type: object properties: message_id: $ref: '#/components/schemas/type_messages:MessageId' thread_id: $ref: '#/components/schemas/type_threads:ThreadId' required: - message_id - thread_id title: SendMessageResponse type_:PageToken: type: string description: Page token for pagination. title: PageToken type_messages:SendMessageCc: $ref: '#/components/schemas/type_messages:Addresses' description: CC recipient address or addresses. title: SendMessageCc type_:ErrorName: type: string description: Name of error. title: ErrorName type_messages:MessageTimestamp: type: string format: date-time description: Time at which message was sent or drafted. title: MessageTimestamp type_messages:BatchGetMessagesResponse: type: object properties: limit: $ref: '#/components/schemas/type_:Limit' count: $ref: '#/components/schemas/type_:Count' messages: type: array items: $ref: '#/components/schemas/type_messages:Message' description: 'Found messages. Order matches `message_ids` in the request. Body fields (`text`, `html`, `extracted_text`, `extracted_html`) are never populated; use the single-message endpoint to retrieve bodies.' required: - limit - count - messages title: BatchGetMessagesResponse type_messages:BatchGetMessagesMessageIds: type: array items: $ref: '#/components/schemas/type_messages:MessageId' description: 'IDs of messages to fetch. Maximum 500 ids per request. Duplicates are rejected with a validation error. IDs not found in the inbox (including cross-inbox or permission-restricted) are silently omitted from the response; callers detect misses by comparing `count` against `limit`.' title: BatchGetMessagesMessageIds type_messages:SendMessageAttachments: type: array items: $ref: '#/components/schemas/type_attachments:SendAttachment' description: Attachments to include in message. title: SendMessageAttachments type_:ErrorDocs: type: string description: Link to the error reference entry for this code. title: ErrorDocs type_messages:MessageSize: type: integer description: Size of message in bytes. title: MessageSize type_attachments:AttachmentContentType: type: string description: Content type of attachment. title: AttachmentContentType type_:ErrorResponse: type: object properties: name: $ref: '#/components/schemas/type_:ErrorName' code: $ref: '#/components/schemas/type_:ErrorCode' message: $ref: '#/components/schemas/type_:ErrorMessage' fix: $ref: '#/components/schemas/type_:ErrorFix' docs: $ref: '#/components/schemas/type_:ErrorDocs' required: - name - message title: ErrorResponse type_messages:MessageCc: type: array items: type: string description: Addresses of CC recipients. In format `username@domain.com` or `Display Name `. title: MessageCc type_messages:MessageId: type: string description: ID of message. title: MessageId type_messages:RawMessageResponse: type: object properties: message_id: $ref: '#/components/schemas/type_messages:MessageId' description: ID of the message. size: $ref: '#/components/schemas/type_messages:MessageSize' description: Size of the raw message in bytes. download_url: type: string description: S3 presigned URL to download the raw message. Expires at expires_at. expires_at: type: string format: date-time description: Time at which the download URL expires. required: - message_id - size - download_url - expires_at description: S3 presigned URL to download the raw .eml file. title: RawMessageResponse type_messages:Message: type: object properties: inbox_id: $ref: '#/components/schemas/type_inboxes:InboxId' thread_id: $ref: '#/components/schemas/type_threads:ThreadId' message_id: $ref: '#/components/schemas/type_messages:MessageId' labels: $ref: '#/components/schemas/type_messages:MessageLabels' timestamp: $ref: '#/components/schemas/type_messages:MessageTimestamp' from: $ref: '#/components/schemas/type_messages:MessageFrom' reply_to: type: array items: type: string description: Reply-to addresses. In format `username@domain.com` or `Display Name `. to: $ref: '#/components/schemas/type_messages:MessageTo' cc: $ref: '#/components/schemas/type_messages:MessageCc' bcc: $ref: '#/components/schemas/type_messages:MessageBcc' subject: $ref: '#/components/schemas/type_messages:MessageSubject' preview: $ref: '#/components/schemas/type_messages:MessagePreview' text: $ref: '#/components/schemas/type_messages:MessageText' html: $ref: '#/components/schemas/type_messages:MessageHtml' extracted_text: type: string description: Extracted new text content. extracted_html: type: string description: Extracted new HTML content. attachments: $ref: '#/components/schemas/type_messages:MessageAttachments' in_reply_to: $ref: '#/components/schemas/type_messages:MessageInReplyTo' references: $ref: '#/components/schemas/type_messages:MessageReferences' headers: $ref: '#/components/schemas/type_messages:MessageHeaders' size: $ref: '#/components/schemas/type_messages:MessageSize' updated_at: $ref: '#/components/schemas/type_messages:MessageUpdatedAt' created_at: $ref: '#/components/schemas/type_messages:MessageCreatedAt' required: - inbox_id - thread_id - message_id - labels - timestamp - from - to - size - updated_at - created_at title: Message type_messages:MessageFrom: type: string description: Address of sender. In format `username@domain.com` or `Display Name `. title: MessageFrom type_:IncludeBlocked: type: boolean description: Include blocked in results. title: IncludeBlocked type_messages:ReplyToMessageRequest: type: object properties: labels: $ref: '#/components/schemas/type_messages:MessageLabels' reply_to: $ref: '#/components/schemas/type_messages:SendMessageReplyTo' to: $ref: '#/components/schemas/type_messages:SendMessageTo' cc: $ref: '#/components/schemas/type_messages:SendMessageCc' bcc: $ref: '#/components/schemas/type_messages:SendMessageBcc' reply_all: $ref: '#/components/schemas/type_messages:ReplyAll' text: $ref: '#/components/schemas/type_messages:MessageText' html: $ref: '#/components/schemas/type_messages:MessageHtml' attachments: $ref: '#/components/schemas/type_messages:SendMessageAttachments' headers: $ref: '#/components/schemas/type_messages:SendMessageHeaders' title: ReplyToMessageRequest type_messages:SendMessageReplyTo: $ref: '#/components/schemas/type_messages:Addresses' description: Reply-to address or addresses. title: SendMessageReplyTo type_:Ascending: type: boolean description: Sort in ascending temporal order. title: Ascending type_messages:SearchMessageItem: type: object properties: inbox_id: $ref: '#/components/schemas/type_inboxes:InboxId' thread_id: $ref: '#/components/schemas/type_threads:ThreadId' message_id: $ref: '#/components/schemas/type_messages:MessageId' labels: $ref: '#/components/schemas/type_messages:MessageLabels' timestamp: $ref: '#/components/schemas/type_messages:MessageTimestamp' from: $ref: '#/components/schemas/type_messages:MessageFrom' to: $ref: '#/components/schemas/type_messages:MessageTo' cc: $ref: '#/components/schemas/type_messages:MessageCc' bcc: $ref: '#/components/schemas/type_messages:MessageBcc' subject: $ref: '#/components/schemas/type_messages:MessageSubject' preview: $ref: '#/components/schemas/type_messages:MessagePreview' attachments: $ref: '#/components/schemas/type_messages:MessageAttachments' in_reply_to: $ref: '#/components/schemas/type_messages:MessageInReplyTo' references: $ref: '#/components/schemas/type_messages:MessageReferences' headers: $ref: '#/components/schemas/type_messages:MessageHeaders' size: $ref: '#/components/schemas/type_messages:MessageSize' updated_at: $ref: '#/components/schemas/type_messages:MessageUpdatedAt' created_at: $ref: '#/components/schemas/type_messages:MessageCreatedAt' highlights: $ref: '#/components/schemas/type_messages:SearchMessageHighlights' description: Matched fragments per field. Present only when the query matched an indexed field. required: - inbox_id - thread_id - message_id - labels - timestamp - from - to - size - updated_at - created_at title: SearchMessageItem type_messages:SendMessageHeaders: type: object additionalProperties: type: string description: Headers to include in message. title: SendMessageHeaders type_:Labels: type: array items: type: string description: Labels to filter by. title: Labels securitySchemes: Bearer: type: http scheme: bearer