AgentMail pods > drafts API
The pods > drafts API from AgentMail — 3 operation(s) for pods > drafts.
The pods > drafts API from AgentMail — 3 operation(s) for pods > drafts.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/agentmail-pods-drafts-api"
curl "https://apis.io/api/v1/apis?limit=25"
Discovery needs no key. Ratings and market analysis are Pro.
openapi: 3.2.0
info:
title: Reference pods > drafts 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: pods > drafts
paths:
/v0/pods/{pod_id}/drafts:
get:
operationId: list
summary: List Drafts
description: '**CLI:**
```bash
agentmail pods:drafts list --pod-id <pod_id>
```'
tags:
- pods > drafts
parameters:
- name: pod_id
in: path
required: true
schema:
$ref: '#/components/schemas/type_pods_PodId'
- 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: 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_drafts_ListDraftsResponse'
'404':
description: Error response with status 404
content:
application/json:
schema:
$ref: '#/components/schemas/type__ErrorResponse'
/v0/pods/{pod_id}/drafts/{draft_id}:
get:
operationId: get
summary: Get Draft
description: '**CLI:**
```bash
agentmail pods:drafts get --pod-id <pod_id> --draft-id <draft_id>
```'
tags:
- pods > drafts
parameters:
- name: pod_id
in: path
required: true
schema:
$ref: '#/components/schemas/type_pods_PodId'
- name: draft_id
in: path
required: true
schema:
$ref: '#/components/schemas/type_drafts_DraftId'
- 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_drafts_Draft'
'404':
description: Error response with status 404
content:
application/json:
schema:
$ref: '#/components/schemas/type__ErrorResponse'
/v0/pods/{pod_id}/drafts/{draft_id}/attachments/{attachment_id}:
get:
operationId: get-attachment
summary: Get Attachment
description: '**CLI:**
```bash
agentmail pods:drafts get-attachment --pod-id <pod_id> --draft-id <draft_id> --attachment-id <attachment_id>
```'
tags:
- pods > drafts
parameters:
- name: pod_id
in: path
required: true
schema:
$ref: '#/components/schemas/type_pods_PodId'
- name: draft_id
in: path
required: true
schema:
$ref: '#/components/schemas/type_drafts_DraftId'
- 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'
components:
schemas:
type__Labels:
type: array
items:
type: string
description: Labels to filter by.
title: Labels
type__Before:
type: string
format: date-time
description: Timestamp before which to filter by.
title: Before
type_drafts_DraftBcc:
type: array
items:
type: string
description: Addresses of BCC recipients. In format `username@domain.com` or `Display Name <username@domain.com>`.
title: DraftBcc
type_drafts_DraftPreview:
type: string
description: Text preview of draft.
title: DraftPreview
type_drafts_DraftTo:
type: array
items:
type: string
description: Addresses of recipients. In format `username@domain.com` or `Display Name <username@domain.com>`.
title: DraftTo
type_attachments_AttachmentId:
type: string
description: ID of attachment.
title: AttachmentId
type_attachments_AttachmentSize:
type: integer
description: Size of attachment in bytes.
title: AttachmentSize
type_drafts_Draft:
type: object
properties:
inbox_id:
$ref: '#/components/schemas/type_inboxes_InboxId'
draft_id:
$ref: '#/components/schemas/type_drafts_DraftId'
client_id:
$ref: '#/components/schemas/type_drafts_DraftClientId'
labels:
$ref: '#/components/schemas/type_drafts_DraftLabels'
reply_to:
$ref: '#/components/schemas/type_drafts_DraftReplyTo'
to:
$ref: '#/components/schemas/type_drafts_DraftTo'
cc:
$ref: '#/components/schemas/type_drafts_DraftCc'
bcc:
$ref: '#/components/schemas/type_drafts_DraftBcc'
subject:
$ref: '#/components/schemas/type_drafts_DraftSubject'
preview:
$ref: '#/components/schemas/type_drafts_DraftPreview'
text:
$ref: '#/components/schemas/type_drafts_DraftText'
html:
$ref: '#/components/schemas/type_drafts_DraftHtml'
attachments:
$ref: '#/components/schemas/type_drafts_DraftAttachments'
in_reply_to:
$ref: '#/components/schemas/type_drafts_DraftInReplyTo'
forward_of:
$ref: '#/components/schemas/type_drafts_DraftForwardOf'
references:
type: array
items:
type: string
description: IDs of previous messages in thread.
send_status:
$ref: '#/components/schemas/type_drafts_DraftSendStatus'
send_at:
$ref: '#/components/schemas/type_drafts_DraftSendAt'
updated_at:
$ref: '#/components/schemas/type_drafts_DraftUpdatedAt'
created_at:
type: string
format: date-time
description: Time at which draft was created.
required:
- inbox_id
- draft_id
- labels
- updated_at
- created_at
title: Draft
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_drafts_ListDraftsResponse:
type: object
properties:
count:
$ref: '#/components/schemas/type__Count'
limit:
$ref: '#/components/schemas/type__Limit'
next_page_token:
$ref: '#/components/schemas/type__PageToken'
drafts:
type: array
items:
$ref: '#/components/schemas/type_drafts_DraftItem'
description: Ordered by `updated_at` descending.
required:
- count
- drafts
title: ListDraftsResponse
type_drafts_DraftId:
type: string
description: ID of draft.
title: DraftId
type_drafts_DraftText:
type: string
description: Plain text body of draft.
title: DraftText
type_drafts_DraftReplyTo:
type: array
items:
type: string
description: Reply-to addresses. In format `username@domain.com` or `Display Name <username@domain.com>`.
title: DraftReplyTo
type__ErrorFix:
type: string
description: The concrete next action that resolves the error.
title: ErrorFix
type__Count:
type: integer
description: Number of items returned.
title: Count
type_drafts_DraftInReplyTo:
type: string
description: ID of message being replied to.
title: DraftInReplyTo
type_attachments_AttachmentContentId:
type: string
description: Content ID of attachment.
title: AttachmentContentId
type__ErrorName:
type: string
description: Name of error.
title: ErrorName
type_drafts_DraftSendStatus:
type: string
enum:
- scheduled
- sending
- failed
description: Schedule send status of draft.
title: DraftSendStatus
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_drafts_DraftUpdatedAt:
type: string
format: date-time
description: Time at which draft was last updated.
title: DraftUpdatedAt
type__ErrorMessage:
type: string
description: Error message.
title: ErrorMessage
type_drafts_DraftItem:
type: object
properties:
inbox_id:
$ref: '#/components/schemas/type_inboxes_InboxId'
draft_id:
$ref: '#/components/schemas/type_drafts_DraftId'
labels:
$ref: '#/components/schemas/type_drafts_DraftLabels'
to:
$ref: '#/components/schemas/type_drafts_DraftTo'
cc:
$ref: '#/components/schemas/type_drafts_DraftCc'
bcc:
$ref: '#/components/schemas/type_drafts_DraftBcc'
subject:
$ref: '#/components/schemas/type_drafts_DraftSubject'
preview:
$ref: '#/components/schemas/type_drafts_DraftPreview'
attachments:
$ref: '#/components/schemas/type_drafts_DraftAttachments'
in_reply_to:
$ref: '#/components/schemas/type_drafts_DraftInReplyTo'
forward_of:
$ref: '#/components/schemas/type_drafts_DraftForwardOf'
send_status:
$ref: '#/components/schemas/type_drafts_DraftSendStatus'
send_at:
$ref: '#/components/schemas/type_drafts_DraftSendAt'
updated_at:
$ref: '#/components/schemas/type_drafts_DraftUpdatedAt'
required:
- inbox_id
- draft_id
- labels
- updated_at
title: DraftItem
type_drafts_DraftClientId:
type: string
description: Client ID of draft.
title: DraftClientId
type__PageToken:
type: string
description: Page token for pagination.
title: PageToken
type_drafts_DraftCc:
type: array
items:
type: string
description: Addresses of CC recipients. In format `username@domain.com` or `Display Name <username@domain.com>`.
title: DraftCc
type_drafts_DraftForwardOf:
type: string
description: ID of message being forwarded.
title: DraftForwardOf
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_drafts_DraftLabels:
type: array
items:
type: string
description: Labels of draft.
title: DraftLabels
type__Limit:
type: integer
description: Limit of number of items returned.
title: Limit
type_drafts_DraftSubject:
type: string
description: Subject of draft.
title: DraftSubject
type_attachments_AttachmentFilename:
type: string
description: Filename of attachment.
title: AttachmentFilename
type__After:
type: string
format: date-time
description: Timestamp after which to filter by.
title: After
type_drafts_DraftAttachments:
type: array
items:
$ref: '#/components/schemas/type_attachments_Attachment'
description: Attachments in draft.
title: DraftAttachments
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_attachments_AttachmentContentDisposition:
type: string
enum:
- inline
- attachment
description: Content disposition of attachment.
title: AttachmentContentDisposition
type_drafts_DraftHtml:
type: string
description: HTML body of draft.
title: DraftHtml
type_inboxes_InboxId:
type: string
description: The ID of the inbox.
title: InboxId
type_attachments_AttachmentContentType:
type: string
description: Content type of attachment.
title: AttachmentContentType
type_drafts_DraftSendAt:
type: string
format: date-time
description: Time at which to schedule send draft.
title: DraftSendAt
type_pods_PodId:
type: string
description: ID of pod.
title: PodId
type__Ascending:
type: boolean
description: Sort in ascending temporal order.
title: Ascending
type__ErrorDocs:
type: string
description: Link to the error reference entry for this code.
title: ErrorDocs
securitySchemes:
Bearer:
type: http
scheme: bearer