{
  "openapi": "3.1.0",
  "info": {
    "title": "send.io API",
    "version": "1.0.0",
    "summary": "Send and receive email, manage domains, contacts, broadcasts, automations and agent inboxes.",
    "description": "Send and receive email, manage domains, contacts, broadcasts, automations and agent inboxes.\n\nAuthentication: Authorization: Bearer mx_...\n\nTimestamps: All timestamps are RFC 3339 strings in UTC, for example 2026-11-10T14:40:35.840078+00:00. The number of fraction digits and the UTC suffix (+00:00 or Z) differ between endpoints, so parse them as RFC 3339 rather than with a fixed pattern.",
    "contact": {
      "name": "send.io",
      "url": "https://app.send.io/docs/api"
    },
    "license": {
      "name": "Proprietary",
      "identifier": "LicenseRef-send.io"
    }
  },
  "servers": [
    {
      "url": "https://api.send.io"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "Emails",
      "description": "Send transactional email, one at a time or in batches, and look up what you sent."
    },
    {
      "name": "Receiving emails",
      "description": "Email that arrives at your domains when receiving is turned on (the domain's MX record points at send.io). Webhooks send `email.received` as it arrives. A message may be up to 50 MB, attachments included; the MX refuses a larger one at once with `552 5.3.4`, so the sender gets a bounce instead of the mail going missing."
    },
    {
      "name": "Inbound routes",
      "description": "Rules for mail arriving at your receiving domains and inboxes: forward it to a URL with the full parsed message, forward it to another address, store it, or stop. Routes run by priority (lower first), then creation time."
    },
    {
      "name": "Domains",
      "description": "Add and verify the domains you send from, and manage their tracking settings."
    },
    {
      "name": "API keys",
      "description": "Create and manage the keys that authenticate API requests."
    },
    {
      "name": "OAuth grants",
      "description": "The apps your team approved to act on its behalf through Sign in with send.io, such as an AI app using the MCP server or the CLI. The dashboard lists them as Connected apps on the API keys page."
    },
    {
      "name": "Subaccounts",
      "description": "Child accounts for platforms and resellers. A subaccount is a separate account with its own domains, API keys, suppressions, templates, webhooks, emails and metrics; none of it is visible to its parent or to other subaccounts. Its sending counts toward your plan's quota, and it can have limits of its own. Manage subaccounts with a full-access key of the parent account. To call any endpoint as one of your subaccounts, add the header `X-Sendio-Subaccount: <subaccount_id>` to a request made with that key."
    },
    {
      "name": "Webhooks",
      "description": "Get an HTTP POST to your endpoint when emails, domains, contacts and other resources change."
    },
    {
      "name": "Senders",
      "description": "Sender identities: a From address with its display name, reply-to and postal address. A sender on a verified domain is verified at once; any other address is confirmed by a link emailed to it. Use one on a send with `sender_id`."
    },
    {
      "name": "Streams",
      "description": "Message streams separate kinds of mail, as Postmark's do: every team has `outbound` (transactional), `broadcast` and `inbound`, and you can add your own transactional and broadcast streams. Sends name one with `stream`; emails, metrics, suppressions and webhooks can be filtered by it."
    },
    {
      "name": "Suppressions",
      "description": "Addresses you never send to. Hard bounces and complaints are added for you, soft bounces for 24 hours; you can also add and remove addresses yourself, and keep an allow-list of addresses and domains that are never suppressed."
    },
    {
      "name": "Templates",
      "description": "Reusable email designs with variables. Edits create a new draft version; publish it to use it in a transactional email or a broadcast. A template is the content: its From, subject, preview text and Reply-To are optional defaults, so it can be published without them. Templates use the `simple` engine (`{{NAME}}`) by default, or `handlebars` for conditions, loops and helpers."
    },
    {
      "name": "Contacts",
      "description": "Contacts are the people you send broadcasts to. A team has one contact per email address, and a contact can be in many segments and subscribed to topics."
    },
    {
      "name": "Audiences",
      "description": "The older Resend audience API, kept for existing code and SDKs. On send.io an audience is a segment: the same records, ids and data. Use Segments and Contacts for new code."
    },
    {
      "name": "Segments",
      "description": "A segment is a group of contacts that broadcasts are sent to. A manual segment is a list you keep: add and remove contacts with the contact segment endpoints. A rule-based segment (send.io extension) keeps itself up to date: its members are the contacts that match its rule, such as \"plan is pro and last logged in more than 30 days ago\". When a contact changes, an event arrives or a time in the rule passes, the contact joins or leaves within a few seconds, not inside the request that made the change."
    },
    {
      "name": "Topics",
      "description": "Topics are subscription preferences, such as \"Product updates\". An `opt_in` topic reaches every contact who has not opted out; an `opt_out` topic reaches only contacts who opted in."
    },
    {
      "name": "Contact properties",
      "description": "Contact properties define the custom fields a contact can have, such as `company`. Define a property before you set it on contacts, and use it in broadcasts as {{{contact.company}}}. A property has one of four types: `string`, `number`, `boolean` or `date`."
    },
    {
      "name": "Broadcasts",
      "description": "A broadcast sends one email to every subscribed contact in a segment, personalized per contact, with an unsubscribe link and one-click List-Unsubscribe headers. Statuses: `draft`, `scheduled`, `queued` (sending), `sent` and `canceled`."
    },
    {
      "name": "Unsubscribe page",
      "description": "The branding of the page contacts see when they open a broadcast's unsubscribe link, where they can unsubscribe or change topic preferences."
    },
    {
      "name": "Transactional emails",
      "description": "A transactional email is a named, saved send of a published template: a sign-in code, a password reset, a receipt. It stores the From, subject, preview text, Reply-To and tracking; its content is always the template's published version. Your application sends it with `POST /emails` and `transactional_id`, passing only the recipient and the variables. Not to be confused with the `transactional` message stream or workflow templates of kind `transactional`."
    },
    {
      "name": "Automations",
      "description": "Automations that start on an event or contact change and then send emails, wait, branch and update contacts. Compatible with Resend's automations API (steps and connections), plus send.io extensions: drafts, versions, pause and resume, validation, test runs and metrics."
    },
    {
      "name": "Events",
      "description": "Custom events are things that happened in your product (user.created, order.paid) for one contact. Sending an event starts automations that trigger on it and wakes runs waiting for it. send.io also keeps a summary per contact and event name: when it first happened, when it last happened and how many times. Rule-based segments read this summary (`events.<name>.last_at`, `.first_at`, `.count`). Compatible with Resend's events API."
    },
    {
      "name": "Mailboxes",
      "description": "A mailbox is an address on one of your verified domains. Every mailbox works over the API and also has IMAP and SMTP login, so you can use it from any mail client."
    },
    {
      "name": "Inboxes",
      "description": "Agent inboxes are email addresses your AI agents create and use through the API. Mail sent to an inbox is filed into threads; the agent reads, sends, replies and forwards. An inbox can live on your own verified domain or on send.io's shared agent domain, which needs no DNS setup."
    },
    {
      "name": "Inbox drafts",
      "description": "Drafts let an agent write an email that a person approves before it goes out, or that sends itself at a set time."
    },
    {
      "name": "Inbox lists",
      "description": "Allow and block lists control who an inbox may send to and receive from. Blocked entries always lose; once any allow entry exists, only allowed addresses pass."
    },
    {
      "name": "Inbox threads",
      "description": "The unified inbox: every received conversation across all your mailboxes and agent inboxes, grouped into threads."
    },
    {
      "name": "Pods",
      "description": "Pods are isolated groups of inboxes, for example one per end customer of your platform. A pod key can only see its own inboxes."
    },
    {
      "name": "Agent domain and AgentID",
      "description": "The shared agent domain, and AgentID apps: OAuth/OpenID clients that let your app sign users in with their agent inbox."
    },
    {
      "name": "API logs",
      "description": "Every request your team makes to the send.io API: method, path, status, key, IP and client, newest first. Kept for 30 days."
    },
    {
      "name": "Assets",
      "description": "Images you host on send.io for use in templates and emails."
    },
    {
      "name": "MCP",
      "description": "A Model Context Protocol server, so AI assistants and agents can use send.io as tools with your API key."
    },
    {
      "name": "Billing",
      "description": "One prepaid credit balance pays for every service. Sending an email costs credits per recipient (1 by default); other services are listed with their price and say when they are not charged yet. A subaccount draws on its parent's balance. When the balance runs out, sends answer 402 `insufficient_credits`. See [Credits and pricing](/docs/credits)."
    },
    {
      "name": "Sending reputation",
      "description": "Your team's hard bounce and complaint rates against the limits of its volume tier, over the last 24 hours and 7 days (the worse decides). At 80% of a limit the team is in `warning`; at the limit it is `suspended` and sends answer 403 `sending_suspended` until our team reviews it. See [Sending reputation](/docs/sending-reputation)."
    },
    {
      "name": "Inboxes (Agent inboxes)",
      "description": "An inbox is an email address your agent sends and receives from. The inbox address is its `inbox_id` in every path."
    },
    {
      "name": "Messages",
      "description": "Messages sent and received by an inbox. Send a new message, reply, forward, label and read attachments."
    },
    {
      "name": "Threads",
      "description": "A thread groups a message and its replies. Read threads per inbox, or across every inbox in the organization with /threads."
    },
    {
      "name": "Drafts",
      "description": "Drafts let an agent write a message that a human reviews before it goes out, or that sends itself at `send_at`."
    },
    {
      "name": "Inbox lists (Agent inboxes)",
      "description": "Allow and block lists for one inbox. Each list has a direction (`send`, `receive` or `reply`) and a type (`allow` or `block`). Entries are email addresses or domains."
    },
    {
      "name": "Inbox webhooks",
      "description": "Webhooks limited to one inbox. send.io posts events such as `message.received` to your URL."
    },
    {
      "name": "Inbox API keys",
      "description": "API keys limited to one inbox. Give an agent a key that can only reach its own inbox, optionally with a permission list."
    },
    {
      "name": "Inbox metrics",
      "description": "Sending and receiving numbers for one inbox. The window is the last 30 days unless you set `start` and `end`."
    },
    {
      "name": "Pods (Agent inboxes)",
      "description": "A pod groups inboxes, so one customer or one project has its own inboxes, lists, webhooks and API keys. Inboxes made outside a pod belong to the default pod."
    },
    {
      "name": "Pod Inboxes",
      "description": "Inboxes inside one pod. Each inbox is an email address your agent can send from and receive at."
    },
    {
      "name": "Pod Threads",
      "description": "Threads across all inboxes in one pod. Spam and trash are hidden unless you ask for them."
    },
    {
      "name": "Pod Drafts",
      "description": "Unsent drafts across all inboxes in one pod. Create, edit and send drafts through the inbox routes."
    },
    {
      "name": "Pod Lists",
      "description": "Allow and block lists that apply to every inbox in the pod. A list is chosen by direction (send, receive, reply) and type (allow, block)."
    },
    {
      "name": "Pod Webhooks",
      "description": "Webhooks limited to one pod: they get events only for that pod's inboxes."
    },
    {
      "name": "Pod Domains",
      "description": "The domain routes under a pod. They work the same as the top-level Domains routes."
    },
    {
      "name": "Pod Metrics",
      "description": "Events and counts for the inboxes in one pod."
    },
    {
      "name": "Pod API Keys",
      "description": "API keys limited to one pod. A pod key can only reach that pod's inboxes and resources."
    },
    {
      "name": "Domains (Agent inboxes)",
      "description": "Send and receive from your own domain. Add it, set the DNS records it returns, then verify. Inboxes on the shared agents.send.io domain need no setup."
    },
    {
      "name": "Webhooks (Agent inboxes)",
      "description": "Get events like message.received pushed to your URL. A webhook is team-wide unless you limit it to inboxes or pods. Payloads look like {type: \"event\", event_type, event_id, ...}."
    },
    {
      "name": "Lists",
      "description": "Team-wide allow and block lists that apply to every inbox. Pick a list by direction (send, receive or reply) and type (allow or block). Entries are email addresses or whole domains."
    },
    {
      "name": "Metrics",
      "description": "Events and counts for all your agent inboxes. A scoped API key sees only its own inbox or pod. The default window is the last 30 days."
    },
    {
      "name": "API Keys",
      "description": "Create keys for your agents. A key can be full access, limited to an inbox or pod, or limited to a list of permissions."
    },
    {
      "name": "Organization",
      "description": "Your organization (team) and the key you are calling with."
    },
    {
      "name": "Agent Sign-up",
      "description": "An agent can create its own send.io account, inbox and API key with one call, no human sign-up needed. A 6-digit code emailed to the agent's human unlocks it. This is a send.io addition."
    },
    {
      "name": "Agent Registration (auth.md)",
      "description": "The auth.md protocol: an agent opens a send.io account for its human without the sign-up form, and the human approves it with a code, or a trusted agent provider vouches for the human. Discovery is at /.well-known/oauth-protected-resource and /.well-known/oauth-authorization-server on the API host; the full recipe agents read is https://app.send.io/auth.md. Trusted providers push revocations (RFC 8935 Security Event Tokens) to /v0/agents/identity/events. This is a send.io addition. No API key is needed for these calls."
    },
    {
      "name": "AgentID (OpenID Connect)",
      "description": "Let agents sign in to your app with their send.io inbox, like \"Sign in with Google\" for agents. send.io is a standard OpenID Connect provider (authorization code flow, RS256 tokens). This is a send.io addition."
    }
  ],
  "paths": {
    "/emails": {
      "post": {
        "operationId": "sendEmail",
        "summary": "Send email",
        "description": "Queue an email for delivery. The `from` address must be on a verified domain of your team. Returns the id of the new email. To send a saved transactional email, pass its `transactional_id`, the recipient and its `variables`: it sets the sender, subject and content.\n\n- Send an `Idempotency-Key` header (1 to 256 characters) to make retries safe: the same key and body within 24 hours returns the first response. A key still in use, or reused with a different body, answers 409.\n\n- send.io extension: `X-Sendio-Redact: KEY1,KEY2` stores those template variables as null in the saved copy of the email.\n\n- Test addresses `delivered@send.io`, `bounced@send.io`, `complained@send.io` and `suppressed@send.io` (and the `@resend.dev` versions, with optional `+label`) simulate outcomes. `onboarding@send.io` can send only to test recipients; an email from it with any other recipient is refused (403).\n\n- `react` is not rendered by the API. Render it to HTML in your code (the Resend SDKs do this for you).\n\n- send.io extension: `topic_id` for topic opt-out gating.\n\n- send.io extension: `metadata`. Unlike `tags` it takes any characters. A value that is not a string, or a request over the limits, answers 422 `validation_error`.\n\n- send.io extension: `track_opens` and `track_clicks` override the domain's open and click tracking for one email. Broadcasts keep their own `tracking` setting. Tracking is per email: with several recipients an open or click lists them all (see List email events). For per-recipient tracking send one email per recipient, for example with Send batch emails.\n\n- send.io extension: `batch_id`. See Retrieve batch and Cancel batch.\n\n- send.io extension: `template_engine` and inline `variables`, for example `{\"template_engine\": \"handlebars\", \"subject\": \"{{count}} item{{#if (gt count 1)}}s{{/if}}\", \"html\": \"{{#each items}}<li>{{name}}</li>{{/each}}\", \"variables\": {\"count\": 2, \"items\": [{\"name\": \"Tea\"}, {\"name\": \"Cake\"}]}}`. See Create template for the template language.\n\n- send.io extension: `stream` (message streams, like Postmark's `MessageStream`) and `sender_id` (sender identities). Sends that name a stream other than `outbound`, or a `sender_id`, take the database path rather than the low-latency hot path.\n\n- send.io extension: `transactional_id`. Example: `{\"transactional_id\": \"tx_2hX9Yq1bVv0kq3W4m8sZJt1aB7c\", \"to\": \"ann@example.com\", \"variables\": {\"CODE\": \"123456\"}}`. The email uses the template's published version at send time, so a republish reaches every send within 10 seconds, as does an edit to the transactional email. `cc`, `bcc`, `headers`, `tags`, `metadata`, `attachments`, `scheduled_at`, `track_opens`, `track_clicks`, `stream` and `topic_id` work as on any send. The email is stored with `transactional_id`, `template_id` and its version, so it also counts in the template's stats.\n\n- Errors with `transactional_id`: 404 `not_found` for an unknown or deleted transactional email; 422 `validation_error` when its template was deleted or has no published version (the message names the template), when the id is not a `tx_...` id, when a field the transactional email sets is also sent, or when a variable the template needs has no value. In a `permissive` batch each of these is reported for its item.\n\n- One-time codes: send them with this endpoint (not the batch one) and a tag such as `priority=otp`, keep tracking off (the default for a transactional email, or `track_opens: false, track_clicks: false`; with both off the send stays on the low-latency path even when the domain has a tracking subdomain), and send `X-Sendio-Redact: CODE` so the code is not stored with the email.\n\n- A verified single sender (confirmed by email) on a domain you have not verified cannot be sent from: send.io signs mail only for verified domains, and From addresses on other domains would fail DMARC alignment. The 403 says so; verify the domain or use the sender as `reply_to`.\n\n- Errors: 402 `insufficient_credits` when your credit balance is too low (buy credits in Billing); 403 `validation_error` when the domain is not verified; 422 `validation_error` for an unknown, archived or inbound `stream` or an unknown `sender_id`; 429 `daily_quota_exceeded` when a daily limit is used up: the one until your first credit purchase, or, for new paid accounts, 5,000 emails a day for the first 7 days after the first purchase (by default). It resets at 00:00 UTC.",
        "tags": [
          "Emails"
        ],
        "x-docs-ids": [
          "send-email"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Makes a retry safe: the same key and body within 24 hours returns the first response instead of doing the work again. A key still in use by a request that has not finished, or reused with a different body, answers 409.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "from": {
                    "type": "string",
                    "description": "Sender address, `ada@acme.com` or `Ada <ada@acme.com>`. The domain must be verified. Required, except with `transactional_id` (which sets it, so it cannot be sent) or with a `template` that has a default From."
                  },
                  "to": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "Recipient address or addresses. 1 to 50, counting `cc` and `bcc` too."
                  },
                  "subject": {
                    "type": "string",
                    "description": "Subject line. Cannot contain line breaks. Required, except with `transactional_id` (which sets it) or with a `template` that has a default subject."
                  },
                  "transactional_id": {
                    "type": "string",
                    "description": "Send a transactional email (`tx_...`, see Transactional emails): its From, subject, preview text, Reply-To and tracking, and the published version of its template. Pass the template's variables in `variables`. Cannot be combined with `template`, `html`, `text`, `react`, `from`, `subject`, `reply_to`, `sender_id` or `template_engine` (422)."
                  },
                  "html": {
                    "type": "string",
                    "description": "HTML body. You must send `html` or `text` (unless you use `template` or `transactional_id`)."
                  },
                  "text": {
                    "type": "string",
                    "description": "Plain text body."
                  },
                  "cc": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "Cc recipients."
                  },
                  "bcc": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "Bcc recipients."
                  },
                  "reply_to": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "Reply-To address or addresses."
                  },
                  "scheduled_at": {
                    "type": "string",
                    "description": "Send later. A full ISO 8601 timestamp with a time zone, such as `2026-10-08T09:00:00Z` or `2026-10-08T14:30:00+05:30`, or a relative time like `in 30 minutes`, `in 2 hours` or `in 3 days` (seconds up to weeks). A timestamp without a zone (`2026-10-08T09:00:00`) or a date alone is refused with 422. Must be in the future and at most 30 days ahead."
                  },
                  "headers": {
                    "type": "object",
                    "description": "Custom headers as name/value strings: at most 50 headers, each value up to 2000 characters and without line breaks. Names may use letters, digits and dashes. From, To, Cc, Bcc, Subject, MIME-Version, Message-ID, Date, Received, Delivered-To, Authentication-Results, DKIM-Signature, Return-Path and any `Content-*`, `ARC-*` or `X-SES-*` header are reserved."
                  },
                  "tags": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string",
                          "description": "Tag name. Letters, digits, `_` and `-`, up to 256 characters."
                        },
                        "value": {
                          "type": "string",
                          "description": "Tag value. Same rules as the name."
                        }
                      },
                      "required": [
                        "name",
                        "value"
                      ]
                    },
                    "description": "Tags to attach to the email, at most 50. They come back in webhook events."
                  },
                  "attachments": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "filename": {
                          "type": "string",
                          "description": "File name shown to the recipient."
                        },
                        "content": {
                          "type": "string",
                          "description": "File content, base64 encoded. Send `content` or `path`."
                        },
                        "path": {
                          "type": "string",
                          "description": "A public URL we download the file from (up to 30 MB per file; all of an email's files must download within 15 seconds)."
                        },
                        "content_type": {
                          "type": "string",
                          "description": "MIME type. Detected from the content when left out."
                        },
                        "content_id": {
                          "type": "string",
                          "description": "Content-ID for inline images (`<img src=\"cid:...\">`). Makes the attachment inline. Under 128 characters."
                        }
                      },
                      "required": [
                        "filename"
                      ]
                    },
                    "description": "Files to attach. There is no limit on how many: only the size counts. The whole message must stay under 40 MB as sent, with each attachment base64 encoded (about a third larger than the file). At most 10 attachments may be given by `path`."
                  },
                  "template": {
                    "type": "object",
                    "description": "Deprecated: send with `transactional_id`. Still accepted for now."
                  },
                  "template_engine": {
                    "type": "string",
                    "description": "`simple` or `handlebars`. With `template`, renders the template with this engine instead of its own. Without `template`, renders the inline `subject`, `html` and `text` with `variables`."
                  },
                  "variables": {
                    "type": "object",
                    "description": "Values for the template of a `transactional_id`, or for an inline body. Without `template_engine` the `simple` engine fills `{{NAME}}` and `{{{NAME}}}` (strings and numbers only); with `template_engine: \"handlebars\"` (or a Handlebars template) values may be nested objects and arrays."
                  },
                  "topic_id": {
                    "type": "string",
                    "description": "Topic the email belongs to. Recipients who opted out of the topic are skipped. If nobody is left, the email is recorded as failed and not sent."
                  },
                  "metadata": {
                    "type": "object",
                    "description": "Your own key/value pairs, all strings: at most 50 keys, keys up to 100 characters, values up to 1000, 10 KB in all. Returned on the email, in its events and webhooks, and searchable with `metadata[key]=value` on List emails.",
                    "properties": {
                      "order_id": {
                        "type": "string"
                      },
                      "customer_id": {
                        "type": "string"
                      }
                    }
                  },
                  "track_opens": {
                    "type": "boolean",
                    "description": "Open tracking for this email only. `false` leaves the tracking pixel out even when the domain tracks opens. `true` adds it only when the domain's tracking subdomain is active (or the sender is a free mailbox: then on its pool's shared tracking host); otherwise it is ignored. Leave it out to follow the domain's setting (with `transactional_id`, the transactional email's `track_opens`). A free mailbox's sends are not tracked unless the send sets `true`."
                  },
                  "track_clicks": {
                    "type": "boolean",
                    "description": "Click tracking for this email only. `false` leaves links as written even when the domain tracks clicks. `true` rewrites them only when the domain's tracking subdomain is active (or the sender is a free mailbox: then on its pool's shared tracking host); otherwise it is ignored. Leave it out to follow the domain's setting (with `transactional_id`, the transactional email's `track_clicks`). A free mailbox's sends are not tracked unless the send sets `true`."
                  },
                  "batch_id": {
                    "type": "string",
                    "description": "Add the email to a batch: the `batch_id` that Send batch emails returned, or your own id (1 to 100 letters, digits or `. _ : @ + = ~ -`). Retrieve batch counts its emails by status; Cancel batch cancels the ones still scheduled."
                  },
                  "stream": {
                    "type": "string",
                    "description": "Message stream id (see Streams). Default `outbound`. The stream must exist, not be archived, and not be the inbound stream. Stored on the email; a broadcast stream sends on the bulk lane."
                  },
                  "sender_id": {
                    "type": "string",
                    "description": "A sender's id (see Senders). Fills `from` (name and address) and `reply_to` when you leave them out. The From domain must still be a verified domain of your team."
                  }
                },
                "required": [
                  "to"
                ]
              },
              "example": {
                "from": "Ada <ada@acme.com>",
                "to": [
                  "grace@example.com"
                ],
                "subject": "Your receipt",
                "html": "<p>Thanks for your order.</p>",
                "tags": [
                  {
                    "name": "category",
                    "value": "receipt"
                  }
                ],
                "metadata": {
                  "order_id": "A-1042",
                  "customer_id": "c_981"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "id": "4ef9a417-02e9-4d39-ad75-9611e0fcc33c"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "402": {
            "$ref": "#/components/responses/E402"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "get": {
        "operationId": "listEmails",
        "summary": "List emails",
        "description": "List sent emails, newest first. Filters narrow the list; without any, every email is listed.\n\n- List items return `cc`, `bcc` and `reply_to` as arrays (empty when none), the same as Retrieve email, plus `tags` and `template_id`.\n\n- `from` is written as it was sent: a display name with a comma or other special character is in double quotes (`\"Acme, Inc.\" <ada@acme.com>`).\n\n- send.io extension: `bounce` on every item, null unless a recipient bounced. It describes the first recipient that bounced (`recipient`, `bounced_at`, `type`, `subtype`, `class`, `smtp_code`, `enhanced_code`) and `recipients`, how many bounced. Retrieve email's `bounces` has every bounced recipient with the server's full response.\n\n- send.io extension: `batch_id`, `track_opens` and `track_clicks` (as sent, null when not set) on every item. Retrieve email returns the effective tracking instead, `true` or `false`.\n\n- send.io extension: the filters, and `metadata` on every item. Filters combine with `limit`, `after` and `before` paging. Example: `GET /emails?metadata[order_id]=A-1042&status=bounced`.\n\n- send.io extension: `transactional_id` on the items sent from a transactional email (left out on the others).",
        "tags": [
          "Emails"
        ],
        "x-docs-ids": [
          "list-emails"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Number of items to return, from 1 to 100. Default 20.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "Return items created before the item with this id (the next page). Cannot be combined with `before`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "description": "Return items created after the item with this id (the previous page). Cannot be combined with `after`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "Only emails with this recipient (to, cc or bcc). Case does not matter.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "Only emails from this sender address, or from any address on this domain (`acme.com`).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subject",
            "in": "query",
            "required": false,
            "description": "Only emails whose subject contains this text. Case does not matter.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tag",
            "in": "query",
            "required": false,
            "description": "Only emails with this tag: `name` or `name:value`. Repeat the parameter to require several tags.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "metadata[key]",
            "in": "query",
            "required": false,
            "description": "Only emails whose metadata has this key with this value. `metadata.key=value` works too. Several keys must all match.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Only emails whose `last_event` is this, or one of a comma-separated list (`bounced,complained`).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "template_id",
            "in": "query",
            "required": false,
            "description": "Only emails sent from this template (id or alias). Includes the sends of transactional emails that use it.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "transactional_id",
            "in": "query",
            "required": false,
            "description": "Only emails sent from this transactional email (`tx_...`), deleted ones included. Another value is a 422 `invalid_parameter`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "broadcast_id",
            "in": "query",
            "required": false,
            "description": "Only the emails of this broadcast.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "batch_id",
            "in": "query",
            "required": false,
            "description": "Only the emails of this batch.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "stream",
            "in": "query",
            "required": false,
            "description": "Only emails sent on this message stream, or one of a comma-separated list (`outbound,broadcast`).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "created_after",
            "in": "query",
            "required": false,
            "description": "Only emails created at or after this time: ISO 8601, a date, or Unix seconds.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "created_before",
            "in": "query",
            "required": false,
            "description": "Only emails created before this time: ISO 8601, a date, or Unix seconds.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "stream": {
                            "type": "string",
                            "description": "The message stream the email was sent on (`outbound` unless the send named another)."
                          },
                          "transactional_id": {
                            "type": "string",
                            "description": "The transactional email (`tx_...`) it was sent from. Present only on emails sent with `transactional_id`."
                          },
                          "id": {
                            "type": "string"
                          },
                          "message_id": {
                            "type": "string"
                          },
                          "from": {
                            "type": "string"
                          },
                          "to": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "subject": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "last_event": {
                            "type": "string"
                          },
                          "scheduled_at": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date-time"
                          },
                          "cc": {
                            "type": "array"
                          },
                          "bcc": {
                            "type": "array"
                          },
                          "reply_to": {
                            "type": "array"
                          },
                          "tags": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "name": {
                                  "type": "string"
                                },
                                "value": {
                                  "type": "string"
                                }
                              }
                            }
                          },
                          "template_id": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "batch_id": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "track_opens": {},
                          "track_clicks": {},
                          "metadata": {
                            "type": "object",
                            "properties": {
                              "order_id": {
                                "type": "string"
                              },
                              "customer_id": {
                                "type": "string"
                              }
                            }
                          },
                          "bounce": {}
                        }
                      }
                    },
                    "object": {
                      "type": "string"
                    },
                    "has_more": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "has_more": false,
                  "data": [
                    {
                      "id": "4ef9a417-02e9-4d39-ad75-9611e0fcc33c",
                      "message_id": "<4ef9a417-02e9-4d39-ad75-9611e0fcc33c@acme.com>",
                      "from": "Ada <ada@acme.com>",
                      "to": [
                        "grace@example.com"
                      ],
                      "subject": "Your receipt",
                      "created_at": "2026-10-07T09:15:22.104871+00:00",
                      "last_event": "delivered",
                      "scheduled_at": null,
                      "cc": [],
                      "bcc": [],
                      "reply_to": [],
                      "tags": [
                        {
                          "name": "category",
                          "value": "receipt"
                        }
                      ],
                      "template_id": null,
                      "batch_id": null,
                      "track_opens": null,
                      "track_clicks": null,
                      "metadata": {
                        "order_id": "A-1042",
                        "customer_id": "c_981"
                      },
                      "stream": "outbound",
                      "bounce": null
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/emails/batch": {
      "post": {
        "operationId": "sendBatchEmails",
        "summary": "Send batch emails",
        "description": "Send up to 100 emails in one request. The body is an array of email objects with the same fields as Send email.\n\n- send.io extension: `batch_id` in the response. Every email of the request is stored with it. If every item sends the same `batch_id`, that id is used; otherwise one is generated, and items that name another batch keep their own.\n\n- `track_opens`, `track_clicks`, `batch_id`, `stream`, `sender_id` and `transactional_id` (with `variables`) are accepted on batch items.\n\n- Header `x-batch-validation`: `strict` (default) fails the whole batch on the first invalid email. `permissive` sends the valid ones and adds an `errors` array of `{ index, error }` to the response.\n\n- Attachments are not allowed in batch emails.\n\n- In `strict` mode a batch your credit balance cannot cover is refused whole with 402 `insufficient_credits`. In `permissive` mode the emails the balance cannot cover may instead be listed in `errors` with that 402 while the others are sent.\n\n- send.io extension: `scheduled_at` and `metadata` are accepted on batch items. Resend refuses `scheduled_at` in a batch; here an item with `scheduled_at` is scheduled, not sent now, so leave it out to send at once.\n\n- Supports the `Idempotency-Key` header: a retry with the same key and body returns the first response, the same email ids and `batch_id`. A key still in use, or reused with a different body, answers 409.",
        "tags": [
          "Emails"
        ],
        "x-docs-ids": [
          "send-batch-emails"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Makes a retry safe: the same key and body within 24 hours returns the first response instead of doing the work again. A key still in use by a request that has not finished, or reused with a different body, answers 409.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "x-batch-validation",
            "in": "header",
            "required": false,
            "description": "`strict` (default) fails the whole batch on the first invalid email. `permissive` sends the valid ones and lists the others in `errors` as `{ index, error }`.",
            "schema": {
              "type": "string",
              "enum": [
                "strict",
                "permissive"
              ],
              "default": "strict"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "type": "object",
                  "description": "1 to 100 email objects. Each takes the fields of Send email, except `attachments`.",
                  "properties": {
                    "from": {
                      "type": "string"
                    },
                    "to": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "subject": {
                      "type": "string"
                    },
                    "html": {
                      "type": "string"
                    }
                  }
                }
              },
              "example": [
                {
                  "from": "Ada <ada@acme.com>",
                  "to": [
                    "grace@example.com"
                  ],
                  "subject": "Hello Grace",
                  "html": "<p>Hi Grace</p>"
                },
                {
                  "from": "Ada <ada@acme.com>",
                  "to": [
                    "alan@example.com"
                  ],
                  "subject": "Hello Alan",
                  "html": "<p>Hi Alan</p>"
                }
              ]
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "batch_id": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "id": "ae2014de-c168-4c61-8267-70d2662a1ce1"
                    },
                    {
                      "id": "faccb7a5-8a28-4e9a-ac64-8da1cc3bc1cb"
                    }
                  ],
                  "batch_id": "5b1e7c2a-0d4f-4b8e-9a63-2c7f1e8d4b90"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "402": {
            "$ref": "#/components/responses/E402"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/emails/raw": {
      "post": {
        "operationId": "sendRawEmail",
        "summary": "Send raw email",
        "description": "Send a complete RFC 5322 (MIME) message you built yourself. Envelope recipients come from `to`, `cc` and `bcc`, or from the message's To, Cc and Bcc headers when you give none. The sender's domain must be verified.\n\n- send.io extension.\n\n- Also takes `multipart/form-data`: the message as a file field `message` (or `raw`, `file`), and `to`, `cc`, `bcc` (repeated or comma-separated), `from`, `scheduled_at`, `batch_id`, `track_opens`, `track_clicks` as fields; `tags` and `metadata` as JSON strings, or `tag=name:value` repeated.\n\n- The message is sent as written except: `Message-ID` is replaced with send.io's (`<email_id@domain>`, returned as `message_id` on Retrieve email), `Bcc` and `Return-Path` are dropped, a `DKIM-Signature` by your sending domain is removed (send.io signs the message again), and `Date` and `From` are added if missing.\n\n- The parsed subject, text and HTML bodies, attachments and other headers are stored like any email: Retrieve email, List attachments and the email's events show them.\n\n- With `track_opens` or `track_clicks` true the message is rebuilt from its parsed parts (text, HTML, attachments, custom headers) so the pixel and links can be added.\n\n- Suppressions, the allow-list, quotas, scheduling, events and webhooks work as for Send email. Raw sends always take the database path (not the low-latency hot path).\n\n- Supports the `Idempotency-Key` header. Sending-only API keys may use it.\n\n- Errors: 422 `validation_error` when `raw` is not base64 of a valid message or has no From; 403 `validation_error` when a domain is not verified.",
        "tags": [
          "Emails"
        ],
        "x-docs-ids": [
          "send-raw-email"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Makes a retry safe: the same key and body within 24 hours returns the first response instead of doing the work again. A key still in use by a request that has not finished, or reused with a different body, answers 409.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "raw": {
                    "type": "string",
                    "description": "The whole message, base64 encoded (headers and body). Up to 40 MB once decoded."
                  },
                  "from": {
                    "type": "string",
                    "description": "Envelope sender. Defaults to the From header. Its domain, and the From header's, must be verified domains of your team."
                  },
                  "to": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "Envelope recipients. 1 to 50 in all, counting `cc` and `bcc`. When `to`, `cc` and `bcc` are all left out, the To, Cc and Bcc headers are used."
                  },
                  "cc": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "Envelope Cc recipients (only recorded as cc; the message's headers are sent as written)."
                  },
                  "bcc": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "Envelope Bcc recipients."
                  },
                  "tags": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "value": {
                          "type": "string"
                        }
                      }
                    },
                    "description": "Tags, as on Send email."
                  },
                  "metadata": {
                    "type": "object",
                    "description": "Metadata, as on Send email."
                  },
                  "scheduled_at": {
                    "type": "string",
                    "description": "Send later, as on Send email."
                  },
                  "batch_id": {
                    "type": "string",
                    "description": "Join a batch, as on Send email."
                  },
                  "track_opens": {
                    "type": "boolean",
                    "description": "`true` adds the open pixel (when the domain's tracking subdomain is active). Raw messages are never tracked unless you ask."
                  },
                  "track_clicks": {
                    "type": "boolean",
                    "description": "`true` rewrites links for click tracking (when the domain's tracking subdomain is active)."
                  }
                },
                "required": [
                  "raw"
                ]
              },
              "example": {
                "raw": "RnJvbTogQWRhIDxhZGFAYWNtZS5jb20+DQpUbzogZ3JhY2VAZXhhbXBsZS5jb20NClN1YmplY3Q6IEhlbGxvDQpNSU1FLVZlcnNpb246IDEuMA0KQ29udGVudC1UeXBlOiB0ZXh0L3BsYWluOyBjaGFyc2V0PXV0Zi04DQoNCkhpIEdyYWNlDQo=",
                "to": [
                  "grace@example.com"
                ],
                "tags": [
                  {
                    "name": "category",
                    "value": "raw"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "id": "4ef9a417-02e9-4d39-ad75-9611e0fcc33c"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/emails/{email_id}": {
      "get": {
        "operationId": "retrieveEmail",
        "summary": "Retrieve email",
        "description": "Get one sent email, including its body, recipients and latest status.\n\n- `metadata` is the object you sent (`{}` when none).\n\n- send.io extension: `bounces` lists every recipient that bounced, with why (`[]` when none): `recipient`, `bounced_at`, `type` (Permanent or Transient), `subtype` (the provider's, such as General, NoEmail, MailboxFull), `class` (hard, soft or undetermined), `smtp_code` (550), `enhanced_code` (5.1.1), `response` (the recipient server's reply, as it was given) and `suppressed` (the address is now on your suppression list). Example: `{\"recipient\":\"grace@example.com\",\"bounced_at\":\"2026-10-07T09:15:24.210Z\",\"type\":\"Permanent\",\"subtype\":\"General\",\"class\":\"hard\",\"smtp_code\":\"550\",\"enhanced_code\":\"5.1.1\",\"response\":\"smtp; 550 5.1.1 <grace@example.com>: Recipient address rejected: User unknown\",\"suppressed\":true}`.\n\n- `last_event` is one of queued, scheduled, sent, delivered, delivery_delayed, bounced, complained, opened, clicked, failed, suppressed, canceled.\n\n- send.io adds `message_id`, the Message-ID header the email was sent with, and `stream`, the message stream it was sent on (also in its webhook events' `data.stream`).\n\n- send.io extension: `transactional_id` on an email sent from a transactional email (left out for every other email), also in its webhook events' `data.transactional_id`.\n\n- send.io extension: `track_opens` and `track_clicks` are whether this email's opens and clicks are tracked, `true` or `false` (never null): the send's own flags, else the domain's switches, and `false` without an active tracking host. A free mailbox's email is tracked only where the send set the flag `true`. A broadcast email follows its broadcast's tracking setting. List emails returns the flags as sent (null when not set).",
        "tags": [
          "Emails"
        ],
        "x-docs-ids": [
          "retrieve-email"
        ],
        "parameters": [
          {
            "name": "email_id",
            "in": "path",
            "required": true,
            "description": "The email id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "message_id": {
                      "type": "string"
                    },
                    "from": {
                      "type": "string"
                    },
                    "to": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "cc": {
                      "type": "array"
                    },
                    "bcc": {
                      "type": "array"
                    },
                    "reply_to": {
                      "type": "array"
                    },
                    "subject": {
                      "type": "string"
                    },
                    "html": {
                      "type": "string"
                    },
                    "text": {},
                    "tags": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "value": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "properties": {
                        "order_id": {
                          "type": "string"
                        },
                        "customer_id": {
                          "type": "string"
                        }
                      }
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "last_event": {
                      "type": "string"
                    },
                    "scheduled_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    },
                    "stream": {
                      "type": "string"
                    },
                    "track_opens": {
                      "type": "boolean"
                    },
                    "track_clicks": {
                      "type": "boolean"
                    },
                    "bounces": {
                      "type": "array"
                    }
                  }
                },
                "example": {
                  "object": "email",
                  "id": "4ef9a417-02e9-4d39-ad75-9611e0fcc33c",
                  "message_id": "<4ef9a417-02e9-4d39-ad75-9611e0fcc33c@acme.com>",
                  "from": "Ada <ada@acme.com>",
                  "to": [
                    "grace@example.com"
                  ],
                  "cc": [],
                  "bcc": [],
                  "reply_to": [],
                  "subject": "Your receipt",
                  "html": "<p>Thanks for your order.</p>",
                  "text": null,
                  "tags": [
                    {
                      "name": "category",
                      "value": "receipt"
                    }
                  ],
                  "metadata": {
                    "order_id": "A-1042",
                    "customer_id": "c_981"
                  },
                  "created_at": "2026-10-07T09:15:22.104871+00:00",
                  "last_event": "delivered",
                  "scheduled_at": null,
                  "stream": "outbound",
                  "track_opens": true,
                  "track_clicks": false,
                  "bounces": []
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "patch": {
        "operationId": "updateEmail",
        "summary": "Update email",
        "description": "Change when a scheduled or queued email is sent. Works only while the email has not been picked up for sending.\n\n- Returns 422 \"Only an email that has not been leased can be rescheduled.\" once sending has started.",
        "tags": [
          "Emails"
        ],
        "x-docs-ids": [
          "update-email"
        ],
        "parameters": [
          {
            "name": "email_id",
            "in": "path",
            "required": true,
            "description": "The email id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "scheduled_at": {
                    "type": "string",
                    "description": "New send time, in the same forms as on Send email: a full ISO 8601 timestamp with a time zone (`2026-10-08T09:00:00Z`) or a relative time like `in 30 minutes`, `in 2 hours` or `in 3 days`. A timestamp without a zone is refused with 422. Must be in the future and at most 30 days ahead."
                  }
                },
                "required": [
                  "scheduled_at"
                ]
              },
              "example": {
                "scheduled_at": "in 1 hour"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "object": "email",
                  "id": "4ef9a417-02e9-4d39-ad75-9611e0fcc33c"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/emails/{email_id}/events": {
      "get": {
        "operationId": "listEmailEvents",
        "summary": "List email events",
        "description": "The timeline of one email, oldest first: queued or scheduled, sent, delivered, delivery_delayed, bounced, complained, opened, clicked, failed, suppressed, canceled and unsubscribed, per recipient, with detail. Full event history covers the last 30 days (see the notes).\n\n- send.io extension. `type` is one of queued, scheduled, sent, delivered, delivery_delayed, bounced, complained, opened, clicked, failed, suppressed, canceled, unsubscribed.\n\n- `detail` holds what is known: `bounce_class` (hard, soft or undetermined), `bounce_type`, `bounce_subtype`, `smtp_code`, `reason`, `response` (the SMTP reply), `provider` for delivery events; `url`, `ip` and `user_agent` for opens and clicks; `unsubscribe_source` (`list_unsubscribe` or `unsubscribe_link`); plus the email's `tags` and `metadata`.\n\n- Events about the whole email (queued, scheduled, canceled, and a failed send) and opens and clicks name the `recipient` only when the email had one recipient; otherwise `recipient` is empty. A delivery can be deferred several times: each attempt is an event.\n\n- Opens and clicks also list `recipients`: every recipient of the email (to, then cc and bcc). The tracking pixel and links are per email, not per recipient, so an open or click of an email sent to several people cannot say which of them it was. For per-recipient opens and clicks, send one email per recipient (Send batch emails does this in one request).\n\n- Every event is kept for 30 days; after that the email's delivery state, bounce detail, opens, clicks and unsubscribes are still listed.",
        "tags": [
          "Emails"
        ],
        "x-docs-ids": [
          "list-email-events"
        ],
        "parameters": [
          {
            "name": "email_id",
            "in": "path",
            "required": true,
            "description": "The email id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "email_id": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "object": {
                            "type": "string"
                          },
                          "id": {
                            "type": "string"
                          },
                          "email_id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "recipient": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "object",
                            "properties": {
                              "metadata": {
                                "type": "object",
                                "properties": {
                                  "order_id": {
                                    "type": "string"
                                  }
                                }
                              },
                              "bounce_class": {
                                "type": "string"
                              },
                              "bounce_subtype": {
                                "type": "string"
                              },
                              "smtp_code": {
                                "type": "string"
                              },
                              "reason": {
                                "type": "string"
                              },
                              "provider": {
                                "type": "string"
                              },
                              "tags": {
                                "type": "object",
                                "properties": {
                                  "category": {
                                    "type": "string"
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "email_id": "4ef9a417-02e9-4d39-ad75-9611e0fcc33c",
                  "data": [
                    {
                      "object": "email_event",
                      "id": "4ef9a417-02e9-4d39-ad75-9611e0fcc33c.queued",
                      "email_id": "4ef9a417-02e9-4d39-ad75-9611e0fcc33c",
                      "type": "queued",
                      "created_at": "2026-10-07T09:15:22.104Z",
                      "recipient": "grace@example.com",
                      "detail": {
                        "metadata": {
                          "order_id": "A-1042"
                        }
                      }
                    },
                    {
                      "object": "email_event",
                      "id": "7d0e5c1a-9b2f-4e8d-a6c3-1f4b2d9e8a70.sent",
                      "email_id": "4ef9a417-02e9-4d39-ad75-9611e0fcc33c",
                      "type": "sent",
                      "created_at": "2026-10-07T09:15:22.871Z",
                      "recipient": "grace@example.com",
                      "detail": {
                        "metadata": {
                          "order_id": "A-1042"
                        }
                      }
                    },
                    {
                      "object": "email_event",
                      "id": "b2a7c9e4-1d3f-4a6b-8c5e-0f9d2e7b4a13",
                      "email_id": "4ef9a417-02e9-4d39-ad75-9611e0fcc33c",
                      "type": "bounced",
                      "created_at": "2026-10-07T09:15:24.310Z",
                      "recipient": "grace@example.com",
                      "detail": {
                        "bounce_class": "hard",
                        "bounce_subtype": "NoEmail",
                        "smtp_code": "550",
                        "reason": "550 5.1.1 <grace@example.com>: user unknown",
                        "provider": "airmta",
                        "tags": {
                          "category": "receipt"
                        },
                        "metadata": {
                          "order_id": "A-1042"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/emails/events": {
      "get": {
        "operationId": "listTeamEmailEvents",
        "summary": "List events",
        "description": "Your team's email events, newest first, across all emails. Filter by type, recipient, email, tag, stream and time, and page with the cursor.\n\n- send.io extension. Events and `detail` are as in List email events; each item also has a summary of its `email`.\n\n- Events from the last 30 days.",
        "tags": [
          "Emails"
        ],
        "x-docs-ids": [
          "list-team-email-events"
        ],
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "required": false,
            "description": "Only events of this type, or a comma-separated list (`opened,clicked`). The `email.` prefix is optional.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "recipient",
            "in": "query",
            "required": false,
            "description": "Only events for this recipient address. Case does not matter. Events about the whole email (queued, scheduled, canceled) are not matched, nor are opens and clicks of an email with several recipients (they name no single recipient; see `recipients`).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "email_id",
            "in": "query",
            "required": false,
            "description": "Only the events of this email.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tag",
            "in": "query",
            "required": false,
            "description": "Only events of emails with this tag: `name` or `name:value`. Repeat to require several.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "stream",
            "in": "query",
            "required": false,
            "description": "Only events of emails sent on this message stream, or a comma-separated list (`outbound,product-updates`).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "Only events at or after this time: ISO 8601, a date, or Unix seconds.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "description": "Only events before this time: ISO 8601, a date, or Unix seconds.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Number of events to return, from 1 to 300. Default 50.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The `next_cursor` of the previous page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "next_cursor": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "object": {
                            "type": "string"
                          },
                          "id": {
                            "type": "string"
                          },
                          "email_id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "recipient": {
                            "type": "string"
                          },
                          "recipients": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "detail": {
                            "type": "object",
                            "properties": {
                              "url": {
                                "type": "string"
                              },
                              "ip": {
                                "type": "string"
                              },
                              "user_agent": {
                                "type": "string"
                              },
                              "metadata": {
                                "type": "object",
                                "properties": {
                                  "order_id": {
                                    "type": "string"
                                  }
                                }
                              }
                            }
                          },
                          "email": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "from": {
                                "type": "string"
                              },
                              "subject": {
                                "type": "string"
                              },
                              "message_id": {
                                "type": "string"
                              },
                              "created_at": {
                                "type": "string",
                                "format": "date-time"
                              },
                              "stream": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "has_more": true,
                  "next_cursor": "eyJ0IjoiMjAyNi0xMC0wN1QwOToxNToyNC4zMVoiLCJpIjoiYjJhN2M5ZTQifQ",
                  "data": [
                    {
                      "object": "email_event",
                      "id": "c41f8a2d-6e9b-4d07-b3a5-8e2c1f7d9b64",
                      "email_id": "4ef9a417-02e9-4d39-ad75-9611e0fcc33c",
                      "type": "clicked",
                      "created_at": "2026-10-07T09:20:03.552Z",
                      "recipient": "grace@example.com",
                      "recipients": [
                        "grace@example.com"
                      ],
                      "detail": {
                        "url": "https://acme.com/orders/A-1042",
                        "ip": "203.0.113.7",
                        "user_agent": "Mozilla/5.0",
                        "metadata": {
                          "order_id": "A-1042"
                        }
                      },
                      "email": {
                        "id": "4ef9a417-02e9-4d39-ad75-9611e0fcc33c",
                        "from": "ada@acme.com",
                        "subject": "Your receipt",
                        "message_id": "<4ef9a417-02e9-4d39-ad75-9611e0fcc33c@acme.com>",
                        "created_at": "2026-10-07T09:15:22.104871+00:00",
                        "stream": "outbound"
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/emails/{email_id}/cancel": {
      "post": {
        "operationId": "cancelEmail",
        "summary": "Cancel email",
        "description": "Cancel a scheduled or queued email before it is sent. Its recipients no longer count toward your quota.\n\n- Returns 404 if the email does not exist or has already been picked up for sending.",
        "tags": [
          "Emails"
        ],
        "x-docs-ids": [
          "cancel-email"
        ],
        "parameters": [
          {
            "name": "email_id",
            "in": "path",
            "required": true,
            "description": "The email id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "object": "email",
                  "id": "4ef9a417-02e9-4d39-ad75-9611e0fcc33c"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/emails/batches/{batch_id}": {
      "get": {
        "operationId": "retrieveEmailBatch",
        "summary": "Retrieve batch",
        "description": "Count the emails of a batch by status.\n\n- send.io extension. `counts` is keyed by `last_event`. `cancelable` is how many are still scheduled and not yet picked up for sending. `scheduled_at` is the earliest one.\n\n- Returns 404 when no email of your team has this batch id.",
        "tags": [
          "Emails"
        ],
        "x-docs-ids": [
          "retrieve-email-batch"
        ],
        "parameters": [
          {
            "name": "batch_id",
            "in": "path",
            "required": true,
            "description": "The batch id: returned by Send batch emails, or your own.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "total": {
                      "type": "number"
                    },
                    "counts": {
                      "type": "object",
                      "properties": {
                        "scheduled": {
                          "type": "number"
                        },
                        "delivered": {
                          "type": "number"
                        }
                      }
                    },
                    "cancelable": {
                      "type": "number"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "scheduled_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "object": "batch",
                  "id": "5b1e7c2a-0d4f-4b8e-9a63-2c7f1e8d4b90",
                  "total": 3,
                  "counts": {
                    "scheduled": 2,
                    "delivered": 1
                  },
                  "cancelable": 2,
                  "created_at": "2026-10-07T09:15:22.104871+00:00",
                  "scheduled_at": "2026-10-08T09:00:00+00:00"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/emails/batches/{batch_id}/cancel": {
      "post": {
        "operationId": "cancelEmailBatch",
        "summary": "Cancel batch",
        "description": "Cancel every email of a batch that is still scheduled. Their recipients no longer count toward your quota.\n\n- send.io extension. Emails already queued for immediate sending, being sent or sent are left alone and counted in `not_canceled`. Calling it again cancels nothing more.\n\n- Returns 404 when no email of your team has this batch id.",
        "tags": [
          "Emails"
        ],
        "x-docs-ids": [
          "cancel-email-batch"
        ],
        "parameters": [
          {
            "name": "batch_id",
            "in": "path",
            "required": true,
            "description": "The batch id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "total": {
                      "type": "number"
                    },
                    "canceled": {
                      "type": "number"
                    },
                    "not_canceled": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "object": "batch",
                  "id": "5b1e7c2a-0d4f-4b8e-9a63-2c7f1e8d4b90",
                  "total": 3,
                  "canceled": 2,
                  "not_canceled": 1
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/emails/metrics": {
      "get": {
        "operationId": "emailMetrics",
        "summary": "Email metrics",
        "description": "Counts and rates for the emails you sent in a period, by period and optionally broken down by domain, email, broadcast, tag, sender or mailbox provider.\n\n- send.io extension. Emails are counted by the time they were created; emails sent over SMTP are not counted. Answers are cached for a minute.\n\n- Without `metrics[]`, `totals` and each row carry all 22 metrics. The example asked for three.\n\n- Rows carry the keys of their dimensions: `period`, `domain_id` and `domain_name`, `email_id`, `broadcast_id` and `broadcast_name`, `tag` (`name:value`) with `tag_name` and `tag_value` (or `tag` = the name with `tag_name`), `sender`, `mailbox_provider`, `stream`.\n\n- With a tag dimension an email with two tags counts in both rows and untagged emails make no row; `totals` still count every matching email once.\n\n- `mailbox_provider` comes from the domain of the email's first To recipient: gmail (gmail.com, googlemail.com), outlook (outlook, hotmail, live, msn), yahoo (yahoo, ymail, rocketmail, aol), icloud (icloud.com, me.com, mac.com), else other. Custom domains hosted by Google Workspace or Microsoft 365 count as other.",
        "tags": [
          "Emails"
        ],
        "x-docs-ids": [
          "email-metrics"
        ],
        "parameters": [
          {
            "name": "start_date",
            "in": "query",
            "required": false,
            "description": "Start of the period: a date (`2026-10-01`) or an ISO 8601 timestamp, in `timezone`. Default: 7 days before `end_date`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "end_date",
            "in": "query",
            "required": false,
            "description": "End of the period. A bare date covers that whole day. Default: now.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "timezone",
            "in": "query",
            "required": false,
            "description": "IANA time zone for the dates and periods. Default `UTC`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "granularity",
            "in": "query",
            "required": false,
            "description": "`hourly`, `daily` (default), `weekly` or `monthly`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "metrics[]",
            "in": "query",
            "required": false,
            "description": "Metrics to return (repeat or comma-separate). Default: all of received, sent, delivered, delivery_delayed, failed, suppressed, bounced, bounced_transient, bounced_permanent, bounced_undetermined, opened, unique_opened, clicked, unique_clicked, complained, unsubscribed and the rates delivery_rate, open_rate, click_rate, bounce_rate, complaint_rate, unsubscribe_rate.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "dimensions[]",
            "in": "query",
            "required": false,
            "description": "Row breakdown: `period` (default), `domain`, `email`, `broadcast`, `tag` (name and value), `tag_name`, `sender` (from address), `mailbox_provider` and `stream` (message stream). Combine several, except email with broadcast and tag with tag_name.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "stream[]",
            "in": "query",
            "required": false,
            "description": "Only emails sent on these message streams.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "domain_id[]",
            "in": "query",
            "required": false,
            "description": "Only emails from these domains.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "email_id[]",
            "in": "query",
            "required": false,
            "description": "Only these emails.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "broadcast_id[]",
            "in": "query",
            "required": false,
            "description": "Only the emails of these broadcasts.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tag[]",
            "in": "query",
            "required": false,
            "description": "Only emails with any of these tags: `name` or `name:value`. With a tag dimension, only these tags make rows.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sender[]",
            "in": "query",
            "required": false,
            "description": "Only emails from any of these from addresses, or from any address on a bare domain (`acme.com`).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "mailbox_provider[]",
            "in": "query",
            "required": false,
            "description": "Only emails whose first To recipient is at one of these providers: `gmail`, `outlook`, `yahoo`, `icloud`, `other`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "metrics": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "The metrics in each row: the ones requested, or all 22 by default."
                    },
                    "dimensions": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "The row breakdown."
                    },
                    "totals": {
                      "type": "object",
                      "properties": {
                        "received": {
                          "type": "number",
                          "description": "Count of received. Present when requested in `metrics[]` (all are by default)."
                        },
                        "sent": {
                          "type": "number",
                          "description": "Count of sent. Present when requested in `metrics[]` (all are by default)."
                        },
                        "delivered": {
                          "type": "number",
                          "description": "Count of delivered. Present when requested in `metrics[]` (all are by default)."
                        },
                        "delivery_delayed": {
                          "type": "number",
                          "description": "Count of delivery delayed. Present when requested in `metrics[]` (all are by default)."
                        },
                        "failed": {
                          "type": "number",
                          "description": "Count of failed. Present when requested in `metrics[]` (all are by default)."
                        },
                        "suppressed": {
                          "type": "number",
                          "description": "Count of suppressed. Present when requested in `metrics[]` (all are by default)."
                        },
                        "bounced": {
                          "type": "number",
                          "description": "Count of bounced. Present when requested in `metrics[]` (all are by default)."
                        },
                        "bounced_transient": {
                          "type": "number",
                          "description": "Count of bounced transient. Present when requested in `metrics[]` (all are by default)."
                        },
                        "bounced_permanent": {
                          "type": "number",
                          "description": "Count of bounced permanent. Present when requested in `metrics[]` (all are by default)."
                        },
                        "bounced_undetermined": {
                          "type": "number",
                          "description": "Count of bounced undetermined. Present when requested in `metrics[]` (all are by default)."
                        },
                        "opened": {
                          "type": "number",
                          "description": "Count of opened. Present when requested in `metrics[]` (all are by default)."
                        },
                        "unique_opened": {
                          "type": "number",
                          "description": "Count of unique opened. Present when requested in `metrics[]` (all are by default)."
                        },
                        "clicked": {
                          "type": "number",
                          "description": "Count of clicked. Present when requested in `metrics[]` (all are by default)."
                        },
                        "unique_clicked": {
                          "type": "number",
                          "description": "Count of unique clicked. Present when requested in `metrics[]` (all are by default)."
                        },
                        "complained": {
                          "type": "number",
                          "description": "Count of complained. Present when requested in `metrics[]` (all are by default)."
                        },
                        "unsubscribed": {
                          "type": "number",
                          "description": "Count of unsubscribed. Present when requested in `metrics[]` (all are by default)."
                        },
                        "delivery_rate": {
                          "type": "number",
                          "description": "A fraction from 0 to 1, rounded to 4 places; 0 when the base is 0. Present when requested (all are by default)."
                        },
                        "open_rate": {
                          "type": "number",
                          "description": "A fraction from 0 to 1, rounded to 4 places; 0 when the base is 0. Present when requested (all are by default)."
                        },
                        "click_rate": {
                          "type": "number",
                          "description": "A fraction from 0 to 1, rounded to 4 places; 0 when the base is 0. Present when requested (all are by default)."
                        },
                        "bounce_rate": {
                          "type": "number",
                          "description": "A fraction from 0 to 1, rounded to 4 places; 0 when the base is 0. Present when requested (all are by default)."
                        },
                        "complaint_rate": {
                          "type": "number",
                          "description": "A fraction from 0 to 1, rounded to 4 places; 0 when the base is 0. Present when requested (all are by default)."
                        },
                        "unsubscribe_rate": {
                          "type": "number",
                          "description": "A fraction from 0 to 1, rounded to 4 places; 0 when the base is 0. Present when requested (all are by default)."
                        }
                      }
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "received": {
                            "type": "number",
                            "description": "Count of received. Present when requested in `metrics[]` (all are by default)."
                          },
                          "sent": {
                            "type": "number",
                            "description": "Count of sent. Present when requested in `metrics[]` (all are by default)."
                          },
                          "delivered": {
                            "type": "number",
                            "description": "Count of delivered. Present when requested in `metrics[]` (all are by default)."
                          },
                          "delivery_delayed": {
                            "type": "number",
                            "description": "Count of delivery delayed. Present when requested in `metrics[]` (all are by default)."
                          },
                          "failed": {
                            "type": "number",
                            "description": "Count of failed. Present when requested in `metrics[]` (all are by default)."
                          },
                          "suppressed": {
                            "type": "number",
                            "description": "Count of suppressed. Present when requested in `metrics[]` (all are by default)."
                          },
                          "bounced": {
                            "type": "number",
                            "description": "Count of bounced. Present when requested in `metrics[]` (all are by default)."
                          },
                          "bounced_transient": {
                            "type": "number",
                            "description": "Count of bounced transient. Present when requested in `metrics[]` (all are by default)."
                          },
                          "bounced_permanent": {
                            "type": "number",
                            "description": "Count of bounced permanent. Present when requested in `metrics[]` (all are by default)."
                          },
                          "bounced_undetermined": {
                            "type": "number",
                            "description": "Count of bounced undetermined. Present when requested in `metrics[]` (all are by default)."
                          },
                          "opened": {
                            "type": "number",
                            "description": "Count of opened. Present when requested in `metrics[]` (all are by default)."
                          },
                          "unique_opened": {
                            "type": "number",
                            "description": "Count of unique opened. Present when requested in `metrics[]` (all are by default)."
                          },
                          "clicked": {
                            "type": "number",
                            "description": "Count of clicked. Present when requested in `metrics[]` (all are by default)."
                          },
                          "unique_clicked": {
                            "type": "number",
                            "description": "Count of unique clicked. Present when requested in `metrics[]` (all are by default)."
                          },
                          "complained": {
                            "type": "number",
                            "description": "Count of complained. Present when requested in `metrics[]` (all are by default)."
                          },
                          "unsubscribed": {
                            "type": "number",
                            "description": "Count of unsubscribed. Present when requested in `metrics[]` (all are by default)."
                          },
                          "delivery_rate": {
                            "type": "number",
                            "description": "A fraction from 0 to 1, rounded to 4 places; 0 when the base is 0. Present when requested (all are by default)."
                          },
                          "open_rate": {
                            "type": "number",
                            "description": "A fraction from 0 to 1, rounded to 4 places; 0 when the base is 0. Present when requested (all are by default)."
                          },
                          "click_rate": {
                            "type": "number",
                            "description": "A fraction from 0 to 1, rounded to 4 places; 0 when the base is 0. Present when requested (all are by default)."
                          },
                          "bounce_rate": {
                            "type": "number",
                            "description": "A fraction from 0 to 1, rounded to 4 places; 0 when the base is 0. Present when requested (all are by default)."
                          },
                          "complaint_rate": {
                            "type": "number",
                            "description": "A fraction from 0 to 1, rounded to 4 places; 0 when the base is 0. Present when requested (all are by default)."
                          },
                          "unsubscribe_rate": {
                            "type": "number",
                            "description": "A fraction from 0 to 1, rounded to 4 places; 0 when the base is 0. Present when requested (all are by default)."
                          },
                          "period": {
                            "type": "string",
                            "description": "The start of the period, with the `period` dimension. RFC 3339 with the offset of `timezone`, for example `2026-10-07T00:00:00+02:00`. Left out otherwise."
                          },
                          "domain_id": {
                            "type": "string",
                            "description": "With the `domain` dimension. Left out otherwise."
                          },
                          "domain_name": {
                            "type": "string",
                            "description": "With the `domain` dimension. Left out otherwise."
                          },
                          "email_id": {
                            "type": "string",
                            "description": "With the `email` dimension. Left out otherwise."
                          },
                          "broadcast_id": {
                            "type": "string",
                            "description": "With the `broadcast` dimension. Left out otherwise."
                          },
                          "broadcast_name": {
                            "type": "string",
                            "description": "With the `broadcast` dimension. Left out otherwise."
                          },
                          "tag": {
                            "type": "string",
                            "description": "With the `tag` dimension (`name:value`) or the `tag_name` dimension (the name). Left out otherwise."
                          },
                          "tag_name": {
                            "type": "string",
                            "description": "With the `tag` or `tag_name` dimension. Left out otherwise."
                          },
                          "tag_value": {
                            "type": "string",
                            "description": "With the `tag` dimension. Left out otherwise."
                          },
                          "sender": {
                            "type": "string",
                            "description": "With the `sender` dimension. Left out otherwise."
                          },
                          "mailbox_provider": {
                            "type": "string",
                            "description": "With the `mailbox_provider` dimension. Left out otherwise."
                          },
                          "stream": {
                            "type": "string",
                            "description": "With the `stream` dimension. Left out otherwise."
                          }
                        }
                      }
                    },
                    "object": {
                      "type": "string"
                    },
                    "granularity": {
                      "type": "string"
                    },
                    "start_date": {
                      "type": "string"
                    },
                    "end_date": {
                      "type": "string"
                    },
                    "timezone": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "object": "metrics",
                  "metrics": [
                    "delivered",
                    "unique_opened",
                    "open_rate"
                  ],
                  "dimensions": [
                    "period",
                    "tag"
                  ],
                  "granularity": "daily",
                  "start_date": "2026-10-01T00:00:00Z",
                  "end_date": "2026-10-07T23:59:59Z",
                  "timezone": "UTC",
                  "totals": {
                    "delivered": 1180,
                    "unique_opened": 512,
                    "open_rate": 0.4339
                  },
                  "data": [
                    {
                      "period": "2026-10-07T00:00:00+00:00",
                      "tag": "category:receipt",
                      "tag_name": "category",
                      "tag_value": "receipt",
                      "delivered": 410,
                      "unique_opened": 201,
                      "open_rate": 0.4902
                    },
                    {
                      "period": "2026-10-07T00:00:00+00:00",
                      "tag": "category:welcome",
                      "tag_name": "category",
                      "tag_value": "welcome",
                      "delivered": 96,
                      "unique_opened": 37,
                      "open_rate": 0.3854
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/emails/tags": {
      "get": {
        "operationId": "listEmailTags",
        "summary": "List tags",
        "description": "The tags on emails you sent in a period, most used first, with how many emails carry each.\n\n- send.io extension. Tags are not stored on their own: a tag exists while emails in the period carry it. `count` is the number of emails.",
        "tags": [
          "Emails"
        ],
        "x-docs-ids": [
          "list-email-tags"
        ],
        "parameters": [
          {
            "name": "start_date",
            "in": "query",
            "required": false,
            "description": "Start of the period (date or ISO 8601). Default: 30 days before `end_date`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "end_date",
            "in": "query",
            "required": false,
            "description": "End of the period. A bare date covers that whole day. Default: now.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "timezone",
            "in": "query",
            "required": false,
            "description": "IANA time zone for the dates. Default `UTC`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "by",
            "in": "query",
            "required": false,
            "description": "`name_value` (default): one row per tag name and value. `name`: one row per tag name.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "name",
            "in": "query",
            "required": false,
            "description": "Only tags with this name.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "prefix",
            "in": "query",
            "required": false,
            "description": "Only tags whose name starts with this.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "1 to 1000. Default 100.",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "by": {
                      "type": "string"
                    },
                    "start_date": {
                      "type": "string"
                    },
                    "end_date": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "value": {
                            "type": "string"
                          },
                          "count": {
                            "type": "number"
                          },
                          "first_seen": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "last_seen": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "has_more": false,
                  "by": "name_value",
                  "start_date": "2026-09-07T09:15:22Z",
                  "end_date": "2026-10-07T09:15:22Z",
                  "data": [
                    {
                      "name": "category",
                      "value": "receipt",
                      "count": 1204,
                      "first_seen": "2026-09-08T10:02:11.5521+00:00",
                      "last_seen": "2026-10-07T09:15:22.104871+00:00"
                    },
                    {
                      "name": "category",
                      "value": "welcome",
                      "count": 311,
                      "first_seen": "2026-09-12T08:44:01.003+00:00",
                      "last_seen": "2026-10-06T18:20:47.9+00:00"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/emails/{email_id}/attachments": {
      "get": {
        "operationId": "listEmailAttachments",
        "summary": "List attachments",
        "description": "List the attachments of a sent email. Each one has a signed download link valid for one hour.",
        "tags": [
          "Emails"
        ],
        "x-docs-ids": [
          "list-email-attachments"
        ],
        "parameters": [
          {
            "name": "email_id",
            "in": "path",
            "required": true,
            "description": "The email id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Number of items to return, from 1 to 100. All attachments are returned when left out.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "Return items created before the item with this id (the next page). Cannot be combined with `before`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "description": "Return items created after the item with this id (the previous page). Cannot be combined with `after`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "filename": {
                            "type": "string"
                          },
                          "size": {
                            "type": "number"
                          },
                          "content_type": {
                            "type": "string"
                          },
                          "content_disposition": {
                            "type": "string"
                          },
                          "content_id": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "download_url": {
                            "type": "string"
                          },
                          "expires_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "has_more": false,
                  "data": [
                    {
                      "id": "2a0c9ce0-3112-4728-976e-47ddcd16a318",
                      "filename": "invoice.pdf",
                      "size": 48213,
                      "content_type": "application/pdf",
                      "content_disposition": "attachment",
                      "content_id": null,
                      "download_url": "https://api.send.io/download/eyJ0Ijoi...",
                      "expires_at": "2026-10-07T10:15:22.104871Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/emails/{email_id}/attachments/{attachment_id}": {
      "get": {
        "operationId": "retrieveEmailAttachment",
        "summary": "Retrieve attachment",
        "description": "Get one attachment of a sent email, with a signed download link valid for one hour.",
        "tags": [
          "Emails"
        ],
        "x-docs-ids": [
          "retrieve-email-attachment"
        ],
        "parameters": [
          {
            "name": "email_id",
            "in": "path",
            "required": true,
            "description": "The email id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "attachment_id",
            "in": "path",
            "required": true,
            "description": "The attachment id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "filename": {
                      "type": "string"
                    },
                    "size": {
                      "type": "number"
                    },
                    "content_type": {
                      "type": "string"
                    },
                    "content_disposition": {
                      "type": "string"
                    },
                    "content_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "download_url": {
                      "type": "string"
                    },
                    "expires_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "object": "attachment",
                  "id": "2a0c9ce0-3112-4728-976e-47ddcd16a318",
                  "filename": "invoice.pdf",
                  "size": 48213,
                  "content_type": "application/pdf",
                  "content_disposition": "attachment",
                  "content_id": null,
                  "download_url": "https://api.send.io/download/eyJ0Ijoi...",
                  "expires_at": "2026-10-07T10:15:22.104871Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/emails/{email_id}/share": {
      "post": {
        "operationId": "shareEmail",
        "summary": "Create share link",
        "description": "Create a public, read-only link that shows the email's subject, sender and body. The link expires.\n\n- send.io extension.",
        "tags": [
          "Emails"
        ],
        "x-docs-ids": [
          "share-email"
        ],
        "parameters": [
          {
            "name": "email_id",
            "in": "path",
            "required": true,
            "description": "The email id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "expires_in": {
                    "type": [
                      "number",
                      "string"
                    ],
                    "description": "Lifetime in seconds, or a duration like `2h`. From 1 second to 48 hours. Default 24 hours."
                  }
                }
              },
              "example": {
                "expires_in": "2h"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "object": "email",
                  "id": "4ef9a417-02e9-4d39-ad75-9611e0fcc33c",
                  "url": "https://api.send.io/shared/eyJ0Ijoi..."
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/emails/receiving": {
      "get": {
        "operationId": "listReceivedEmails",
        "summary": "List received emails",
        "description": "List received emails, newest first. Items carry the sender, recipients and subject; retrieve one for its body.",
        "tags": [
          "Receiving emails"
        ],
        "x-docs-ids": [
          "list-received-emails"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Number of items to return, from 1 to 100. All received emails are returned when left out.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "Return items created before the item with this id (the next page). Cannot be combined with `before`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "description": "Return items created after the item with this id (the previous page). Cannot be combined with `after`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "from": {
                            "type": "string"
                          },
                          "to": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "subject": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "has_more": false,
                  "data": [
                    {
                      "id": "9b2f6c1e-4d8a-4f3b-a6e2-7c1d0e5f8a92",
                      "from": "Grace <grace@example.com>",
                      "to": [
                        "support@acme.com"
                      ],
                      "subject": "Question about my order",
                      "created_at": "2026-10-07T09:15:22.104871+00:00"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/emails/receiving/{email_id}": {
      "get": {
        "operationId": "retrieveReceivedEmail",
        "summary": "Retrieve received email",
        "description": "Get one received email with its HTML and text bodies, headers and attachments.\n\n- Returns 403 `email_above_quota` for mail that arrived while the team was over its quota: it is stored, but its content cannot be read.\n\n- send.io extension: `stored` is false when inbound routes matched and none of them stored the message (it is not listed and has no inbox thread, but can be retrieved and retried). `routing` lists each run of the routes (on receipt and on every retry) with the routes that matched and what each action did.",
        "tags": [
          "Receiving emails"
        ],
        "x-docs-ids": [
          "retrieve-received-email"
        ],
        "parameters": [
          {
            "name": "email_id",
            "in": "path",
            "required": true,
            "description": "The received email id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "html_format",
            "in": "query",
            "required": false,
            "description": "Only `cid` (inline images referenced by Content-ID) is available, which is also the default.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "from": {
                      "type": "string"
                    },
                    "to": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "cc": {
                      "type": "array"
                    },
                    "bcc": {
                      "type": "array"
                    },
                    "reply_to": {
                      "type": "array"
                    },
                    "received_for": {
                      "type": "string"
                    },
                    "message_id": {
                      "type": "string"
                    },
                    "subject": {
                      "type": "string"
                    },
                    "headers": {
                      "type": "object",
                      "properties": {
                        "x-mailer": {
                          "type": "string"
                        }
                      }
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "html": {
                      "type": "string"
                    },
                    "text": {
                      "type": "string"
                    },
                    "html_format": {
                      "type": "string"
                    },
                    "raw": {},
                    "attachments": {
                      "type": "array"
                    },
                    "stored": {
                      "type": "boolean"
                    },
                    "routing": {
                      "type": "array"
                    }
                  }
                },
                "example": {
                  "object": "email",
                  "id": "9b2f6c1e-4d8a-4f3b-a6e2-7c1d0e5f8a92",
                  "from": "Grace <grace@example.com>",
                  "to": [
                    "support@acme.com"
                  ],
                  "cc": [],
                  "bcc": [],
                  "reply_to": [],
                  "received_for": "support@acme.com",
                  "message_id": "<CAF3k2xyz@mail.example.com>",
                  "subject": "Question about my order",
                  "headers": {
                    "x-mailer": "Example Mail"
                  },
                  "created_at": "2026-10-07T09:15:22.104871+00:00",
                  "html": "<p>Hi, where is my order?</p>",
                  "text": "Hi, where is my order?",
                  "html_format": "cid",
                  "raw": null,
                  "attachments": [],
                  "stored": true,
                  "routing": []
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/emails/receiving/{email_id}/attachments": {
      "get": {
        "operationId": "listReceivedAttachments",
        "summary": "List received attachments",
        "description": "List the attachments of a received email. Each one has a signed download link valid for one hour.",
        "tags": [
          "Receiving emails"
        ],
        "x-docs-ids": [
          "list-received-attachments"
        ],
        "parameters": [
          {
            "name": "email_id",
            "in": "path",
            "required": true,
            "description": "The received email id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Number of items to return, from 1 to 100. All attachments are returned when left out.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "Return items created before the item with this id (the next page). Cannot be combined with `before`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "description": "Return items created after the item with this id (the previous page). Cannot be combined with `after`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "filename": {
                            "type": "string"
                          },
                          "size": {
                            "type": "number"
                          },
                          "content_type": {
                            "type": "string"
                          },
                          "content_disposition": {
                            "type": "string"
                          },
                          "content_id": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "download_url": {
                            "type": "string"
                          },
                          "expires_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "has_more": false,
                  "data": [
                    {
                      "id": "5c7e9a1b-3d2f-4e6a-8b0c-1f2e3d4c5b6a",
                      "filename": "receipt.pdf",
                      "size": 20311,
                      "content_type": "application/pdf",
                      "content_disposition": "attachment",
                      "content_id": null,
                      "download_url": "https://api.send.io/download/eyJ0Ijoi...",
                      "expires_at": "2026-10-07T10:15:22.104871Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/emails/receiving/{email_id}/retry": {
      "post": {
        "operationId": "retryReceivedEmail",
        "summary": "Retry inbound routes",
        "description": "Run the inbound routes again for a received email: `forward_url` actions deliver the message again (a new delivery), `forward_email` actions send it again, and a `store` action makes a forward-only message visible.\n\n- The body is optional. Each run is recorded in the email's `routing` (see Retrieve received email).",
        "tags": [
          "Receiving emails"
        ],
        "x-docs-ids": [
          "retry-received-email"
        ],
        "parameters": [
          {
            "name": "email_id",
            "in": "path",
            "required": true,
            "description": "The received email id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "route_id": {
                    "type": "string",
                    "description": "Run only this route's actions, whether it matches the message or not. Left out: every enabled route is evaluated again."
                  }
                }
              },
              "example": {
                "route_id": "6d2b9f4a-1c3e-4a5b-8d7f-0e9c8b7a6f5e"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "email_id": {
                      "type": "string"
                    },
                    "stored": {
                      "type": "boolean"
                    },
                    "routes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "actions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "route_id": {
                            "type": "string"
                          },
                          "action_id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string"
                          },
                          "format": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "delivery_id": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "inbound_retry",
                  "email_id": "9b2f6c1e-4d8a-4f3b-a6e2-7c1d0e5f8a92",
                  "stored": true,
                  "routes": [
                    "6d2b9f4a-1c3e-4a5b-8d7f-0e9c8b7a6f5e"
                  ],
                  "actions": [
                    {
                      "route_id": "6d2b9f4a-1c3e-4a5b-8d7f-0e9c8b7a6f5e",
                      "action_id": "1f0c2b7e-8a4d-4c1e-9b3a-5d6e7f8a9b0c",
                      "type": "forward_url",
                      "url": "https://acme.com/inbound",
                      "format": "sendio",
                      "status": "queued",
                      "delivery_id": "msg_2mR8vXq1bN4cT7yK0pL3sD9fG6h"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/emails/receiving/{email_id}/attachments/{attachment_id}": {
      "get": {
        "operationId": "retrieveReceivedAttachment",
        "summary": "Retrieve received attachment",
        "description": "Get one attachment of a received email, with a signed download link valid for one hour.",
        "tags": [
          "Receiving emails"
        ],
        "x-docs-ids": [
          "retrieve-received-attachment"
        ],
        "parameters": [
          {
            "name": "email_id",
            "in": "path",
            "required": true,
            "description": "The received email id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "attachment_id",
            "in": "path",
            "required": true,
            "description": "The attachment id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "filename": {
                      "type": "string"
                    },
                    "size": {
                      "type": "number"
                    },
                    "content_type": {
                      "type": "string"
                    },
                    "content_disposition": {
                      "type": "string"
                    },
                    "content_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "download_url": {
                      "type": "string"
                    },
                    "expires_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "object": "attachment",
                  "id": "5c7e9a1b-3d2f-4e6a-8b0c-1f2e3d4c5b6a",
                  "filename": "receipt.pdf",
                  "size": 20311,
                  "content_type": "application/pdf",
                  "content_disposition": "attachment",
                  "content_id": null,
                  "download_url": "https://api.send.io/download/eyJ0Ijoi...",
                  "expires_at": "2026-10-07T10:15:22.104871Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/inbound/routes": {
      "post": {
        "operationId": "createInboundRoute",
        "summary": "Create inbound route",
        "description": "Create a route. The response includes the signing secret used to sign `sendio` deliveries of its `forward_url` actions.\n\n- When no route matches, a message is stored as usual. When routes match, it is stored (inbox thread, Receiving emails list, `email.received` webhook) only if one of them has a `store` action.\n\n- forward_url deliveries use the webhook delivery system: success is any HTTP 2xx response (200 to 299), failures are retried with the same backoff (8 attempts over about 28 hours), and each delivery has a stable `svix-id`.\n\n- `sendio` payload: `{type: \"inbound.email\", created_at, data}` where data has `email_id`, `route`, `message_id`, `in_reply_to`, `references`, `from` and `to`/`cc`/`reply_to` (`{email, name}`), `subject`, `date`, `text`, `html`, `stripped_text`, `stripped_html`, `stripped_signature`, `headers` (`[{name, value}]` in order), `attachments` (`id`, `filename`, `content_type`, `content_disposition`, `content_id`, `size`, `sha256`, `content` in base64 when inline, `download_url` and `expires_at` always), `envelope` (`from`, `to`), `auth` (`spf`, `dkim`, `dmarc`, `results`), `spam` (`is_spam`, `verdict`, `score`, `reasons`), `size` and `received_at`.\n\n- forward_email re-sends the message from your team: From is the recipient address when its domain is a verified sending domain (else `forwarding@` your first one), Reply-To the original sender, with the `X-Sendio-Forwarded-Id` header and the tag `inbound_forward`. Mail that send.io forwarded already, or sent to the target itself, is not forwarded again. It counts toward your sending quota.\n\n- A team can have up to 100 routes.",
        "tags": [
          "Inbound routes"
        ],
        "x-docs-ids": [
          "create-inbound-route"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "match": {
                    "type": "object",
                    "description": "When the route applies. Every condition given must hold. `recipient`: an address or glob (`support@acme.com`, `*@acme.com`; `*` and `?`, case-insensitive). `recipient_regex`: a regular expression (RE2, case-insensitive). A recipient condition holds when any recipient of the message at your domains matches.",
                    "properties": {
                      "header": {
                        "type": "object",
                        "description": "`{name, pattern}` (glob) or `{name, regex}`: holds when any value of that header matches."
                      },
                      "catch_all": {
                        "type": "boolean",
                        "description": "`true` matches every message. Cannot be combined with other conditions."
                      },
                      "recipient": {
                        "type": "string"
                      }
                    }
                  },
                  "actions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "description": "`forward_url`, `forward_email`, `store` or `stop`. `stop` must be last: no later route runs."
                        },
                        "url": {
                          "type": "string",
                          "description": "forward_url: public HTTPS URL that receives the message."
                        },
                        "format": {
                          "type": "string",
                          "description": "forward_url: payload format. `sendio` (default): the JSON below, signed with `svix-*` headers using the route's signing secret. Provider inbound formats are added as the compatible APIs ship them."
                        },
                        "options": {
                          "type": "object",
                          "description": "forward_url: `basic_auth` ({username, password}) or `bearer_token`, `backup_endpoint`, `backup_after_attempts`, `backup_basic_auth` (as for webhooks), and for `sendio` `attachments`: `auto` (content inline up to 2 MB each, 10 MB per message, download links for larger ones; default) or `url` (links only). Secrets are stored encrypted and returned as `********`.",
                          "properties": {
                            "basic_auth": {
                              "type": "object",
                              "properties": {
                                "username": {
                                  "type": "string"
                                },
                                "password": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        },
                        "headers": {
                          "type": "object",
                          "description": "forward_url: custom request headers, as for webhooks."
                        },
                        "address": {
                          "type": "string",
                          "description": "forward_email: the address the message is re-sent to."
                        }
                      },
                      "required": [
                        "type"
                      ]
                    },
                    "description": "1 to 10 actions, run in order."
                  },
                  "priority": {
                    "type": "number",
                    "description": "0 to 1000000, lower runs first. Default 0."
                  },
                  "description": {
                    "type": "string",
                    "description": "Up to 500 characters."
                  },
                  "enabled": {
                    "type": "boolean",
                    "description": "Default true. Disabled routes are skipped."
                  }
                },
                "required": [
                  "match",
                  "actions"
                ]
              },
              "example": {
                "priority": 10,
                "description": "Support mail to the helpdesk",
                "match": {
                  "recipient": "support@acme.com"
                },
                "actions": [
                  {
                    "type": "forward_url",
                    "url": "https://acme.com/inbound",
                    "options": {
                      "basic_auth": {
                        "username": "sendio",
                        "password": "s3cret"
                      }
                    }
                  },
                  {
                    "type": "store"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "priority": {
                      "type": "number"
                    },
                    "description": {
                      "type": "string"
                    },
                    "enabled": {
                      "type": "boolean"
                    },
                    "match": {
                      "type": "object",
                      "properties": {
                        "recipient": {
                          "type": "string"
                        }
                      }
                    },
                    "actions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string"
                          },
                          "format": {
                            "type": "string"
                          },
                          "options": {
                            "type": "object",
                            "properties": {
                              "basic_auth": {
                                "type": "object",
                                "properties": {
                                  "username": {
                                    "type": "string"
                                  },
                                  "password": {
                                    "type": "string"
                                  }
                                }
                              }
                            }
                          },
                          "headers": {
                            "type": "object"
                          }
                        }
                      }
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "signing_secret": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "object": "inbound_route",
                  "id": "6d2b9f4a-1c3e-4a5b-8d7f-0e9c8b7a6f5e",
                  "priority": 10,
                  "description": "Support mail to the helpdesk",
                  "enabled": true,
                  "match": {
                    "recipient": "support@acme.com"
                  },
                  "actions": [
                    {
                      "id": "1f0c2b7e-8a4d-4c1e-9b3a-5d6e7f8a9b0c",
                      "type": "forward_url",
                      "url": "https://acme.com/inbound",
                      "format": "sendio",
                      "options": {
                        "basic_auth": {
                          "username": "sendio",
                          "password": "********"
                        }
                      },
                      "headers": {}
                    },
                    {
                      "id": "7a8b9c0d-1e2f-4a3b-8c4d-5e6f7a8b9c0d",
                      "type": "store"
                    }
                  ],
                  "created_at": "2026-10-07T09:00:00.000000+00:00",
                  "updated_at": "2026-10-07T09:00:00.000000+00:00",
                  "signing_secret": "whsec_aW5ib3VuZC1yb3V0ZS1zZWNyZXQtZXhhbXBsZQ=="
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "get": {
        "operationId": "listInboundRoutes",
        "summary": "List inbound routes",
        "description": "List every route in the order they run (priority, then creation time). Signing secrets are left out.",
        "tags": [
          "Inbound routes"
        ],
        "x-docs-ids": [
          "list-inbound-routes"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "object": {
                            "type": "string"
                          },
                          "id": {
                            "type": "string"
                          },
                          "priority": {
                            "type": "number"
                          },
                          "description": {
                            "type": "string"
                          },
                          "enabled": {
                            "type": "boolean"
                          },
                          "match": {
                            "type": "object",
                            "properties": {
                              "recipient": {
                                "type": "string"
                              }
                            }
                          },
                          "actions": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "type": {
                                  "type": "string"
                                },
                                "url": {
                                  "type": "string"
                                },
                                "format": {
                                  "type": "string"
                                },
                                "options": {
                                  "type": "object",
                                  "properties": {
                                    "basic_auth": {
                                      "type": "object",
                                      "properties": {
                                        "username": {
                                          "type": "string"
                                        },
                                        "password": {
                                          "type": "string"
                                        }
                                      }
                                    }
                                  }
                                },
                                "headers": {
                                  "type": "object"
                                }
                              }
                            }
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updated_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "has_more": false,
                  "data": [
                    {
                      "object": "inbound_route",
                      "id": "6d2b9f4a-1c3e-4a5b-8d7f-0e9c8b7a6f5e",
                      "priority": 10,
                      "description": "Support mail to the helpdesk",
                      "enabled": true,
                      "match": {
                        "recipient": "support@acme.com"
                      },
                      "actions": [
                        {
                          "id": "1f0c2b7e-8a4d-4c1e-9b3a-5d6e7f8a9b0c",
                          "type": "forward_url",
                          "url": "https://acme.com/inbound",
                          "format": "sendio",
                          "options": {
                            "basic_auth": {
                              "username": "sendio",
                              "password": "********"
                            }
                          },
                          "headers": {}
                        },
                        {
                          "id": "7a8b9c0d-1e2f-4a3b-8c4d-5e6f7a8b9c0d",
                          "type": "store"
                        }
                      ],
                      "created_at": "2026-10-07T09:00:00.000000+00:00",
                      "updated_at": "2026-10-07T09:00:00.000000+00:00"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/inbound/routes/{route_id}": {
      "get": {
        "operationId": "retrieveInboundRoute",
        "summary": "Retrieve inbound route",
        "description": "Get one route, including its signing secret.",
        "tags": [
          "Inbound routes"
        ],
        "x-docs-ids": [
          "retrieve-inbound-route"
        ],
        "parameters": [
          {
            "name": "route_id",
            "in": "path",
            "required": true,
            "description": "The route id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "priority": {
                      "type": "number"
                    },
                    "description": {
                      "type": "string"
                    },
                    "enabled": {
                      "type": "boolean"
                    },
                    "match": {
                      "type": "object",
                      "properties": {
                        "recipient": {
                          "type": "string"
                        }
                      }
                    },
                    "actions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string"
                          },
                          "format": {
                            "type": "string"
                          },
                          "options": {
                            "type": "object",
                            "properties": {
                              "basic_auth": {
                                "type": "object",
                                "properties": {
                                  "username": {
                                    "type": "string"
                                  },
                                  "password": {
                                    "type": "string"
                                  }
                                }
                              }
                            }
                          },
                          "headers": {
                            "type": "object"
                          }
                        }
                      }
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "signing_secret": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "object": "inbound_route",
                  "id": "6d2b9f4a-1c3e-4a5b-8d7f-0e9c8b7a6f5e",
                  "priority": 10,
                  "description": "Support mail to the helpdesk",
                  "enabled": true,
                  "match": {
                    "recipient": "support@acme.com"
                  },
                  "actions": [
                    {
                      "id": "1f0c2b7e-8a4d-4c1e-9b3a-5d6e7f8a9b0c",
                      "type": "forward_url",
                      "url": "https://acme.com/inbound",
                      "format": "sendio",
                      "options": {
                        "basic_auth": {
                          "username": "sendio",
                          "password": "********"
                        }
                      },
                      "headers": {}
                    },
                    {
                      "id": "7a8b9c0d-1e2f-4a3b-8c4d-5e6f7a8b9c0d",
                      "type": "store"
                    }
                  ],
                  "created_at": "2026-10-07T09:00:00.000000+00:00",
                  "updated_at": "2026-10-07T09:00:00.000000+00:00",
                  "signing_secret": "whsec_aW5ib3VuZC1yb3V0ZS1zZWNyZXQtZXhhbXBsZQ=="
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "patch": {
        "operationId": "updateInboundRoute",
        "summary": "Update inbound route",
        "description": "Change a route. Fields given replace the stored ones; `actions` replaces the whole list.",
        "tags": [
          "Inbound routes"
        ],
        "x-docs-ids": [
          "update-inbound-route"
        ],
        "parameters": [
          {
            "name": "route_id",
            "in": "path",
            "required": true,
            "description": "The route id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "priority": {
                    "type": "number",
                    "description": "0 to 1000000, lower runs first."
                  },
                  "description": {
                    "type": "string",
                    "description": "Up to 500 characters."
                  },
                  "enabled": {
                    "type": "boolean",
                    "description": "Disabled routes are skipped."
                  },
                  "match": {
                    "type": "object",
                    "description": "Replaces the match (see Create inbound route)."
                  },
                  "actions": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    },
                    "description": "Replaces the actions. Send an action's `id` back to keep it (and its masked secrets, sent back as `********`); actions without an id are new."
                  }
                }
              },
              "example": {
                "enabled": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "priority": {
                      "type": "number"
                    },
                    "description": {
                      "type": "string"
                    },
                    "enabled": {
                      "type": "boolean"
                    },
                    "match": {
                      "type": "object",
                      "properties": {
                        "recipient": {
                          "type": "string"
                        }
                      }
                    },
                    "actions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string"
                          },
                          "format": {
                            "type": "string"
                          },
                          "options": {
                            "type": "object",
                            "properties": {
                              "basic_auth": {
                                "type": "object",
                                "properties": {
                                  "username": {
                                    "type": "string"
                                  },
                                  "password": {
                                    "type": "string"
                                  }
                                }
                              }
                            }
                          },
                          "headers": {
                            "type": "object"
                          }
                        }
                      }
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "object": "inbound_route",
                  "id": "6d2b9f4a-1c3e-4a5b-8d7f-0e9c8b7a6f5e",
                  "priority": 10,
                  "description": "Support mail to the helpdesk",
                  "enabled": true,
                  "match": {
                    "recipient": "support@acme.com"
                  },
                  "actions": [
                    {
                      "id": "1f0c2b7e-8a4d-4c1e-9b3a-5d6e7f8a9b0c",
                      "type": "forward_url",
                      "url": "https://acme.com/inbound",
                      "format": "sendio",
                      "options": {
                        "basic_auth": {
                          "username": "sendio",
                          "password": "********"
                        }
                      },
                      "headers": {}
                    },
                    {
                      "id": "7a8b9c0d-1e2f-4a3b-8c4d-5e6f7a8b9c0d",
                      "type": "store"
                    }
                  ],
                  "created_at": "2026-10-07T09:00:00.000000+00:00",
                  "updated_at": "2026-10-07T09:00:00.000000+00:00"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "delete": {
        "operationId": "deleteInboundRoute",
        "summary": "Delete inbound route",
        "description": "Delete a route. Deliveries still waiting for a retry are dropped.",
        "tags": [
          "Inbound routes"
        ],
        "x-docs-ids": [
          "delete-inbound-route"
        ],
        "parameters": [
          {
            "name": "route_id",
            "in": "path",
            "required": true,
            "description": "The route id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "deleted": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "object": "inbound_route",
                  "id": "6d2b9f4a-1c3e-4a5b-8d7f-0e9c8b7a6f5e",
                  "deleted": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/inbound/routes/test": {
      "post": {
        "operationId": "testInboundRoutes",
        "summary": "Test inbound routes",
        "description": "Show which routes a message with these recipients and headers would match, the actions that would run, and whether it would be stored. Nothing is sent.",
        "tags": [
          "Inbound routes"
        ],
        "x-docs-ids": [
          "test-inbound-routes"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "recipient": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "The recipient address (or `recipients`, a list)."
                  },
                  "headers": {
                    "type": "object",
                    "description": "Headers of the sample message, as `{name: value}` or `{name: [values]}`.",
                    "properties": {
                      "X-Priority": {
                        "type": "string"
                      }
                    }
                  }
                },
                "required": [
                  "recipient"
                ]
              },
              "example": {
                "recipient": "support@acme.com",
                "headers": {
                  "X-Priority": "urgent"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "matched": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "object": {
                            "type": "string"
                          },
                          "id": {
                            "type": "string"
                          },
                          "priority": {
                            "type": "number"
                          },
                          "description": {
                            "type": "string"
                          },
                          "enabled": {
                            "type": "boolean"
                          },
                          "match": {
                            "type": "object",
                            "properties": {
                              "recipient": {
                                "type": "string"
                              }
                            }
                          },
                          "actions": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "type": {
                                  "type": "string"
                                },
                                "url": {
                                  "type": "string"
                                },
                                "format": {
                                  "type": "string"
                                },
                                "options": {
                                  "type": "object",
                                  "properties": {
                                    "basic_auth": {
                                      "type": "object",
                                      "properties": {
                                        "username": {
                                          "type": "string"
                                        },
                                        "password": {
                                          "type": "string"
                                        }
                                      }
                                    }
                                  }
                                },
                                "headers": {
                                  "type": "object"
                                }
                              }
                            }
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updated_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    },
                    "actions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "route_id": {
                            "type": "string"
                          },
                          "action_id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string"
                          },
                          "format": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "stored": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "object": "inbound_route_test",
                  "matched": [
                    {
                      "object": "inbound_route",
                      "id": "6d2b9f4a-1c3e-4a5b-8d7f-0e9c8b7a6f5e",
                      "priority": 10,
                      "description": "Support mail to the helpdesk",
                      "enabled": true,
                      "match": {
                        "recipient": "support@acme.com"
                      },
                      "actions": [
                        {
                          "id": "1f0c2b7e-8a4d-4c1e-9b3a-5d6e7f8a9b0c",
                          "type": "forward_url",
                          "url": "https://acme.com/inbound",
                          "format": "sendio",
                          "options": {
                            "basic_auth": {
                              "username": "sendio",
                              "password": "********"
                            }
                          },
                          "headers": {}
                        },
                        {
                          "id": "7a8b9c0d-1e2f-4a3b-8c4d-5e6f7a8b9c0d",
                          "type": "store"
                        }
                      ],
                      "created_at": "2026-10-07T09:00:00.000000+00:00",
                      "updated_at": "2026-10-07T09:00:00.000000+00:00"
                    }
                  ],
                  "actions": [
                    {
                      "route_id": "6d2b9f4a-1c3e-4a5b-8d7f-0e9c8b7a6f5e",
                      "action_id": "1f0c2b7e-8a4d-4c1e-9b3a-5d6e7f8a9b0c",
                      "type": "forward_url",
                      "url": "https://acme.com/inbound",
                      "format": "sendio"
                    }
                  ],
                  "stored": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/inbound/routes/{route_id}/deliveries": {
      "get": {
        "operationId": "listInboundDeliveries",
        "summary": "List route deliveries",
        "description": "List the route's `forward_url` deliveries, newest first, with their status (`pending`, `success`, `failed`).",
        "tags": [
          "Inbound routes"
        ],
        "x-docs-ids": [
          "list-inbound-deliveries"
        ],
        "parameters": [
          {
            "name": "route_id",
            "in": "path",
            "required": true,
            "description": "The route id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Number of items to return, from 1 to 100. Default 20.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "Return items created before the item with this id (the next page). Cannot be combined with `before`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "object": {
                            "type": "string"
                          },
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "status": {
                            "type": "string"
                          },
                          "next_attempt_at": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date-time"
                          },
                          "email_id": {
                            "type": "string"
                          },
                          "action_id": {
                            "type": "string"
                          },
                          "payload": {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string"
                              },
                              "data": {
                                "type": "object",
                                "properties": {
                                  "email_id": {
                                    "type": "string"
                                  },
                                  "route_id": {
                                    "type": "string"
                                  },
                                  "action_id": {
                                    "type": "string"
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "has_more": false,
                  "data": [
                    {
                      "object": "inbound_delivery",
                      "id": "msg_2mR8vXq1bN4cT7yK0pL3sD9fG6h",
                      "type": "inbound.email",
                      "created_at": "2026-10-07T09:15:22.511000Z",
                      "status": "success",
                      "next_attempt_at": null,
                      "email_id": "9b2f6c1e-4d8a-4f3b-a6e2-7c1d0e5f8a92",
                      "action_id": "1f0c2b7e-8a4d-4c1e-9b3a-5d6e7f8a9b0c",
                      "payload": {
                        "type": "inbound.email",
                        "data": {
                          "email_id": "9b2f6c1e-4d8a-4f3b-a6e2-7c1d0e5f8a92",
                          "route_id": "6d2b9f4a-1c3e-4a5b-8d7f-0e9c8b7a6f5e",
                          "action_id": "1f0c2b7e-8a4d-4c1e-9b3a-5d6e7f8a9b0c"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/inbound/routes/{route_id}/deliveries/{delivery_id}": {
      "get": {
        "operationId": "retrieveInboundDelivery",
        "summary": "Retrieve route delivery",
        "description": "Get one `forward_url` delivery of the route, with its status and the payload that was posted.",
        "tags": [
          "Inbound routes"
        ],
        "x-docs-ids": [
          "retrieve-inbound-delivery"
        ],
        "parameters": [
          {
            "name": "route_id",
            "in": "path",
            "required": true,
            "description": "The route id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "delivery_id",
            "in": "path",
            "required": true,
            "description": "The delivery id (msg_...).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "next_attempt_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "When the next retry is due while the delivery is `pending`, or null.",
                      "format": "date-time"
                    },
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "status": {
                      "type": "string"
                    },
                    "email_id": {
                      "type": "string"
                    },
                    "action_id": {
                      "type": "string"
                    },
                    "payload": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string"
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "email_id": {
                              "type": "string"
                            },
                            "route_id": {
                              "type": "string"
                            },
                            "action_id": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "inbound_delivery",
                  "id": "msg_2mR8vXq1bN4cT7yK0pL3sD9fG6h",
                  "type": "inbound.email",
                  "created_at": "2026-10-07T09:15:22.511000Z",
                  "status": "success",
                  "next_attempt_at": null,
                  "email_id": "9b2f6c1e-4d8a-4f3b-a6e2-7c1d0e5f8a92",
                  "action_id": "1f0c2b7e-8a4d-4c1e-9b3a-5d6e7f8a9b0c",
                  "payload": {
                    "type": "inbound.email",
                    "data": {
                      "email_id": "9b2f6c1e-4d8a-4f3b-a6e2-7c1d0e5f8a92",
                      "route_id": "6d2b9f4a-1c3e-4a5b-8d7f-0e9c8b7a6f5e",
                      "action_id": "1f0c2b7e-8a4d-4c1e-9b3a-5d6e7f8a9b0c"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/inbound/routes/{route_id}/deliveries/{delivery_id}/attempts": {
      "get": {
        "operationId": "listInboundDeliveryAttempts",
        "summary": "List delivery attempts",
        "description": "List the HTTP attempts of one delivery, newest first. `GET /inbound/routes/{route_id}/deliveries/{delivery_id}` returns the delivery itself.",
        "tags": [
          "Inbound routes"
        ],
        "x-docs-ids": [
          "list-inbound-delivery-attempts"
        ],
        "parameters": [
          {
            "name": "route_id",
            "in": "path",
            "required": true,
            "description": "The route id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "delivery_id",
            "in": "path",
            "required": true,
            "description": "The delivery id (msg_...).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Number of items to return, from 1 to 100. Default 20.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "Return items created before the item with this id (the next page). Cannot be combined with `before`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "http_status_code": {
                            "type": "number"
                          },
                          "response": {
                            "type": "string"
                          },
                          "sent_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "has_more": false,
                  "data": [
                    {
                      "id": "atmpt_2mR8w0aZ3cV5eX7gI9kM1oQ3sU",
                      "http_status_code": 200,
                      "response": "ok",
                      "sent_at": "2026-10-07T09:15:23.004000Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/domains": {
      "post": {
        "operationId": "createDomain",
        "summary": "Create domain",
        "description": "Add a domain. The response lists the DNS records to add at your DNS provider. Verification starts right away and has a 72 hour deadline.\n\n- send.io extensions: `receiving`, `open_tracking`, `click_tracking`, `tracking_subdomain`, plus extra response fields (`tracking_status`, `dns_provider`, `verification_deadline_at`, `events`, ...).\n\n- The domain limit depends on your plan. Over the limit returns 422 \"The domain limit for this plan has been reached.\"\n\n- At most 5 domains can wait for verification at once, whatever the plan. A sixth returns 422 \"At most 5 domains can wait for verification at once. Verify or delete one before adding another.\" Verified domains do not count.\n\n- A domain already in your workspace returns 409 `resource_locked` naming it. A domain verified in another workspace returns 409 `resource_locked`.\n\n- A domain another workspace added but never verified does not block you: the first request returns 409 `domain_ownership_required` with a TXT record to publish (name `_sendio.<domain>`, value `sendio-verification=...`). Publish it and send the same request again: the other workspace's unverified domain is removed and yours is added.\n\n- Options send.io cannot apply (an unknown capability, sending disabled, enforced TLS) return 422 instead of being ignored.\n\n- Receiving asks for an MX record on the domain. The MX value is the same for every domain, so use a subdomain such as `inbound.acme.com` if the domain already receives mail elsewhere.\n\n- Records you are asked to add depend on the domain's setup; always copy them from the response.",
        "tags": [
          "Domains"
        ],
        "x-docs-ids": [
          "create-domain"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Domain name, such as `acme.com` or `mail.acme.com`. Labels that start with `xn--` must be valid punycode."
                  },
                  "region": {
                    "type": "string",
                    "description": "Sending region: `us-east-1` (default), `eu-west-1`, `sa-east-1` or `ap-northeast-1`."
                  },
                  "custom_return_path": {
                    "type": "string",
                    "description": "Subdomain used for the return path (bounce) address. One DNS label: starts with a letter, then letters, digits and dashes, up to 63 characters. Capitals are lowercased. Default `send`. It cannot be changed later."
                  },
                  "receiving": {
                    "type": "boolean",
                    "description": "Also receive mail on this domain. Adds an MX record to set up. Default false."
                  },
                  "capabilities": {
                    "type": "object",
                    "description": "Resend's form of the same: `{ sending: \"enabled\", receiving: \"enabled\" | \"disabled\" }`. Sending cannot be disabled."
                  },
                  "tls": {
                    "type": "string",
                    "description": "`opportunistic` (default). `enforced` is not available yet and returns 422."
                  },
                  "open_tracking": {
                    "type": "boolean",
                    "description": "Track opens for email sent from this domain."
                  },
                  "click_tracking": {
                    "type": "boolean",
                    "description": "Track link clicks for email sent from this domain."
                  },
                  "tracking_subdomain": {
                    "type": "string",
                    "description": "Subdomain used for tracking links, such as `links`. A single DNS label. Adds a CNAME record to set up. Left out while `open_tracking` or `click_tracking` is true, it defaults to `links` (`track` when the return path is `links`): opens and clicks are only counted through a tracking subdomain."
                  }
                },
                "required": [
                  "name"
                ]
              },
              "example": {
                "name": "acme.com",
                "region": "us-east-1",
                "click_tracking": true,
                "tracking_subdomain": "links"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "dns_provider": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The DNS provider the domain's zone is hosted at, when send.io recognises it."
                    },
                    "dns_zone": {
                      "type": "string",
                      "description": "The DNS zone the domain lives in. Record `host` values are relative to it."
                    },
                    "dns_zone_detected": {
                      "type": "boolean",
                      "description": "Whether send.io found the zone in DNS. When false, `dns_zone` is the domain name itself and record names are given in full."
                    },
                    "verification_deadline_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "When verification gives up, or null when no check is running.",
                      "format": "date-time"
                    },
                    "last_checked_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "When the DNS records were last checked, by verify or automatically, or null before the first check.",
                      "format": "date-time"
                    },
                    "tracking_subdomain": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The branded tracking subdomain, or null."
                    },
                    "sending_setup": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "Null in the usual case. Set while the domain's DNS records are all found but send.io has not finished its own sending set-up for it: `{ status, message }`, where `status` is `retrying` (we are trying again, nothing to do) or `needs_attention` (contact support), and `message` says the same in words. The domain stays `pending` and is not removed at `verification_deadline_at` while this is set."
                    },
                    "records": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string",
                            "description": "The record name relative to the domain (`@` for the domain itself)."
                          },
                          "host": {
                            "type": "string",
                            "description": "The record name relative to `dns_zone`: what you type into your DNS provider."
                          },
                          "full_name": {
                            "type": "string",
                            "description": "The complete record name."
                          },
                          "priority": {
                            "type": "number",
                            "description": "MX records only."
                          },
                          "record": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "value": {
                            "type": "string"
                          },
                          "ttl": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "region": {
                      "type": "string"
                    },
                    "open_tracking": {
                      "type": "boolean"
                    },
                    "click_tracking": {
                      "type": "boolean"
                    },
                    "tracking_status": {
                      "type": "string"
                    },
                    "custom_return_path": {
                      "type": "string"
                    },
                    "delivery_route": {
                      "type": "string"
                    },
                    "tls": {
                      "type": "string"
                    },
                    "capabilities": {
                      "type": "object",
                      "properties": {
                        "sending": {
                          "type": "string"
                        },
                        "receiving": {
                          "type": "string"
                        }
                      }
                    },
                    "events": {
                      "type": "array"
                    }
                  }
                },
                "example": {
                  "id": "d91cd9bd-1176-453e-8fc1-35364d380206",
                  "name": "acme.com",
                  "status": "pending",
                  "created_at": "2026-10-07T09:12:44.512318+00:00",
                  "region": "us-east-1",
                  "open_tracking": false,
                  "click_tracking": false,
                  "tracking_subdomain": null,
                  "tracking_status": "off",
                  "custom_return_path": "send",
                  "delivery_route": "ses",
                  "tls": "opportunistic",
                  "dns_provider": "cloudflare",
                  "dns_zone": "acme.com",
                  "dns_zone_detected": true,
                  "verification_deadline_at": "2026-10-10T09:12:44.512318+00:00",
                  "capabilities": {
                    "sending": "enabled",
                    "receiving": "disabled"
                  },
                  "sending_setup": null,
                  "records": [
                    {
                      "record": "DKIM",
                      "type": "CNAME",
                      "name": "mx1._domainkey",
                      "host": "mx1._domainkey",
                      "full_name": "mx1._domainkey.acme.com",
                      "value": "0028814c2802.dkim.send.io",
                      "ttl": "Auto",
                      "status": "not_started"
                    },
                    {
                      "record": "SPF",
                      "type": "CNAME",
                      "name": "send",
                      "host": "send",
                      "full_name": "send.acme.com",
                      "value": "rp.send.io",
                      "ttl": "Auto",
                      "status": "not_started"
                    },
                    {
                      "record": "DMARC",
                      "type": "TXT",
                      "name": "_dmarc",
                      "host": "_dmarc",
                      "full_name": "_dmarc.acme.com",
                      "value": "v=DMARC1; p=none;",
                      "ttl": "Auto",
                      "status": "not_started"
                    }
                  ],
                  "events": []
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "get": {
        "operationId": "listDomains",
        "summary": "List domains",
        "description": "List your domains, newest first. Records are not included; retrieve a domain to get them.",
        "tags": [
          "Domains"
        ],
        "x-docs-ids": [
          "list-domains"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Number of items to return, from 1 to 100. All domains are returned when left out.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "Return items created before the item with this id (the next page). Cannot be combined with `before`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "description": "Return items created after the item with this id (the previous page). Cannot be combined with `after`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "dns_provider": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The DNS provider the domain's zone is hosted at, when send.io recognises it."
                          },
                          "dns_zone": {
                            "type": "string",
                            "description": "The DNS zone the domain lives in. Record `host` values are relative to it."
                          },
                          "dns_zone_detected": {
                            "type": "boolean",
                            "description": "Whether send.io found the zone in DNS. When false, `dns_zone` is the domain name itself and record names are given in full."
                          },
                          "verification_deadline_at": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "When verification gives up, or null when no check is running.",
                            "format": "date-time"
                          },
                          "last_checked_at": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "When the DNS records were last checked, by verify or automatically, or null before the first check.",
                            "format": "date-time"
                          },
                          "tracking_subdomain": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The branded tracking subdomain, or null."
                          },
                          "sending_setup": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "description": "Null in the usual case. Set while the domain's DNS records are all found but send.io has not finished its own sending set-up for it: `{ status, message }`, where `status` is `retrying` (we are trying again, nothing to do) or `needs_attention` (contact support), and `message` says the same in words. The domain stays `pending` and is not removed at `verification_deadline_at` while this is set."
                          },
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "region": {
                            "type": "string"
                          },
                          "open_tracking": {
                            "type": "boolean"
                          },
                          "click_tracking": {
                            "type": "boolean"
                          },
                          "tracking_status": {
                            "type": "string"
                          },
                          "custom_return_path": {
                            "type": "string"
                          },
                          "delivery_route": {
                            "type": "string"
                          },
                          "tls": {
                            "type": "string"
                          },
                          "capabilities": {
                            "type": "object",
                            "properties": {
                              "sending": {
                                "type": "string"
                              },
                              "receiving": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    },
                    "object": {
                      "type": "string"
                    },
                    "has_more": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "has_more": false,
                  "data": [
                    {
                      "id": "d91cd9bd-1176-453e-8fc1-35364d380206",
                      "name": "acme.com",
                      "status": "pending",
                      "created_at": "2026-10-07T09:12:44.512318+00:00",
                      "region": "us-east-1",
                      "open_tracking": false,
                      "click_tracking": false,
                      "tracking_subdomain": null,
                      "tracking_status": "off",
                      "custom_return_path": "send",
                      "delivery_route": "ses",
                      "tls": "opportunistic",
                      "dns_provider": "cloudflare",
                      "dns_zone": "acme.com",
                      "dns_zone_detected": true,
                      "verification_deadline_at": "2026-10-10T09:12:44.512318+00:00",
                      "capabilities": {
                        "sending": "enabled",
                        "receiving": "disabled"
                      },
                      "sending_setup": null
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/domains/{domain_id}": {
      "get": {
        "operationId": "retrieveDomain",
        "summary": "Retrieve domain",
        "description": "Get one domain with its DNS records, their status, and its setup history.\n\n- Domain `status` is one of not_started, pending, verified, partially_verified, failed, temporary_failure.\n\n- Each record has a `status` and, once checked, `found` (the value we saw in DNS) and `last_checked_at`. The domain's `last_checked_at` is the last check of any kind; open domains are checked automatically every minute.\n\n- A domain added again after a delete gets a new DKIM value: its `events` include `domain.added_again`. Replace the old DKIM record in your DNS.\n\n- `name` is relative to the domain. `full_name` is the complete record name, and `host` is the name relative to `dns_zone`, the DNS zone the domain lives in. For a subdomain such as `mail.acme.com` in the zone `acme.com`, the return path has name `send` and host `send.mail`. Type `host` into your DNS provider.",
        "tags": [
          "Domains"
        ],
        "x-docs-ids": [
          "retrieve-domain"
        ],
        "parameters": [
          {
            "name": "domain_id",
            "in": "path",
            "required": true,
            "description": "The domain id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "dns_provider": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The DNS provider the domain's zone is hosted at, when send.io recognises it."
                    },
                    "dns_zone": {
                      "type": "string",
                      "description": "The DNS zone the domain lives in. Record `host` values are relative to it."
                    },
                    "dns_zone_detected": {
                      "type": "boolean",
                      "description": "Whether send.io found the zone in DNS. When false, `dns_zone` is the domain name itself and record names are given in full."
                    },
                    "verification_deadline_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "When verification gives up, or null when no check is running.",
                      "format": "date-time"
                    },
                    "last_checked_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "When the DNS records were last checked, by verify or automatically, or null before the first check.",
                      "format": "date-time"
                    },
                    "tracking_subdomain": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The branded tracking subdomain, or null."
                    },
                    "sending_setup": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "Null in the usual case. Set while the domain's DNS records are all found but send.io has not finished its own sending set-up for it: `{ status, message }`, where `status` is `retrying` (we are trying again, nothing to do) or `needs_attention` (contact support), and `message` says the same in words. The domain stays `pending` and is not removed at `verification_deadline_at` while this is set."
                    },
                    "records": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string",
                            "description": "The record name relative to the domain (`@` for the domain itself)."
                          },
                          "host": {
                            "type": "string",
                            "description": "The record name relative to `dns_zone`: what you type into your DNS provider."
                          },
                          "full_name": {
                            "type": "string",
                            "description": "The complete record name."
                          },
                          "priority": {
                            "type": "number",
                            "description": "MX records only."
                          },
                          "record": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "value": {
                            "type": "string"
                          },
                          "ttl": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "last_checked_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    },
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "region": {
                      "type": "string"
                    },
                    "open_tracking": {
                      "type": "boolean"
                    },
                    "click_tracking": {
                      "type": "boolean"
                    },
                    "tracking_status": {
                      "type": "string"
                    },
                    "custom_return_path": {
                      "type": "string"
                    },
                    "delivery_route": {
                      "type": "string"
                    },
                    "tls": {
                      "type": "string"
                    },
                    "capabilities": {
                      "type": "object",
                      "properties": {
                        "sending": {
                          "type": "string"
                        },
                        "receiving": {
                          "type": "string"
                        }
                      }
                    },
                    "events": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "event": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "domain",
                  "id": "d91cd9bd-1176-453e-8fc1-35364d380206",
                  "name": "acme.com",
                  "status": "pending",
                  "created_at": "2026-10-07T09:12:44.512318+00:00",
                  "region": "us-east-1",
                  "open_tracking": false,
                  "click_tracking": false,
                  "tracking_subdomain": null,
                  "tracking_status": "off",
                  "custom_return_path": "send",
                  "delivery_route": "ses",
                  "tls": "opportunistic",
                  "dns_provider": "cloudflare",
                  "dns_zone": "acme.com",
                  "dns_zone_detected": true,
                  "verification_deadline_at": "2026-10-10T09:12:44.512318+00:00",
                  "capabilities": {
                    "sending": "enabled",
                    "receiving": "disabled"
                  },
                  "sending_setup": null,
                  "records": [
                    {
                      "record": "DKIM",
                      "type": "CNAME",
                      "name": "mx1._domainkey",
                      "host": "mx1._domainkey",
                      "full_name": "mx1._domainkey.acme.com",
                      "value": "0028814c2802.dkim.send.io",
                      "ttl": "Auto",
                      "status": "not_started",
                      "last_checked_at": "2026-10-07T09:20:01.338412+00:00"
                    },
                    {
                      "record": "SPF",
                      "type": "CNAME",
                      "name": "send",
                      "host": "send",
                      "full_name": "send.acme.com",
                      "value": "rp.send.io",
                      "ttl": "Auto",
                      "status": "not_started",
                      "last_checked_at": "2026-10-07T09:20:01.338412+00:00"
                    },
                    {
                      "record": "DMARC",
                      "type": "TXT",
                      "name": "_dmarc",
                      "host": "_dmarc",
                      "full_name": "_dmarc.acme.com",
                      "value": "v=DMARC1; p=none;",
                      "ttl": "Auto",
                      "status": "not_started",
                      "last_checked_at": "2026-10-07T09:20:01.338412+00:00"
                    }
                  ],
                  "events": [
                    {
                      "event": "domain.created",
                      "created_at": "2026-10-07T09:12:44.512318+00:00"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "patch": {
        "operationId": "updateDomain",
        "summary": "Update domain",
        "description": "Change a domain's tracking, TLS and receiving settings. Only the fields you send are changed.\n\n- send.io extension: `tracking_subdomain` sets up a branded tracking host with its own certificate. Track its progress in `tracking_status` (off, pending, active, failed).\n\n- Receiving off: email to the domain is refused right away and its MX record is no longer required (a domain waiting only for it becomes verified). Remove the MX record pointing at send.io from your DNS.\n\n- Receiving on: the domain asks for its MX record (publish it to receive email); a domain whose MX record is already published is verified again at the next check.\n\n- Sending cannot be turned off (422).\n\n- `name`, `region`, `custom_return_path` and `delivery_route` are set when the domain is added. Sending one with another value returns 422 instead of being ignored; to change it, add the domain again.\n\n- Turning `open_tracking` or `click_tracking` on for a domain without a tracking subdomain sets `tracking_subdomain` to `links` (or `track`), with its CNAME record to add.",
        "tags": [
          "Domains"
        ],
        "x-docs-ids": [
          "update-domain"
        ],
        "parameters": [
          {
            "name": "domain_id",
            "in": "path",
            "required": true,
            "description": "The domain id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "open_tracking": {
                    "type": "boolean",
                    "description": "Track opens."
                  },
                  "click_tracking": {
                    "type": "boolean",
                    "description": "Track link clicks."
                  },
                  "tracking_subdomain": {
                    "type": "string",
                    "description": "Subdomain for tracking links. A single DNS label (letters, digits and dashes). It can be changed but not removed. A new value adds a new CNAME record to set up."
                  },
                  "tls": {
                    "type": "string",
                    "description": "`opportunistic`. `enforced` is not available yet and returns 422."
                  },
                  "receiving": {
                    "type": "boolean",
                    "description": "Turn receiving on or off. Or send Resend's `capabilities: { receiving: \"enabled\" | \"disabled\" }`."
                  }
                }
              },
              "example": {
                "open_tracking": true,
                "click_tracking": true,
                "tracking_subdomain": "links"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "object": "domain",
                  "id": "d91cd9bd-1176-453e-8fc1-35364d380206"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "delete": {
        "operationId": "deleteDomain",
        "summary": "Delete domain",
        "description": "Remove a domain. Its mailboxes and agent inboxes are removed with it, and you can no longer send from it.\n\n- A domain that had an MX record for receiving answers with a `note` to remove it: the MX value is shared, so left in place it would send the domain's email to whoever adds it next.",
        "tags": [
          "Domains"
        ],
        "x-docs-ids": [
          "delete-domain"
        ],
        "parameters": [
          {
            "name": "domain_id",
            "in": "path",
            "required": true,
            "description": "The domain id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "deleted": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "object": "domain",
                  "id": "d91cd9bd-1176-453e-8fc1-35364d380206",
                  "deleted": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/domains/{domain_id}/verify": {
      "post": {
        "operationId": "verifyDomain",
        "summary": "Verify domain",
        "description": "Check the domain's DNS records now instead of waiting for the next automatic check (every minute). The response is the checked domain: its status, and each record's status, `found` and `last_checked_at`.",
        "tags": [
          "Domains"
        ],
        "x-docs-ids": [
          "verify-domain"
        ],
        "parameters": [
          {
            "name": "domain_id",
            "in": "path",
            "required": true,
            "description": "The domain id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "region": {
                      "type": "string"
                    },
                    "open_tracking": {
                      "type": "boolean"
                    },
                    "click_tracking": {
                      "type": "boolean"
                    },
                    "tracking_subdomain": {},
                    "tracking_status": {
                      "type": "string"
                    },
                    "custom_return_path": {
                      "type": "string"
                    },
                    "delivery_route": {
                      "type": "string"
                    },
                    "tls": {
                      "type": "string"
                    },
                    "dns_provider": {
                      "type": "string"
                    },
                    "dns_zone": {
                      "type": "string"
                    },
                    "dns_zone_detected": {
                      "type": "boolean"
                    },
                    "verification_deadline_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "capabilities": {
                      "type": "object",
                      "properties": {
                        "sending": {
                          "type": "string"
                        },
                        "receiving": {
                          "type": "string"
                        }
                      }
                    },
                    "sending_setup": {},
                    "records": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "record": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "host": {
                            "type": "string"
                          },
                          "full_name": {
                            "type": "string"
                          },
                          "value": {
                            "type": "string"
                          },
                          "ttl": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "last_checked_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    },
                    "events": {
                      "type": "array"
                    }
                  }
                },
                "example": {
                  "object": "domain",
                  "id": "d91cd9bd-1176-453e-8fc1-35364d380206",
                  "name": "acme.com",
                  "status": "pending",
                  "created_at": "2026-10-07T09:12:44.512318+00:00",
                  "region": "us-east-1",
                  "open_tracking": false,
                  "click_tracking": false,
                  "tracking_subdomain": null,
                  "tracking_status": "off",
                  "custom_return_path": "send",
                  "delivery_route": "ses",
                  "tls": "opportunistic",
                  "dns_provider": "cloudflare",
                  "dns_zone": "acme.com",
                  "dns_zone_detected": true,
                  "verification_deadline_at": "2026-10-10T09:12:44.512318+00:00",
                  "capabilities": {
                    "sending": "enabled",
                    "receiving": "disabled"
                  },
                  "sending_setup": null,
                  "records": [
                    {
                      "record": "DKIM",
                      "type": "CNAME",
                      "name": "mx1._domainkey",
                      "host": "mx1._domainkey",
                      "full_name": "mx1._domainkey.acme.com",
                      "value": "0028814c2802.dkim.send.io",
                      "ttl": "Auto",
                      "status": "not_started",
                      "last_checked_at": "2026-10-07T09:20:01.338412+00:00"
                    },
                    {
                      "record": "SPF",
                      "type": "CNAME",
                      "name": "send",
                      "host": "send",
                      "full_name": "send.acme.com",
                      "value": "rp.send.io",
                      "ttl": "Auto",
                      "status": "not_started",
                      "last_checked_at": "2026-10-07T09:20:01.338412+00:00"
                    },
                    {
                      "record": "DMARC",
                      "type": "TXT",
                      "name": "_dmarc",
                      "host": "_dmarc",
                      "full_name": "_dmarc.acme.com",
                      "value": "v=DMARC1; p=none;",
                      "ttl": "Auto",
                      "status": "not_started",
                      "last_checked_at": "2026-10-07T09:20:01.338412+00:00"
                    }
                  ],
                  "events": []
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/domains/{domain_id}/domain-connect": {
      "get": {
        "operationId": "domainConnect",
        "summary": "Get Domain Connect link",
        "description": "Check whether the domain's DNS provider supports one-click setup (Domain Connect). If it does, the response has a signed URL that opens the provider and adds the records for you.\n\n- send.io extension. Never fails because setup is unsupported: you get `supported: false` and a `reason`, one of custom_return_path, provider_unsupported, template_pending, signing_unavailable, or a reason that the records are not ready yet.\n\n- A DMARC record is only offered when the domain has none, so an existing policy is never overwritten.",
        "tags": [
          "Domains"
        ],
        "x-docs-ids": [
          "domain-connect"
        ],
        "parameters": [
          {
            "name": "domain_id",
            "in": "path",
            "required": true,
            "description": "The domain id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "supported": {
                      "type": "boolean"
                    },
                    "provider": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "width": {
                      "type": "number"
                    },
                    "height": {
                      "type": "number"
                    },
                    "groups": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": {
                  "object": "domain_connect",
                  "supported": true,
                  "provider": "Cloudflare",
                  "url": "https://dash.cloudflare.com/domainconnect/v2/domainTemplates/providers/send.io/services/mail/apply?domain=acme.com&...&sig=...",
                  "width": 750,
                  "height": 750,
                  "groups": [
                    "dkim",
                    "outbound",
                    "dmarc"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/api-keys": {
      "post": {
        "operationId": "createApiKey",
        "summary": "Create API key",
        "description": "Create a new API key. The full token is returned only once, in this response.\n\n- Tokens start with `mx_`. The response also includes `object`.\n\n- `allowed_ips` applies everywhere the key works: the API, the compatible APIs, MCP, and SMTP and IMAP logins with the key as the password. A request from any other address is refused with 403 `ip_not_allowed`, which names the address send.io saw. Single addresses come back as `/32` (IPv4) or `/128` (IPv6). Entries that cannot match, such as private addresses, are accepted and listed in `warnings`.\n\n- `domain_id` only works on a sending key. A full-access key cannot be limited to a domain, so `domain_id` with `full_access` answers 422 `validation_error` instead of being ignored.\n\n- A key limited to a domain that is not verified yet is created, with a line in `warnings`: it cannot send until the domain is verified.\n\n- A key limited to a domain refuses any other From first, with 403 `invalid_permission` \"This API key can only send from <domain>...\". Once the domain is deleted the key cannot send; the key list shows `domain_deleted: true`. Create a new key for a domain added again.",
        "tags": [
          "API keys"
        ],
        "x-docs-ids": [
          "create-api-key"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Name of the key, up to 50 characters."
                  },
                  "permission": {
                    "type": "string",
                    "description": "`full_access` (default) or `sending_access`. A sending key can only send: Send email, Send batch emails and Send raw email."
                  },
                  "domain_id": {
                    "type": "string",
                    "description": "Restrict the key to sending from this domain. Requires `permission: \"sending_access\"`: with `full_access` (the default) it is refused with 422."
                  },
                  "allowed_ips": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Only accept the key from these IP addresses or CIDR ranges (IPv4 and IPv6, up to 50). Leave out for a key that works from any address."
                  }
                },
                "required": [
                  "name"
                ]
              },
              "example": {
                "name": "Production",
                "permission": "sending_access",
                "domain_id": "d91cd9bd-1176-453e-8fc1-35364d380206",
                "allowed_ips": [
                  "203.0.113.10",
                  "198.51.100.0/24"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "object": {
                      "type": "string"
                    },
                    "token": {
                      "type": "string"
                    },
                    "allowed_ips": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": {
                  "id": "dacf4072-4119-4d88-932f-6202748ac7c8",
                  "object": "api_key",
                  "token": "mx_A1b2C3d4_e5F6g7H8i9J0k1L2m3N4o5P6",
                  "allowed_ips": [
                    "203.0.113.10/32",
                    "198.51.100.0/24"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "get": {
        "operationId": "listApiKeys",
        "summary": "List API keys",
        "description": "List active API keys, newest first. Tokens are never returned, only their prefix.\n\n- send.io adds `last_used_at`, `token_prefix`, `permission`, `domain_id`, `domain`, `created_by` and `allowed_ips`.",
        "tags": [
          "API keys"
        ],
        "x-docs-ids": [
          "list-api-keys"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Number of items to return, from 1 to 100. All keys are returned when left out.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "Return items created before the item with this id (the next page). Cannot be combined with `before`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "description": "Return items created after the item with this id (the previous page). Cannot be combined with `after`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "last_used_at": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "When the key last authenticated a request, or null.",
                            "format": "date-time"
                          },
                          "domain_id": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The domain a sending key is limited to, or null."
                          },
                          "domain": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "That domain's name, or null."
                          },
                          "domain_deleted": {
                            "type": [
                              "boolean",
                              "null"
                            ],
                            "description": "True when that domain was deleted: the key can no longer send. Null for a key without a domain."
                          },
                          "created_by": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Who created the key, or null when unknown."
                          },
                          "created_by_api_key_id": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The API key that created this key through the API, or null when it was created in the dashboard."
                          },
                          "allowed_ips": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "description": "The IP addresses and ranges (CIDR) the key may be used from. Empty when the key works from any address."
                          },
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "token_prefix": {
                            "type": "string"
                          },
                          "permission": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "object": {
                      "type": "string"
                    },
                    "has_more": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "has_more": false,
                  "data": [
                    {
                      "id": "dacf4072-4119-4d88-932f-6202748ac7c8",
                      "name": "Production",
                      "created_at": "2026-10-01T14:02:11.902314+00:00",
                      "last_used_at": "2026-10-07T09:15:22.004118+00:00",
                      "token_prefix": "mx_A1b2C3d4_",
                      "permission": "sending_access",
                      "domain_id": "d91cd9bd-1176-453e-8fc1-35364d380206",
                      "domain": "acme.com",
                      "created_by": "ada@acme.com",
                      "created_by_api_key_id": null,
                      "allowed_ips": [
                        "203.0.113.10/32"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/api-keys/{api_key_id}": {
      "get": {
        "operationId": "retrieveApiKey",
        "summary": "Retrieve API key",
        "description": "Get one API key and its usage over the last 30 days: request counts, top endpoints and the 25 latest requests.\n\n- send.io extension.",
        "tags": [
          "API keys"
        ],
        "x-docs-ids": [
          "retrieve-api-key"
        ],
        "parameters": [
          {
            "name": "api_key_id",
            "in": "path",
            "required": true,
            "description": "The API key id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "last_used_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "When the key last authenticated a request, or null.",
                      "format": "date-time"
                    },
                    "domain_id": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The domain a sending key is limited to, or null."
                    },
                    "domain": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "That domain's name, or null."
                    },
                    "domain_deleted": {
                      "type": [
                        "boolean",
                        "null"
                      ],
                      "description": "True when that domain was deleted: the key can no longer send. Null for a key without a domain."
                    },
                    "created_by": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Who created the key, or null when unknown."
                    },
                    "created_by_api_key_id": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The API key that created this key through the API, or null when it was created in the dashboard."
                    },
                    "allowed_ips": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "The IP addresses and ranges (CIDR) the key may be used from. Empty when the key works from any address."
                    },
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "token_prefix": {
                      "type": "string"
                    },
                    "permission": {
                      "type": "string"
                    },
                    "usage": {
                      "type": "object",
                      "properties": {
                        "requests": {
                          "type": "number"
                        },
                        "successful": {
                          "type": "number"
                        },
                        "failed": {
                          "type": "number"
                        },
                        "rate_limited": {
                          "type": "number"
                        },
                        "last_24h": {
                          "type": "number"
                        },
                        "first_at": {
                          "type": "string",
                          "format": "date-time"
                        }
                      }
                    },
                    "endpoints": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "method": {
                            "type": "string"
                          },
                          "endpoint": {
                            "type": "string"
                          },
                          "requests": {
                            "type": "number"
                          }
                        }
                      }
                    },
                    "requests": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "method": {
                            "type": "string"
                          },
                          "endpoint": {
                            "type": "string"
                          },
                          "status": {
                            "type": "number"
                          },
                          "latency_ms": {
                            "type": "number"
                          },
                          "user_agent": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "api_key",
                  "id": "dacf4072-4119-4d88-932f-6202748ac7c8",
                  "name": "Production",
                  "created_at": "2026-10-01T14:02:11.902314+00:00",
                  "last_used_at": "2026-10-07T09:15:22.004118+00:00",
                  "token_prefix": "mx_A1b2C3d4_",
                  "permission": "sending_access",
                  "domain_id": "d91cd9bd-1176-453e-8fc1-35364d380206",
                  "domain": "acme.com",
                  "created_by": "ada@acme.com",
                  "created_by_api_key_id": null,
                  "allowed_ips": [
                    "203.0.113.10/32"
                  ],
                  "usage": {
                    "requests": 1840,
                    "successful": 1822,
                    "failed": 15,
                    "rate_limited": 3,
                    "last_24h": 212,
                    "first_at": "2026-10-01T14:05:40.118201+00:00"
                  },
                  "endpoints": [
                    {
                      "method": "POST",
                      "endpoint": "/emails",
                      "requests": 1790
                    }
                  ],
                  "requests": [
                    {
                      "id": "0f5c2e3a-9d41-4b7e-8a26-1c3d5e7f9a0b",
                      "created_at": "2026-10-07T09:15:22.004118+00:00",
                      "method": "POST",
                      "endpoint": "/emails",
                      "status": 200,
                      "latency_ms": 41,
                      "user_agent": "resend-node:4.0.0"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "patch": {
        "operationId": "updateApiKey",
        "summary": "Update API key",
        "description": "Rename an API key, or change the IP addresses it may be used from.\n\n- send.io extension. Send `name`, `allowed_ips`, or both.\n\n- A change to `allowed_ips` takes effect within seconds everywhere the key works, and is recorded in the audit log with the old and new lists.\n\n- A key cannot change its own list so that it would refuse the request making the change: that is answered with 422, so you cannot lock yourself out through the API.",
        "tags": [
          "API keys"
        ],
        "x-docs-ids": [
          "update-api-key"
        ],
        "parameters": [
          {
            "name": "api_key_id",
            "in": "path",
            "required": true,
            "description": "The API key id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "New name, up to 50 characters."
                  },
                  "allowed_ips": {
                    "anyOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Replace the key's allowed IP addresses and CIDR ranges (up to 50). `[]` or `null` lets the key work from any address again."
                  }
                }
              },
              "example": {
                "allowed_ips": [
                  "203.0.113.10",
                  "198.51.100.0/24"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "allowed_ips": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": {
                  "object": "api_key",
                  "id": "dacf4072-4119-4d88-932f-6202748ac7c8",
                  "allowed_ips": [
                    "203.0.113.10/32",
                    "198.51.100.0/24"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "delete": {
        "operationId": "deleteApiKey",
        "summary": "Delete API key",
        "description": "Revoke an API key. Requests made with it fail from then on.\n\n- Returns the deleted key's id.",
        "tags": [
          "API keys"
        ],
        "x-docs-ids": [
          "delete-api-key"
        ],
        "parameters": [
          {
            "name": "api_key_id",
            "in": "path",
            "required": true,
            "description": "The API key id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "deleted": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "object": "api_key",
                  "id": "dacf4072-4119-4d88-932f-6202748ac7c8",
                  "deleted": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/api-keys/client-ip": {
      "get": {
        "operationId": "getClientIp",
        "summary": "Get your IP address",
        "description": "The public IP address send.io sees your request coming from: the address to put in a key's `allowed_ips`.\n\n- send.io extension. The dashboard's \"Add my IP\" on a key's allowed IPs uses it.",
        "tags": [
          "API keys"
        ],
        "x-docs-ids": [
          "get-client-ip"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "ip": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "object": "client_ip",
                  "ip": "203.0.113.10"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/oauth/grants": {
      "get": {
        "operationId": "listOauthGrants",
        "summary": "List OAuth grants",
        "description": "List the team's OAuth grants, newest first, including revoked ones. A sign-in that was never completed is not listed.\n\n- Needs a full access key; for dashboard users, admins and members can list.",
        "tags": [
          "OAuth grants"
        ],
        "x-docs-ids": [
          "list-oauth-grants"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Number of items to return, from 1 to 100. Defaults to 20.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "Return items created before the item with this id (the next page). Cannot be combined with `before`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "description": "Return items created after the item with this id (the previous page). Cannot be combined with `after`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "object": {
                            "type": "string"
                          },
                          "id": {
                            "type": "string"
                          },
                          "client_id": {
                            "type": "string"
                          },
                          "scopes": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "revoked_at": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date-time"
                          },
                          "revoked_reason": {},
                          "client": {
                            "type": "object",
                            "properties": {
                              "name": {
                                "type": "string"
                              },
                              "logo_uri": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "has_more": false,
                  "data": [
                    {
                      "object": "oauth_grant",
                      "id": "6b1f0c2e-8d3a-4f5b-9c7e-2a4d6f8b0c1e",
                      "client_id": "c_3f9a2b7d1e",
                      "scopes": [
                        "mcp"
                      ],
                      "created_at": "2026-10-01T14:02:11.902314+00:00",
                      "revoked_at": null,
                      "revoked_reason": null,
                      "client": {
                        "name": "Claude",
                        "logo_uri": "https://claude.ai/logo.png"
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/oauth/grants/{grant_id}": {
      "delete": {
        "operationId": "revokeOauthGrant",
        "summary": "Revoke OAuth grant",
        "description": "Revoke an OAuth grant. The app's access and refresh tokens stop working at once. Revoking a grant that is already revoked returns it unchanged.\n\n- Needs a full access key; for dashboard users, admins only.",
        "tags": [
          "OAuth grants"
        ],
        "x-docs-ids": [
          "revoke-oauth-grant"
        ],
        "parameters": [
          {
            "name": "grant_id",
            "in": "path",
            "required": true,
            "description": "The OAuth grant id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "revoked_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "revoked_reason": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "object": "oauth_grant",
                  "id": "6b1f0c2e-8d3a-4f5b-9c7e-2a4d6f8b0c1e",
                  "revoked_at": "2026-10-08T09:15:22.004118+00:00",
                  "revoked_reason": "revoked_by_team"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/connected-apps": {
      "get": {
        "operationId": "listConnectedApps",
        "summary": "List connected apps",
        "description": "The team's active OAuth grants in the shape the dashboard's Connected apps list shows: the app, the permission it was given, who approved it and when it was last used. Revoked grants and sign-ins never completed are left out; at most 200, newest first.\n\n- send.io extension. `GET /oauth/grants` lists the same grants in Resend's shape, revoked ones included.",
        "tags": [
          "OAuth grants"
        ],
        "x-docs-ids": [
          "list-connected-apps"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "logo_uri": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The app's logo, or null."
                          },
                          "client_uri": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The app's home page, or null."
                          },
                          "redirect_host": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The host the sign-in redirected to, or null for a device sign-in."
                          },
                          "device_name": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The device named in a device sign-in (the CLI), or null."
                          },
                          "approved_by": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Who approved the sign-in, or null when unknown."
                          },
                          "last_used_at": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "When the app last called the API, or null.",
                            "format": "date-time"
                          },
                          "object": {
                            "type": "string"
                          },
                          "id": {
                            "type": "string"
                          },
                          "client_id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "permission": {
                            "type": "string"
                          },
                          "scope": {
                            "type": "string"
                          },
                          "active": {
                            "type": "boolean"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    },
                    "object": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "data": [
                    {
                      "object": "connected_app",
                      "id": "6b1f0c2e-8d3a-4f5b-9c7e-2a4d6f8b0c1e",
                      "client_id": "c_3f9a2b7d1e",
                      "name": "Claude",
                      "logo_uri": "https://claude.ai/logo.png",
                      "client_uri": "https://claude.ai",
                      "redirect_host": "claude.ai",
                      "permission": "full_access",
                      "scope": "mcp",
                      "device_name": null,
                      "approved_by": "ada@acme.com",
                      "active": true,
                      "created_at": "2026-10-01T14:02:11.902314+00:00",
                      "last_used_at": "2026-10-07T09:15:22.004118+00:00"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/subaccounts": {
      "post": {
        "operationId": "createSubaccount",
        "summary": "Create subaccount",
        "description": "Create a subaccount. It starts active, with no members, no domains and no API keys: mint keys with Create subaccount API key, or act for it with the `X-Sendio-Subaccount` header.\n\n- Up to 1000 active subaccounts per account. A subaccount cannot have subaccounts of its own (403).\n\n- Billing rolls up: a subaccount spends your credit balance, and its usage shows in your transactions with its `source_team_id`. When the balance is too low a send returns 402 `insufficient_credits`; over the subaccount's own limit, 429 `subaccount_monthly_quota_exceeded` or `subaccount_daily_quota_exceeded`.\n\n- Like SendGrid subusers, Mailgun subaccounts, Mandrill subaccounts, Mailjet sub-account API keys, Brevo corporate sub-accounts and Postmark servers (a server is a subaccount, its server token a subaccount key).",
        "tags": [
          "Subaccounts"
        ],
        "x-docs-ids": [
          "create-subaccount"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Name of the subaccount, 1 to 60 characters."
                  },
                  "monthly_email_limit": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "description": "Most emails (recipients) the subaccount may send per billing period of your account. `null` (default): no limit of its own; your credit balance still applies."
                  },
                  "daily_email_limit": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "description": "Most emails (recipients) the subaccount may send per UTC day. `null` (default): no limit of its own."
                  },
                  "rps": {
                    "type": "number",
                    "description": "API requests per second for the subaccount's keys, from 1 to your account's own rate limit (the default)."
                  }
                },
                "required": [
                  "name"
                ]
              },
              "example": {
                "name": "Acme Bakery",
                "monthly_email_limit": 50000,
                "daily_email_limit": 5000
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "monthly_email_limit": {
                      "type": "number"
                    },
                    "daily_email_limit": {
                      "type": "number"
                    },
                    "rps": {
                      "type": "number"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "suspended_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    },
                    "created_by": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string"
                        },
                        "id": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "subaccount",
                  "id": "5b7e2c1a-9d3f-4e8b-a6c2-1f0e9d8c7b6a",
                  "name": "Acme Bakery",
                  "status": "active",
                  "monthly_email_limit": 50000,
                  "daily_email_limit": 5000,
                  "rps": 10,
                  "created_at": "2026-10-07T10:02:31.204118+00:00",
                  "suspended_at": null,
                  "created_by": {
                    "type": "api_key",
                    "id": "dacf4072-4119-4d88-932f-6202748ac7c8"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "402": {
            "$ref": "#/components/responses/E402"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "get": {
        "operationId": "listSubaccounts",
        "summary": "List subaccounts",
        "description": "List your active subaccounts, newest first. Deleted subaccounts are not listed.",
        "tags": [
          "Subaccounts"
        ],
        "x-docs-ids": [
          "list-subaccounts"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "object": {
                            "type": "string"
                          },
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "monthly_email_limit": {
                            "type": "number"
                          },
                          "daily_email_limit": {
                            "type": "number"
                          },
                          "rps": {
                            "type": "number"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "suspended_at": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date-time"
                          },
                          "created_by": {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string"
                              },
                              "id": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "has_more": false,
                  "data": [
                    {
                      "object": "subaccount",
                      "id": "5b7e2c1a-9d3f-4e8b-a6c2-1f0e9d8c7b6a",
                      "name": "Acme Bakery",
                      "status": "active",
                      "monthly_email_limit": 50000,
                      "daily_email_limit": 5000,
                      "rps": 10,
                      "created_at": "2026-10-07T10:02:31.204118+00:00",
                      "suspended_at": null,
                      "created_by": {
                        "type": "api_key",
                        "id": "dacf4072-4119-4d88-932f-6202748ac7c8"
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/subaccounts/{subaccount_id}": {
      "get": {
        "operationId": "retrieveSubaccount",
        "summary": "Retrieve subaccount",
        "description": "Get one subaccount.",
        "tags": [
          "Subaccounts"
        ],
        "x-docs-ids": [
          "retrieve-subaccount"
        ],
        "parameters": [
          {
            "name": "subaccount_id",
            "in": "path",
            "required": true,
            "description": "The subaccount id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "monthly_email_limit": {
                      "type": "number"
                    },
                    "daily_email_limit": {
                      "type": "number"
                    },
                    "rps": {
                      "type": "number"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "suspended_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    },
                    "created_by": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string"
                        },
                        "id": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "subaccount",
                  "id": "5b7e2c1a-9d3f-4e8b-a6c2-1f0e9d8c7b6a",
                  "name": "Acme Bakery",
                  "status": "active",
                  "monthly_email_limit": 50000,
                  "daily_email_limit": 5000,
                  "rps": 10,
                  "created_at": "2026-10-07T10:02:31.204118+00:00",
                  "suspended_at": null,
                  "created_by": {
                    "type": "api_key",
                    "id": "dacf4072-4119-4d88-932f-6202748ac7c8"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "patch": {
        "operationId": "updateSubaccount",
        "summary": "Update subaccount",
        "description": "Rename a subaccount or change its limits. Only the fields you send change; `null` removes a limit.",
        "tags": [
          "Subaccounts"
        ],
        "x-docs-ids": [
          "update-subaccount"
        ],
        "parameters": [
          {
            "name": "subaccount_id",
            "in": "path",
            "required": true,
            "description": "The subaccount id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Name of the subaccount, 1 to 60 characters."
                  },
                  "monthly_email_limit": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "description": "Most emails (recipients) the subaccount may send per billing period of your account. `null` (default): no limit of its own; your credit balance still applies."
                  },
                  "daily_email_limit": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "description": "Most emails (recipients) the subaccount may send per UTC day. `null` (default): no limit of its own."
                  },
                  "rps": {
                    "type": "number",
                    "description": "API requests per second for the subaccount's keys, from 1 to your account's own rate limit (the default)."
                  }
                }
              },
              "example": {
                "daily_email_limit": null,
                "monthly_email_limit": 100000
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "monthly_email_limit": {
                      "type": "number"
                    },
                    "daily_email_limit": {},
                    "rps": {
                      "type": "number"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "suspended_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    },
                    "created_by": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string"
                        },
                        "id": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "subaccount",
                  "id": "5b7e2c1a-9d3f-4e8b-a6c2-1f0e9d8c7b6a",
                  "name": "Acme Bakery",
                  "status": "active",
                  "monthly_email_limit": 100000,
                  "daily_email_limit": null,
                  "rps": 10,
                  "created_at": "2026-10-07T10:02:31.204118+00:00",
                  "suspended_at": null,
                  "created_by": {
                    "type": "api_key",
                    "id": "dacf4072-4119-4d88-932f-6202748ac7c8"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "delete": {
        "operationId": "deleteSubaccount",
        "summary": "Delete subaccount",
        "description": "Delete a subaccount. Its API keys stop working at once, scheduled emails are canceled and its data is removed like a closed account's.",
        "tags": [
          "Subaccounts"
        ],
        "x-docs-ids": [
          "delete-subaccount"
        ],
        "parameters": [
          {
            "name": "subaccount_id",
            "in": "path",
            "required": true,
            "description": "The subaccount id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "deleted": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "object": "subaccount",
                  "id": "5b7e2c1a-9d3f-4e8b-a6c2-1f0e9d8c7b6a",
                  "deleted": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/subaccounts/{subaccount_id}/suspend": {
      "post": {
        "operationId": "suspendSubaccount",
        "summary": "Suspend subaccount",
        "description": "Stop a subaccount from sending. Its sends (API, batch, raw), broadcasts and automation emails are refused with 403 `subaccount_suspended` until you resume it; its API keys still work for everything else.\n\n- Queued broadcasts wait and continue after Resume. Email already accepted before the suspension is still delivered.",
        "tags": [
          "Subaccounts"
        ],
        "x-docs-ids": [
          "suspend-subaccount"
        ],
        "parameters": [
          {
            "name": "subaccount_id",
            "in": "path",
            "required": true,
            "description": "The subaccount id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "monthly_email_limit": {
                      "type": "number"
                    },
                    "daily_email_limit": {
                      "type": "number"
                    },
                    "rps": {
                      "type": "number"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "suspended_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "created_by": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string"
                        },
                        "id": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "subaccount",
                  "id": "5b7e2c1a-9d3f-4e8b-a6c2-1f0e9d8c7b6a",
                  "name": "Acme Bakery",
                  "status": "suspended",
                  "monthly_email_limit": 50000,
                  "daily_email_limit": 5000,
                  "rps": 10,
                  "created_at": "2026-10-07T10:02:31.204118+00:00",
                  "suspended_at": "2026-10-08T08:00:00+00:00",
                  "created_by": {
                    "type": "api_key",
                    "id": "dacf4072-4119-4d88-932f-6202748ac7c8"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/subaccounts/{subaccount_id}/resume": {
      "post": {
        "operationId": "resumeSubaccount",
        "summary": "Resume subaccount",
        "description": "Let a suspended subaccount send again.",
        "tags": [
          "Subaccounts"
        ],
        "x-docs-ids": [
          "resume-subaccount"
        ],
        "parameters": [
          {
            "name": "subaccount_id",
            "in": "path",
            "required": true,
            "description": "The subaccount id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "monthly_email_limit": {
                      "type": "number"
                    },
                    "daily_email_limit": {
                      "type": "number"
                    },
                    "rps": {
                      "type": "number"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "suspended_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    },
                    "created_by": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string"
                        },
                        "id": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "subaccount",
                  "id": "5b7e2c1a-9d3f-4e8b-a6c2-1f0e9d8c7b6a",
                  "name": "Acme Bakery",
                  "status": "active",
                  "monthly_email_limit": 50000,
                  "daily_email_limit": 5000,
                  "rps": 10,
                  "created_at": "2026-10-07T10:02:31.204118+00:00",
                  "suspended_at": null,
                  "created_by": {
                    "type": "api_key",
                    "id": "dacf4072-4119-4d88-932f-6202748ac7c8"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/subaccounts/{subaccount_id}/api-keys": {
      "post": {
        "operationId": "createSubaccountApiKey",
        "summary": "Create subaccount API key",
        "description": "Create an API key for a subaccount. The full token is returned only once, in this response. The key sees only the subaccount's data.",
        "tags": [
          "Subaccounts"
        ],
        "x-docs-ids": [
          "create-subaccount-api-key"
        ],
        "parameters": [
          {
            "name": "subaccount_id",
            "in": "path",
            "required": true,
            "description": "The subaccount id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Name of the key, up to 50 characters."
                  },
                  "permission": {
                    "type": "string",
                    "description": "`full_access` (default) or `sending_access`."
                  },
                  "domain_id": {
                    "type": "string",
                    "description": "Restrict the key to sending from this domain of the subaccount."
                  }
                },
                "required": [
                  "name"
                ]
              },
              "example": {
                "name": "Acme Bakery production"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "object": {
                      "type": "string"
                    },
                    "token": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "id": "dacf4072-4119-4d88-932f-6202748ac7c8",
                  "object": "api_key",
                  "token": "mx_Z9y8X7w6_v5U4t3S2r1Q0p9O8n7M6l5K4"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "get": {
        "operationId": "listSubaccountApiKeys",
        "summary": "List subaccount API keys",
        "description": "List a subaccount's active API keys, newest first. Tokens are never returned, only their prefix.",
        "tags": [
          "Subaccounts"
        ],
        "x-docs-ids": [
          "list-subaccount-api-keys"
        ],
        "parameters": [
          {
            "name": "subaccount_id",
            "in": "path",
            "required": true,
            "description": "The subaccount id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "last_used_at": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date-time"
                          },
                          "token_prefix": {
                            "type": "string"
                          },
                          "permission": {
                            "type": "string"
                          },
                          "domain_id": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "domain": {},
                          "created_by": {}
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "has_more": false,
                  "data": [
                    {
                      "id": "dacf4072-4119-4d88-932f-6202748ac7c8",
                      "name": "Acme Bakery production",
                      "created_at": "2026-10-07T10:05:12.402911+00:00",
                      "last_used_at": null,
                      "token_prefix": "mx_Z9y8X7w6_",
                      "permission": "full_access",
                      "domain_id": null,
                      "domain": null,
                      "created_by": null
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/subaccounts/{subaccount_id}/api-keys/{api_key_id}": {
      "delete": {
        "operationId": "deleteSubaccountApiKey",
        "summary": "Delete subaccount API key",
        "description": "Revoke one of a subaccount's API keys.",
        "tags": [
          "Subaccounts"
        ],
        "x-docs-ids": [
          "delete-subaccount-api-key"
        ],
        "parameters": [
          {
            "name": "subaccount_id",
            "in": "path",
            "required": true,
            "description": "The subaccount id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api_key_id",
            "in": "path",
            "required": true,
            "description": "The API key id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "deleted": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "object": "api_key",
                  "id": "dacf4072-4119-4d88-932f-6202748ac7c8",
                  "deleted": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/subaccounts/{subaccount_id}/stats": {
      "get": {
        "operationId": "subaccountStats",
        "summary": "Subaccount stats",
        "description": "A subaccount's usage in the current billing period against its limits and your plan, and its email metrics. Takes the same query parameters as Email metrics (period, granularity, metrics, dimensions and filters).\n\n- `parent_plan_emails_used` counts your account and every subaccount in the period.",
        "tags": [
          "Subaccounts"
        ],
        "x-docs-ids": [
          "subaccount-stats"
        ],
        "parameters": [
          {
            "name": "subaccount_id",
            "in": "path",
            "required": true,
            "description": "The subaccount id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "start_date",
            "in": "query",
            "required": false,
            "description": "Start of the metrics period (date or ISO 8601). Default: 7 days before end_date.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "end_date",
            "in": "query",
            "required": false,
            "description": "End of the metrics period. Default: now.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "granularity",
            "in": "query",
            "required": false,
            "description": "`hourly`, `daily` (default), `weekly` or `monthly`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "usage": {
                      "type": "object",
                      "properties": {
                        "period_start": {
                          "type": "string"
                        },
                        "period_end": {
                          "type": "string"
                        },
                        "emails_this_period": {
                          "type": "number"
                        },
                        "emails_today": {
                          "type": "number"
                        },
                        "monthly_email_limit": {
                          "type": "number"
                        },
                        "daily_email_limit": {
                          "type": "number"
                        },
                        "parent_plan_emails": {
                          "type": "number"
                        },
                        "parent_plan_emails_used": {
                          "type": "number"
                        }
                      }
                    },
                    "metrics": {
                      "type": "object",
                      "properties": {
                        "object": {
                          "type": "string"
                        },
                        "metrics": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "dimensions": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "granularity": {
                          "type": "string"
                        },
                        "start_date": {
                          "type": "string"
                        },
                        "end_date": {
                          "type": "string"
                        },
                        "timezone": {
                          "type": "string"
                        },
                        "totals": {
                          "type": "object",
                          "properties": {
                            "sent": {
                              "type": "number"
                            },
                            "delivered": {
                              "type": "number"
                            },
                            "bounced": {
                              "type": "number"
                            }
                          }
                        },
                        "data": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "period": {
                                "type": "string"
                              },
                              "sent": {
                                "type": "number"
                              },
                              "delivered": {
                                "type": "number"
                              },
                              "bounced": {
                                "type": "number"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "subaccount_stats",
                  "id": "5b7e2c1a-9d3f-4e8b-a6c2-1f0e9d8c7b6a",
                  "status": "active",
                  "usage": {
                    "period_start": "2026-10-01T00:00:00Z",
                    "period_end": "2026-11-01T00:00:00Z",
                    "emails_this_period": 12840,
                    "emails_today": 412,
                    "monthly_email_limit": 50000,
                    "daily_email_limit": 5000,
                    "parent_plan_emails": 100000,
                    "parent_plan_emails_used": 61237
                  },
                  "metrics": {
                    "object": "metrics",
                    "metrics": [
                      "sent",
                      "delivered",
                      "bounced"
                    ],
                    "dimensions": [
                      "period"
                    ],
                    "granularity": "daily",
                    "start_date": "2026-10-01T00:00:00Z",
                    "end_date": "2026-10-07T23:59:59Z",
                    "timezone": "UTC",
                    "totals": {
                      "sent": 412,
                      "delivered": 405,
                      "bounced": 3
                    },
                    "data": [
                      {
                        "period": "2026-10-07T00:00:00+00:00",
                        "sent": 412,
                        "delivered": 405,
                        "bounced": 3
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/webhooks": {
      "post": {
        "operationId": "createWebhook",
        "summary": "Create webhook",
        "description": "Register an endpoint for one or more event types. The response includes the signing secret used to verify deliveries.\n\n- The number of webhooks depends on your plan: 20 for an account, 10 for a subaccount. Every webhook of the account counts, including those made through the compatible APIs and agent inbox webhooks. Over the limit returns 422 \"The webhook limit for this plan has been reached.\"\n\n- send.io extension: `streams`, a per-stream webhook like Postmark's. Email events carry their stream in `data.stream` (`inbound` for `email.received`).\n\n- A delivery counts as successful on any HTTP 2xx response (200 to 299), for example 200, 201, 202 or 204. Any other answer (a redirect included: redirects are not followed), a timeout or a connection error is a failed delivery. Failed deliveries are retried with backoff.\n\n- If deliveries to an endpoint fail continuously for 24 hours, we email the workspace Admins. After 3 days of failures we disable the endpoint and show the reason in the dashboard. Turn it back on from the webhook page once the endpoint works again.\n\n- Extra send.io event types: `email.replied`, `contact.segment_entered`, `contact.segment_left`, `automation.*`, the agent inbox `message.*` events, and the billing events `credits.low`, `credits.depleted` and `credits.purchased`.\n\n- `contact.segment_entered` and `contact.segment_left`: the rule of a rule-based segment moved a contact in or out. `data` is `{ contact_id, email, segment_id, segment_name, source: \"rule\" }`. They are sent within seconds of the change that moved the contact (a property, an event, a time in the rule passing), and not for a segment's first build or a rule change unless it asked for `run_automations`, nor for history loaded with Import event history. Adding or removing a contact by hand in a manual segment does not send them. Provider formats: Brevo webhooks get `contact.segment_entered` as `list_addition`, Mailchimp list webhooks (created since rule-based segments were added) as `subscribe` for their own list; no provider format sends `contact.segment_left`, and the Mailchimp transactional, Mailjet, SendGrid, Mailgun and Postmark formats send neither.\n\n- Two shapes: `email.*`, `contact.*`, `domain.*` and the other events use `{type, created_at, data}` with the event name in `type`. The agent inbox `message.*` events use the AgentMail shape `{type: \"event\", event_type, event_id, message, thread}`: read the event name from `event_type`. One received email sends both `email.received` and `message.received` when you subscribe to both, so subscribe to one of them.\n\n- Received-mail events (`email.received`, `message.received`) are at most 256 KB. For a larger mail the body fields are left out (HTML first, `extracted_text` last) and `bodies_omitted` lists them: read the full message through the API. Accept request bodies of at least 1 MB on your endpoint (for example `express.raw({ type: \"application/json\", limit: \"1mb\" })`).\n\n- `streams` also applies to `message.received`: it is on the `inbound` stream, like `email.received`.\n\n- send.io extension: `format`, `options` and `headers`. Formats: sendio (default); provider formats are set by the compatible APIs. Formats that batch hold events up to `batch_max_wait_ms` and send up to `batch_size` per request; a failed request retries each of its events. Some provider formats send one request per recipient: the event is delivered when every request gets an HTTP 2xx response, and a retry sends them all again.\n\n- Backup endpoint: when a delivery to `endpoint` gets no HTTP response (connection refused, DNS failure, timeout), or fails on attempt `backup_after_attempts` or later, the same events are sent to `backup_endpoint` in that attempt. An HTTP 2xx response from either counts as delivered; otherwise the normal retry schedule continues.\n\n- `email.opened` events carry `detail.first_open`: true on the first open of the email (or of the recipient the event names), false afterwards.",
        "tags": [
          "Webhooks"
        ],
        "x-docs-ids": [
          "create-webhook"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "endpoint": {
                    "type": "string",
                    "description": "Public HTTPS URL that receives the events, at most 2,048 characters. No user name or password and no #fragment in the URL."
                  },
                  "events": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "Event types to send. Allowed: email.sent, email.delivered, email.delivery_delayed, email.complained, email.bounced, email.opened, email.clicked, email.failed, email.scheduled, email.canceled, email.suppressed, email.unsubscribed, email.received, email.replied, domain.created, domain.updated, domain.verified, domain.deleted, suppression.added, suppression.removed, contact.created, contact.updated, contact.deleted, contact.unsubscribed, contact.list_unsubscribed, contact.topics.updated, contact.segment_entered, contact.segment_left, topic.created, topic.updated, topic.deleted, automation.run.started, automation.run.completed, automation.run.failed, automation.run.cancelled, automation.auto_paused, message.received, message.received.spam, message.sent, message.delivered, message.bounced, message.complained, message.rejected, message.opened."
                  },
                  "format": {
                    "type": "string",
                    "description": "How deliveries are built. `sendio` (default): the payload below, signed with `svix-*` headers. Provider formats (`sendgrid`, `postmark`, `mailgun`, `mailchimp`, `mailchimp_list`, `mailjet`, `brevo`) are set by the compatible APIs when you create a webhook through them."
                  },
                  "options": {
                    "type": "object",
                    "description": "Format settings: `basic_auth` ({username, password}) or `bearer_token` (sent as the Authorization header), `signing_key` (for provider signatures), and for formats that batch `batch_size` and `batch_max_wait_ms` (up to 30000). Backup URL for any format: `backup_endpoint` (public HTTPS URL, no credentials), `backup_after_attempts` (1 to 8, default 3) and `backup_basic_auth` ({username, password}, used instead of `basic_auth` for the backup). Other keys depend on the format; unknown keys return 422. Passwords, tokens and keys are stored encrypted and returned masked as `********`."
                  },
                  "headers": {
                    "type": "object",
                    "description": "Custom request headers sent with every delivery, as `{name: value}` (at most 50 headers, 4,096 characters per value, 8 KB in all). Values cannot contain line breaks or other control characters. `Content-Type`, `Content-Length`, `Host`, `User-Agent` and `svix-*` cannot be set. Values are write-only: responses show them as `********`."
                  },
                  "streams": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Message stream ids (see Streams). When set, email events of other streams are not sent to this webhook; events without a stream (domains, contacts, suppressions) still are. Default: every stream."
                  },
                  "include_subaccounts": {
                    "type": "boolean",
                    "description": "Also send your subaccounts' events to this webhook, with `subaccount_id` added at the top level of the payload. Default: false (each subaccount's events go to its own webhooks)."
                  }
                },
                "required": [
                  "endpoint",
                  "events"
                ]
              },
              "example": {
                "endpoint": "https://acme.com/webhooks/sendio",
                "events": [
                  "email.delivered",
                  "email.bounced",
                  "email.complained"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "description": "`enabled` or `disabled`. send.io disables an endpoint after 3 days of failed deliveries."
                    },
                    "disabled_reason": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Why send.io disabled the endpoint, for example after 3 days of failed deliveries. null while enabled or when you disabled it yourself."
                    },
                    "failing_since": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "When the current run of failed deliveries started (RFC 3339). null when the last delivery succeeded.",
                      "format": "date-time"
                    },
                    "health": {
                      "type": "string",
                      "description": "`healthy`, `failing` (the last delivery failed: see `last_failure_reason`) or `disabled`."
                    },
                    "last_success_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "When a delivery last succeeded (RFC 3339).",
                      "format": "date-time"
                    },
                    "last_failure_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "When a delivery last failed (RFC 3339).",
                      "format": "date-time"
                    },
                    "last_failure_reason": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Why the last delivery failed, for example `HTTP 404` or `No response from the endpoint`."
                    },
                    "previous_secret_expires_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "When the secret replaced by the last rotation stops signing (RFC 3339). null when only the current secret signs.",
                      "format": "date-time"
                    },
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "endpoint": {
                      "type": "string"
                    },
                    "events": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "format": {
                      "type": "string"
                    },
                    "options": {
                      "type": "object"
                    },
                    "headers": {
                      "type": "object"
                    },
                    "streams": {
                      "type": "array"
                    },
                    "include_subaccounts": {
                      "type": "boolean"
                    },
                    "signing_secret": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "object": "webhook",
                  "id": "4dd369bc-aa82-4ff3-97de-514ae3000ee0",
                  "created_at": "2026-10-07T09:30:05.771204+00:00",
                  "status": "enabled",
                  "disabled_reason": null,
                  "failing_since": null,
                  "endpoint": "https://acme.com/webhooks/sendio",
                  "events": [
                    "email.delivered",
                    "email.bounced",
                    "email.complained"
                  ],
                  "format": "sendio",
                  "options": {},
                  "headers": {},
                  "streams": [],
                  "include_subaccounts": false,
                  "signing_secret": "whsec_c2Vjb25kLXNlY3JldC1leGFtcGxlLXZhbHVl"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "get": {
        "operationId": "listWebhooks",
        "summary": "List webhooks",
        "description": "List your webhooks, newest first.\n\n- If deliveries to an endpoint fail continuously for 24 hours, we email the workspace Admins. After 3 days of failures we disable the endpoint and show the reason in the dashboard. Turn it back on from the webhook page once the endpoint works again.\n\n- While a webhook is disabled, its events are not sent. They are kept as `held` for up to 30 days after it was disabled. Once you enable the webhook again, send them with Recover missed events (`POST /webhooks/{webhook_id}/recover`).",
        "tags": [
          "Webhooks"
        ],
        "x-docs-ids": [
          "list-webhooks"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Number of items to return, from 1 to 100. All webhooks are returned when left out.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "Return items created before the item with this id (the next page). Cannot be combined with `before`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "description": "Return items created after the item with this id (the previous page). Cannot be combined with `after`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "status": {
                            "type": "string",
                            "description": "`enabled` or `disabled`. send.io disables an endpoint after 3 days of failed deliveries."
                          },
                          "disabled_reason": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Why send.io disabled the endpoint. null while enabled or when you disabled it yourself."
                          },
                          "failing_since": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "When the current run of failed deliveries started (RFC 3339). null when the last delivery succeeded.",
                            "format": "date-time"
                          },
                          "health": {
                            "type": "string",
                            "description": "`healthy`, `failing` or `disabled`. With `data[].last_failure_reason` and `data[].last_failure_at`, says why deliveries fail."
                          },
                          "id": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "endpoint": {
                            "type": "string"
                          },
                          "events": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "format": {
                            "type": "string"
                          },
                          "options": {
                            "type": "object"
                          },
                          "headers": {
                            "type": "object"
                          },
                          "streams": {
                            "type": "array"
                          },
                          "include_subaccounts": {
                            "type": "boolean"
                          }
                        }
                      }
                    },
                    "object": {
                      "type": "string"
                    },
                    "has_more": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "has_more": false,
                  "data": [
                    {
                      "id": "4dd369bc-aa82-4ff3-97de-514ae3000ee0",
                      "created_at": "2026-10-07T09:30:05.771204+00:00",
                      "status": "enabled",
                      "disabled_reason": null,
                      "failing_since": null,
                      "endpoint": "https://acme.com/webhooks/sendio",
                      "events": [
                        "email.delivered",
                        "email.bounced",
                        "email.complained"
                      ],
                      "format": "sendio",
                      "options": {},
                      "headers": {},
                      "streams": [],
                      "include_subaccounts": false
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/webhooks/{webhook_id}": {
      "get": {
        "operationId": "retrieveWebhook",
        "summary": "Retrieve webhook",
        "description": "Get one webhook, including its current signing secret.\n\n- If deliveries to an endpoint fail continuously for 24 hours, we email the workspace Admins. After 3 days of failures we disable the endpoint and show the reason in the dashboard. Turn it back on from the webhook page once the endpoint works again.",
        "tags": [
          "Webhooks"
        ],
        "x-docs-ids": [
          "retrieve-webhook"
        ],
        "parameters": [
          {
            "name": "webhook_id",
            "in": "path",
            "required": true,
            "description": "The webhook id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "description": "`enabled` or `disabled`. send.io disables an endpoint after 3 days of failed deliveries."
                    },
                    "disabled_reason": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Why send.io disabled the endpoint, for example after 3 days of failed deliveries. null while enabled or when you disabled it yourself."
                    },
                    "failing_since": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "When the current run of failed deliveries started (RFC 3339). null when the last delivery succeeded.",
                      "format": "date-time"
                    },
                    "health": {
                      "type": "string",
                      "description": "`healthy`, `failing` (the last delivery failed: see `last_failure_reason`) or `disabled`."
                    },
                    "last_success_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "When a delivery last succeeded (RFC 3339).",
                      "format": "date-time"
                    },
                    "last_failure_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "When a delivery last failed (RFC 3339).",
                      "format": "date-time"
                    },
                    "last_failure_reason": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Why the last delivery failed, for example `HTTP 404` or `No response from the endpoint`."
                    },
                    "previous_secret_expires_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "When the secret replaced by the last rotation stops signing (RFC 3339). null when only the current secret signs.",
                      "format": "date-time"
                    },
                    "signing_secret": {
                      "type": "string",
                      "description": "The current signing secret. Left out for workspace Members, who see `signing_secret_hidden: true` instead; Admins and API keys get it."
                    },
                    "signing_secret_hidden": {
                      "type": "boolean",
                      "description": "true when the signing secret is left out because the caller is a workspace Member. Not present otherwise."
                    },
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "endpoint": {
                      "type": "string"
                    },
                    "events": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "format": {
                      "type": "string"
                    },
                    "options": {
                      "type": "object"
                    },
                    "headers": {
                      "type": "object"
                    },
                    "streams": {
                      "type": "array"
                    },
                    "include_subaccounts": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "object": "webhook",
                  "id": "4dd369bc-aa82-4ff3-97de-514ae3000ee0",
                  "created_at": "2026-10-07T09:30:05.771204+00:00",
                  "status": "enabled",
                  "disabled_reason": null,
                  "failing_since": null,
                  "endpoint": "https://acme.com/webhooks/sendio",
                  "events": [
                    "email.delivered",
                    "email.bounced",
                    "email.complained"
                  ],
                  "format": "sendio",
                  "options": {},
                  "headers": {},
                  "streams": [],
                  "include_subaccounts": false,
                  "signing_secret": "whsec_c2Vjb25kLXNlY3JldC1leGFtcGxlLXZhbHVl"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "patch": {
        "operationId": "updateWebhook",
        "summary": "Update webhook",
        "description": "Change a webhook's endpoint, events or status. Only the fields you send are changed.",
        "tags": [
          "Webhooks"
        ],
        "x-docs-ids": [
          "update-webhook"
        ],
        "parameters": [
          {
            "name": "webhook_id",
            "in": "path",
            "required": true,
            "description": "The webhook id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "endpoint": {
                    "type": "string",
                    "description": "New endpoint URL."
                  },
                  "events": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "New list of event types. Replaces the old list. Same allowed values as Create webhook."
                  },
                  "status": {
                    "type": "string",
                    "description": "`enabled` or `disabled`. Enabling resets the failure counter and clears `disabled_reason` and `failing_since`. Turn an endpoint that send.io disabled back on this way once it works again, then send the events it missed with Recover missed events."
                  },
                  "format": {
                    "type": "string",
                    "description": "New format (see Create webhook). The current options must be valid for it, or send new `options`."
                  },
                  "options": {
                    "type": "object",
                    "description": "New options. Replaces the old object; send a masked value (`********`) back unchanged to keep the stored secret."
                  },
                  "headers": {
                    "type": "object",
                    "description": "New custom headers. Replaces the old object; `{}` or `null` removes them all. Send a masked value (`********`) back unchanged to keep the stored value of that header."
                  },
                  "streams": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "New stream filter. Replaces the old list; `[]` sends events of every stream."
                  }
                }
              },
              "example": {
                "status": "disabled"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "object": "webhook",
                  "id": "4dd369bc-aa82-4ff3-97de-514ae3000ee0"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "delete": {
        "operationId": "deleteWebhook",
        "summary": "Delete webhook",
        "description": "Delete a webhook. No more events are sent to it.",
        "tags": [
          "Webhooks"
        ],
        "x-docs-ids": [
          "delete-webhook"
        ],
        "parameters": [
          {
            "name": "webhook_id",
            "in": "path",
            "required": true,
            "description": "The webhook id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "deleted": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "object": "webhook",
                  "id": "4dd369bc-aa82-4ff3-97de-514ae3000ee0",
                  "deleted": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/webhooks/{webhook_id}/signing-secret/rotate": {
      "post": {
        "operationId": "rotateWebhookSecret",
        "summary": "Rotate signing secret",
        "description": "Create a new signing secret. The old secret keeps working for 24 hours so you can switch over without dropping events. You can rotate again at any time, for example when the new secret leaked.\n\n- send.io extension.\n\n- Rotating again within 24 hours replaces only the newest secret. The secret you had before the first rotation keeps its original expiry, so receivers that still use it keep working.",
        "tags": [
          "Webhooks"
        ],
        "x-docs-ids": [
          "rotate-webhook-secret"
        ],
        "parameters": [
          {
            "name": "webhook_id",
            "in": "path",
            "required": true,
            "description": "The webhook id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "expire_previous": {
                    "type": "boolean",
                    "description": "true stops every older secret at once, so only the new secret signs. Use it when a secret leaked. Default false."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "signing_secret": {
                      "type": "string",
                      "description": "The new signing secret. It signs every request from now on."
                    },
                    "previous_secret_expires_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "When the old secret stops signing (RFC 3339). null when only the new secret signs.",
                      "format": "date-time"
                    },
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "object": "webhook",
                  "id": "4dd369bc-aa82-4ff3-97de-514ae3000ee0",
                  "signing_secret": "whsec_bmV3LXNlY3JldC1leGFtcGxlLXZhbHVlMTIz",
                  "previous_secret_expires_at": "2026-10-08T09:30:05.771204+00:00"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/webhooks/{webhook_id}/recover": {
      "post": {
        "operationId": "recoverWebhookEvents",
        "summary": "Recover missed events",
        "description": "Send the events a webhook missed while it was disabled. Enable the webhook first. Events are sent oldest first, with the usual retries.\n\n- send.io extension.\n\n- While a webhook is disabled, its events are not sent. They are kept as `held` for up to 30 days after it was disabled. Once you enable the webhook again, send them with Recover missed events (`POST /webhooks/{webhook_id}/recover`).\n\n- An event is never queued twice: once queued its status changes from held to pending. A webhook that is still disabled answers 409.",
        "tags": [
          "Webhooks"
        ],
        "x-docs-ids": [
          "recover-webhook-events"
        ],
        "parameters": [
          {
            "name": "webhook_id",
            "in": "path",
            "required": true,
            "description": "The webhook id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "since": {
                    "type": "string",
                    "description": "Send held events from this time on (RFC 3339, a date or Unix seconds). Default and earliest: 30 days ago."
                  },
                  "after": {
                    "type": "string",
                    "description": "Continue after this event id: the `next_after` of the previous call."
                  }
                }
              },
              "example": {
                "since": "2026-10-01T00:00:00Z"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "queued": {
                      "type": "number",
                      "description": "How many held events were queued, at most 1,000 per call."
                    },
                    "has_more": {
                      "type": "boolean",
                      "description": "true when more held events are waiting. Call again with `after` set to `next_after`."
                    },
                    "next_after": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The event id to continue after."
                    },
                    "object": {
                      "type": "string"
                    },
                    "webhook_id": {
                      "type": "string"
                    },
                    "since": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "object": "webhook_recovery",
                  "webhook_id": "4dd369bc-aa82-4ff3-97de-514ae3000ee0",
                  "since": "2026-10-01T00:00:00Z",
                  "queued": 42,
                  "has_more": false,
                  "next_after": null
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/webhooks/{webhook_id}/events": {
      "get": {
        "operationId": "listWebhookEvents",
        "summary": "List webhook events",
        "description": "List the events sent (or being sent) to a webhook, newest first, with their delivery status and payload.\n\n- send.io extension. `status` is pending, success or failed, skipped when the webhook's format has no equivalent for the event, or held when the event happened while the webhook was disabled (not sent: see Recover missed events).\n\n- Events and their delivery attempts are kept for 30 days. Older events are not listed and cannot be retrieved or replayed (404).",
        "tags": [
          "Webhooks"
        ],
        "x-docs-ids": [
          "list-webhook-events"
        ],
        "parameters": [
          {
            "name": "webhook_id",
            "in": "path",
            "required": true,
            "description": "The webhook id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Number of items to return, from 1 to 100. Default 20.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "Return events older than the event with this id. `before` is not supported.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "last_attempt": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "description": "The latest delivery attempt: `http_status_code` (null when the endpoint did not answer), `error` (why it failed, for example a timeout), `kind` (`scheduled` or `replay`) and `sent_at`. null before the first attempt. Use it to see why an event is still pending.",
                            "properties": {
                              "http_status_code": {
                                "type": "number"
                              },
                              "error": {
                                "type": "string"
                              },
                              "kind": {
                                "type": "string"
                              },
                              "sent_at": {
                                "type": "string",
                                "format": "date-time"
                              }
                            }
                          },
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "status": {
                            "type": "string"
                          },
                          "next_attempt_at": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date-time"
                          },
                          "payload": {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string"
                              },
                              "created_at": {
                                "type": "string"
                              },
                              "data": {
                                "type": "object",
                                "properties": {
                                  "email_id": {
                                    "type": "string"
                                  },
                                  "from": {
                                    "type": "string"
                                  },
                                  "to": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  },
                                  "subject": {
                                    "type": "string"
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    "object": {
                      "type": "string"
                    },
                    "has_more": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "has_more": false,
                  "data": [
                    {
                      "id": "evt_3f1b8c2d6a",
                      "type": "email.delivered",
                      "created_at": "2026-10-07T09:15:25.301000+00:00",
                      "status": "success",
                      "next_attempt_at": null,
                      "last_attempt": {
                        "http_status_code": 200,
                        "error": "",
                        "kind": "scheduled",
                        "sent_at": "2026-10-07T09:15:25.412000+00:00"
                      },
                      "payload": {
                        "type": "email.delivered",
                        "created_at": "2026-10-07T09:15:25.301Z",
                        "data": {
                          "email_id": "4ef9a417-02e9-4d39-ad75-9611e0fcc33c",
                          "from": "Ada <ada@acme.com>",
                          "to": [
                            "grace@example.com"
                          ],
                          "subject": "Your receipt"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/webhooks/{webhook_id}/events/{event_id}": {
      "get": {
        "operationId": "retrieveWebhookEvent",
        "summary": "Retrieve webhook event",
        "description": "Get one event of a webhook, with its delivery status and payload.\n\n- send.io extension.",
        "tags": [
          "Webhooks"
        ],
        "x-docs-ids": [
          "retrieve-webhook-event"
        ],
        "parameters": [
          {
            "name": "webhook_id",
            "in": "path",
            "required": true,
            "description": "The webhook id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "event_id",
            "in": "path",
            "required": true,
            "description": "The event id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "last_attempt": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The latest delivery attempt: `http_status_code` (null when the endpoint did not answer), `error` (why it failed, for example a timeout), `kind` (`scheduled` or `replay`) and `sent_at`. null before the first attempt. Use it to see why an event is still pending.",
                      "properties": {
                        "http_status_code": {
                          "type": "number"
                        },
                        "error": {
                          "type": "string"
                        },
                        "kind": {
                          "type": "string"
                        },
                        "sent_at": {
                          "type": "string",
                          "format": "date-time"
                        }
                      }
                    },
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "status": {
                      "type": "string"
                    },
                    "next_attempt_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    },
                    "payload": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string"
                        },
                        "created_at": {
                          "type": "string"
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "email_id": {
                              "type": "string"
                            },
                            "from": {
                              "type": "string"
                            },
                            "to": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "subject": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "webhook_event",
                  "id": "evt_3f1b8c2d6a",
                  "type": "email.delivered",
                  "created_at": "2026-10-07T09:15:25.301000+00:00",
                  "status": "success",
                  "next_attempt_at": null,
                  "last_attempt": {
                    "http_status_code": 200,
                    "error": "",
                    "kind": "scheduled",
                    "sent_at": "2026-10-07T09:15:25.412000+00:00"
                  },
                  "payload": {
                    "type": "email.delivered",
                    "created_at": "2026-10-07T09:15:25.301Z",
                    "data": {
                      "email_id": "4ef9a417-02e9-4d39-ad75-9611e0fcc33c",
                      "from": "Ada <ada@acme.com>",
                      "to": [
                        "grace@example.com"
                      ],
                      "subject": "Your receipt"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/webhooks/{webhook_id}/events/{event_id}/replay": {
      "post": {
        "operationId": "replayWebhookEvent",
        "summary": "Replay webhook event",
        "description": "Send an event to the webhook's endpoint once more, with the same payload.\n\n- send.io extension.\n\n- A replay is sent as a new delivery: the JSON body is serialized again, so its whitespace can differ from the original delivery, and it is signed with a new timestamp. Verify each delivery against the raw bytes you received, never against a stored copy of an earlier one.",
        "tags": [
          "Webhooks"
        ],
        "x-docs-ids": [
          "replay-webhook-event"
        ],
        "parameters": [
          {
            "name": "webhook_id",
            "in": "path",
            "required": true,
            "description": "The webhook id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "event_id",
            "in": "path",
            "required": true,
            "description": "The event id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "description": "`queued`: the replay is sent within seconds. It shows in the event's attempts with `kind: \"replay\"` and in `last_attempt`."
                    },
                    "event_status": {
                      "type": "string",
                      "description": "The event's own status. A replay does not change it or its scheduled retries."
                    },
                    "replay_queued_at": {
                      "type": "string",
                      "description": "When the replay was queued (RFC 3339).",
                      "format": "date-time"
                    },
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "object": "webhook_event",
                  "id": "evt_3f1b8c2d6a",
                  "status": "queued",
                  "event_status": "failed",
                  "replay_queued_at": "2026-10-07T10:02:11.120000Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/webhooks/{webhook_id}/events/{event_id}/attempts": {
      "get": {
        "operationId": "listWebhookEventAttempts",
        "summary": "List delivery attempts",
        "description": "List each attempt to deliver one event, newest first, with your endpoint's HTTP status and response.\n\n- send.io extension.",
        "tags": [
          "Webhooks"
        ],
        "x-docs-ids": [
          "list-webhook-event-attempts"
        ],
        "parameters": [
          {
            "name": "webhook_id",
            "in": "path",
            "required": true,
            "description": "The webhook id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "event_id",
            "in": "path",
            "required": true,
            "description": "The event id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Number of items to return, from 1 to 100. Default 20.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "Return attempts older than the attempt with this id. `before` is not supported.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "http_status_code": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Your endpoint's HTTP status. null when it did not answer."
                          },
                          "response": {
                            "type": "string",
                            "description": "The start of your endpoint's answer (up to 4 KB)."
                          },
                          "error": {
                            "type": "string",
                            "description": "Why the request failed when there was no answer, for example a timeout or a DNS failure. Empty otherwise."
                          },
                          "kind": {
                            "type": "string",
                            "description": "`scheduled` (the first try or a retry) or `replay`."
                          },
                          "id": {
                            "type": "string"
                          },
                          "sent_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    },
                    "object": {
                      "type": "string"
                    },
                    "has_more": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "has_more": false,
                  "data": [
                    {
                      "id": "att_9a7c5e3b1d",
                      "http_status_code": 200,
                      "response": "ok",
                      "error": "",
                      "kind": "scheduled",
                      "sent_at": "2026-10-07T09:15:25.412000+00:00"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/senders": {
      "post": {
        "operationId": "createSender",
        "summary": "Create sender",
        "description": "Add a sender. When its domain is a verified sending domain of your team it is verified at once (`verification_method: \"domain\"`); otherwise send.io emails the address a confirmation link that expires in 7 days.\n\n- send.io extension (Postmark sender signatures, SendGrid verified senders, Brevo and Mailjet senders).\n\n- `can_send` (same as `domain_verified`) says whether the sender's domain is a verified sending domain of your team. Only then can mail be sent from it: a single sender confirmed by email proves the mailbox, but send.io signs mail (DKIM, SPF alignment) only for verified domains, so a send from it answers 403 until you verify the domain. It is still usable as a profile (reply-to, name, postal address).\n\n- The confirmation email comes from send.io's system address; opening the link (`GET /senders/verify/{token}`, no API key) verifies the sender. A resent link replaces the previous one.\n\n- A team can have up to 1000 senders. A second sender with the same address answers 409.",
        "tags": [
          "Senders"
        ],
        "x-docs-ids": [
          "create-sender"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "description": "The From address (`from_email` works too). `Name <address>` sets the name when `name` is left out. One sender per address."
                  },
                  "name": {
                    "type": "string",
                    "description": "Display name, up to 200 characters."
                  },
                  "reply_to": {
                    "type": "string",
                    "description": "Reply-To address used when a send names this sender and no `reply_to`."
                  },
                  "nickname": {
                    "type": "string",
                    "description": "Your label for the sender, up to 200 characters."
                  },
                  "address": {
                    "type": "string",
                    "description": "Postal address line (for compliance footers), up to 300 characters."
                  },
                  "address2": {
                    "type": "string",
                    "description": "Second address line."
                  },
                  "city": {
                    "type": "string",
                    "description": "City."
                  },
                  "state": {
                    "type": "string",
                    "description": "State or region."
                  },
                  "zip": {
                    "type": "string",
                    "description": "Postal code, up to 30 characters."
                  },
                  "country": {
                    "type": "string",
                    "description": "Country."
                  }
                },
                "required": [
                  "email"
                ]
              },
              "example": {
                "email": "ada@acme.com",
                "name": "Ada Lovelace",
                "reply_to": "support@acme.com",
                "address": "1 Main St",
                "city": "London",
                "country": "GB"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "email": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "from": {
                      "type": "string"
                    },
                    "reply_to": {
                      "type": "string"
                    },
                    "nickname": {},
                    "address": {
                      "type": "string"
                    },
                    "address2": {},
                    "city": {
                      "type": "string"
                    },
                    "state": {},
                    "zip": {},
                    "country": {
                      "type": "string"
                    },
                    "domain": {
                      "type": "string"
                    },
                    "verified": {
                      "type": "boolean"
                    },
                    "verified_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "verification_method": {
                      "type": "string"
                    },
                    "verification_sent_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    },
                    "domain_verified": {
                      "type": "boolean"
                    },
                    "can_send": {
                      "type": "boolean"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "object": "sender",
                  "id": "0b6f1d2e-3c4a-4b5d-8e9f-a0b1c2d3e4f5",
                  "email": "ada@acme.com",
                  "name": "Ada Lovelace",
                  "from": "Ada Lovelace <ada@acme.com>",
                  "reply_to": "support@acme.com",
                  "nickname": null,
                  "address": "1 Main St",
                  "address2": null,
                  "city": "London",
                  "state": null,
                  "zip": null,
                  "country": "GB",
                  "domain": "acme.com",
                  "verified": true,
                  "verified_at": "2026-10-07T10:12:40.118204+00:00",
                  "verification_method": "domain",
                  "verification_sent_at": null,
                  "domain_verified": true,
                  "can_send": true,
                  "created_at": "2026-10-07T10:12:40.118204+00:00",
                  "updated_at": "2026-10-07T10:12:40.118204+00:00"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "get": {
        "operationId": "listSenders",
        "summary": "List senders",
        "description": "List senders, newest first.",
        "tags": [
          "Senders"
        ],
        "x-docs-ids": [
          "list-senders"
        ],
        "parameters": [
          {
            "name": "verified",
            "in": "query",
            "required": false,
            "description": "`true` for verified senders only, `false` for the ones waiting for confirmation.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "email",
            "in": "query",
            "required": false,
            "description": "Only addresses containing this text.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "domain",
            "in": "query",
            "required": false,
            "description": "Only senders on this domain.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Number of items to return, from 1 to 100. All senders are returned when left out.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "Return items created before the item with this id (the next page). Cannot be combined with `before`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "description": "Return items created after the item with this id (the previous page). Cannot be combined with `after`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "object": {
                            "type": "string"
                          },
                          "id": {
                            "type": "string"
                          },
                          "email": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "verified": {
                            "type": "boolean"
                          },
                          "can_send": {
                            "type": "boolean"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "has_more": false,
                  "data": [
                    {
                      "object": "sender",
                      "id": "0b6f1d2e-3c4a-4b5d-8e9f-a0b1c2d3e4f5",
                      "email": "ada@acme.com",
                      "name": "Ada Lovelace",
                      "verified": true,
                      "can_send": true
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/senders/{sender_id}": {
      "get": {
        "operationId": "retrieveSender",
        "summary": "Retrieve sender",
        "description": "Get one sender by id or by address.",
        "tags": [
          "Senders"
        ],
        "x-docs-ids": [
          "retrieve-sender"
        ],
        "parameters": [
          {
            "name": "sender_id",
            "in": "path",
            "required": true,
            "description": "The sender id, or its email address.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "email": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "verified": {
                      "type": "boolean"
                    },
                    "can_send": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "object": "sender",
                  "id": "0b6f1d2e-3c4a-4b5d-8e9f-a0b1c2d3e4f5",
                  "email": "ada@acme.com",
                  "name": "Ada Lovelace",
                  "verified": true,
                  "can_send": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "patch": {
        "operationId": "updateSender",
        "summary": "Update sender",
        "description": "Change a sender's fields. Only the fields you send change; `null` clears one. A new `email` must be verified again (at once when its domain is verified, otherwise by a new confirmation email).",
        "tags": [
          "Senders"
        ],
        "x-docs-ids": [
          "update-sender"
        ],
        "parameters": [
          {
            "name": "sender_id",
            "in": "path",
            "required": true,
            "description": "The sender id, or its email address.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "description": "New address. Resets verification."
                  },
                  "name": {
                    "type": "string",
                    "description": "Display name."
                  },
                  "reply_to": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Reply-To address."
                  },
                  "nickname": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Your label."
                  },
                  "address": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Postal address fields: also `address2`, `city`, `state`, `zip`, `country`."
                  }
                }
              },
              "example": {
                "name": "Ada L.",
                "reply_to": "help@acme.com"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "email": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "reply_to": {
                      "type": "string"
                    },
                    "verified": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "object": "sender",
                  "id": "0b6f1d2e-3c4a-4b5d-8e9f-a0b1c2d3e4f5",
                  "email": "ada@acme.com",
                  "name": "Ada L.",
                  "reply_to": "help@acme.com",
                  "verified": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "delete": {
        "operationId": "deleteSender",
        "summary": "Delete sender",
        "description": "Delete a sender. Emails already sent are not changed; sends that name it answer 422.",
        "tags": [
          "Senders"
        ],
        "x-docs-ids": [
          "delete-sender"
        ],
        "parameters": [
          {
            "name": "sender_id",
            "in": "path",
            "required": true,
            "description": "The sender id, or its email address.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "deleted": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "object": "sender",
                  "id": "0b6f1d2e-3c4a-4b5d-8e9f-a0b1c2d3e4f5",
                  "deleted": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/senders/{sender_id}/resend-verification": {
      "post": {
        "operationId": "resendSenderVerification",
        "summary": "Resend sender verification",
        "description": "Send a new confirmation email (the previous link stops working). A sender whose domain has been verified since is verified at once instead.\n\n- 422 when the sender is already verified; 429 within a minute of the previous email; 503 when confirmation emails are unavailable.",
        "tags": [
          "Senders"
        ],
        "x-docs-ids": [
          "resend-sender-verification"
        ],
        "parameters": [
          {
            "name": "sender_id",
            "in": "path",
            "required": true,
            "description": "The sender id, or its email address.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "email": {
                      "type": "string"
                    },
                    "verified": {
                      "type": "boolean"
                    },
                    "verification_sent_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "object": "sender",
                  "id": "0b6f1d2e-3c4a-4b5d-8e9f-a0b1c2d3e4f5",
                  "email": "grace@example.org",
                  "verified": false,
                  "verification_sent_at": "2026-10-07T10:20:02.551201+00:00"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/streams": {
      "get": {
        "operationId": "listStreams",
        "summary": "List streams",
        "description": "List the team's streams, the default ones first. Archived streams are left out unless `include_archived=true`.\n\n- send.io extension. The default streams are made the first time you use streams. They cannot be archived or deleted.\n\n- A broadcast stream's emails ride the bulk sending lane; transactional streams keep the usual lanes (an OTP tag still takes the OTP lane).",
        "tags": [
          "Streams"
        ],
        "x-docs-ids": [
          "list-streams"
        ],
        "parameters": [
          {
            "name": "include_archived",
            "in": "query",
            "required": false,
            "description": "`true` also lists archived streams.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "description": "Only streams of this type: `transactional`, `broadcast`, `inbound` (or `all`).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "object": {
                            "type": "string"
                          },
                          "id": {
                            "type": "string"
                          },
                          "uuid": {
                            "type": "string"
                          },
                          "stream_id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "default": {
                            "type": "boolean"
                          },
                          "archived": {
                            "type": "boolean"
                          },
                          "archived_at": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date-time"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updated_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "has_more": false,
                  "data": [
                    {
                      "object": "stream",
                      "id": "outbound",
                      "uuid": "2f4e6a8c-0b1d-4e3f-9a5b-7c9d1e3f5a7b",
                      "stream_id": "outbound",
                      "name": "Default Transactional Stream",
                      "type": "transactional",
                      "description": "Transactional email (POST /emails).",
                      "default": true,
                      "archived": false,
                      "archived_at": null,
                      "created_at": "2026-10-07T09:00:00+00:00",
                      "updated_at": "2026-10-07T09:00:00+00:00"
                    },
                    {
                      "object": "stream",
                      "id": "broadcast",
                      "uuid": "3a5c7e9b-1d2f-4a4b-8c6d-8e0f2a4c6e8d",
                      "stream_id": "broadcast",
                      "name": "Default Broadcast Stream",
                      "type": "broadcast",
                      "description": "Broadcasts and bulk email.",
                      "default": true,
                      "archived": false,
                      "archived_at": null,
                      "created_at": "2026-10-07T09:00:00+00:00",
                      "updated_at": "2026-10-07T09:00:00+00:00"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "post": {
        "operationId": "createStream",
        "summary": "Create stream",
        "description": "Add a transactional or broadcast stream.\n\n- Up to 50 custom streams per team. An existing `stream_id` answers 409.",
        "tags": [
          "Streams"
        ],
        "x-docs-ids": [
          "create-stream"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Display name, up to 100 characters."
                  },
                  "stream_id": {
                    "type": "string",
                    "description": "The id used on sends: 1 to 100 lowercase letters, digits, `-` and `_`. Default: made from the name (`Product Updates` becomes `product-updates`). Cannot be changed."
                  },
                  "type": {
                    "type": "string",
                    "description": "`transactional` (default) or `broadcast`. A team has one inbound stream, `inbound`. Cannot be changed."
                  },
                  "description": {
                    "type": "string",
                    "description": "Up to 1000 characters."
                  }
                },
                "required": [
                  "name"
                ]
              },
              "example": {
                "name": "Product Updates",
                "type": "broadcast",
                "description": "Monthly product news"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "uuid": {
                      "type": "string"
                    },
                    "stream_id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "default": {
                      "type": "boolean"
                    },
                    "archived": {
                      "type": "boolean"
                    },
                    "archived_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "object": "stream",
                  "id": "product-updates",
                  "uuid": "4b6d8f0a-2c3e-4f5a-9b7c-9d1e3f5a7b9c",
                  "stream_id": "product-updates",
                  "name": "Product Updates",
                  "type": "broadcast",
                  "description": "Monthly product news",
                  "default": false,
                  "archived": false,
                  "archived_at": null,
                  "created_at": "2026-10-07T10:30:00+00:00",
                  "updated_at": "2026-10-07T10:30:00+00:00"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/streams/{stream_id}": {
      "get": {
        "operationId": "retrieveStream",
        "summary": "Retrieve stream",
        "description": "Get one stream by its `stream_id` (or `uuid`).",
        "tags": [
          "Streams"
        ],
        "x-docs-ids": [
          "retrieve-stream"
        ],
        "parameters": [
          {
            "name": "stream_id",
            "in": "path",
            "required": true,
            "description": "The stream id (`outbound`, `product-updates`...).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "stream_id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "default": {
                      "type": "boolean"
                    },
                    "archived": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "object": "stream",
                  "id": "product-updates",
                  "stream_id": "product-updates",
                  "name": "Product Updates",
                  "type": "broadcast",
                  "default": false,
                  "archived": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "patch": {
        "operationId": "updateStream",
        "summary": "Update stream",
        "description": "Rename a stream or change its description. The type and `stream_id` cannot change.",
        "tags": [
          "Streams"
        ],
        "x-docs-ids": [
          "update-stream"
        ],
        "parameters": [
          {
            "name": "stream_id",
            "in": "path",
            "required": true,
            "description": "The stream id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "New display name."
                  },
                  "description": {
                    "type": "string",
                    "description": "New description."
                  }
                }
              },
              "example": {
                "name": "Product news"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "stream_id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "object": "stream",
                  "id": "product-updates",
                  "stream_id": "product-updates",
                  "name": "Product news",
                  "type": "broadcast"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "delete": {
        "operationId": "deleteStream",
        "summary": "Delete stream",
        "description": "Delete a custom stream. Its own suppressions are removed and it is taken out of webhook stream filters; emails sent on it keep its id.",
        "tags": [
          "Streams"
        ],
        "x-docs-ids": [
          "delete-stream"
        ],
        "parameters": [
          {
            "name": "stream_id",
            "in": "path",
            "required": true,
            "description": "The stream id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "deleted": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "object": "stream",
                  "id": "product-updates",
                  "deleted": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/streams/{stream_id}/archive": {
      "post": {
        "operationId": "archiveStream",
        "summary": "Archive stream",
        "description": "Archive a custom stream: sends that name it answer 422 until it is unarchived. Its emails, suppressions and webhook filters are kept.",
        "tags": [
          "Streams"
        ],
        "x-docs-ids": [
          "archive-stream"
        ],
        "parameters": [
          {
            "name": "stream_id",
            "in": "path",
            "required": true,
            "description": "The stream id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "archived": {
                      "type": "boolean"
                    },
                    "archived_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "object": "stream",
                  "id": "product-updates",
                  "archived": true,
                  "archived_at": "2026-10-07T11:00:00+00:00"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/streams/{stream_id}/unarchive": {
      "post": {
        "operationId": "unarchiveStream",
        "summary": "Unarchive stream",
        "description": "Make an archived stream usable again.",
        "tags": [
          "Streams"
        ],
        "x-docs-ids": [
          "unarchive-stream"
        ],
        "parameters": [
          {
            "name": "stream_id",
            "in": "path",
            "required": true,
            "description": "The stream id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "archived": {
                      "type": "boolean"
                    },
                    "archived_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "object": "stream",
                  "id": "product-updates",
                  "archived": false,
                  "archived_at": null
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/suppressions": {
      "post": {
        "operationId": "createSuppression",
        "summary": "Add suppression",
        "description": "Add an address to the suppression list. Adding an address that is already suppressed returns the existing entry, with the fields you sent (`origin`, `comment`, `expires_at`) updated.\n\n- send.io extension.\n\n- Sending a new `origin` without `expires_at` resets the expiry to that origin's default (24 hours for `soft_bounce`, none otherwise).\n\n- An address on the allow-list can still be added, but sends to it are not suppressed.\n\n- `stream` is null for a suppression of every stream. Bounces and complaints found by send.io always suppress on every stream.",
        "tags": [
          "Suppressions"
        ],
        "x-docs-ids": [
          "create-suppression"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "description": "The email address to suppress."
                  },
                  "origin": {
                    "type": "string",
                    "description": "Why it is suppressed: `manual` (default), `bounce` (hard bounce), `soft_bounce`, `complaint`, `invalid` (bad syntax or no such mailbox) or `block` (provider or policy block)."
                  },
                  "comment": {
                    "type": "string",
                    "description": "Your note, up to 500 characters."
                  },
                  "expires_at": {
                    "type": "string",
                    "description": "When the suppression ends (RFC 3339, a date or Unix seconds; must be in the future). Any origin may expire. `soft_bounce` defaults to 24 hours from now; the others never expire unless you set it."
                  },
                  "stream": {
                    "type": "string",
                    "description": "Suppress on this message stream only (see Streams). Left out: every stream. An address can have one suppression for every stream and one per stream."
                  }
                },
                "required": [
                  "email"
                ]
              },
              "example": {
                "email": "grace@example.com",
                "origin": "invalid",
                "comment": "Mailbox does not exist"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "stream": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The message stream, or null for every stream."
                    },
                    "source_id": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The email that caused a bounce or complaint entry, or null."
                    },
                    "comment": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Your note, or null."
                    },
                    "expires_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "When the suppression ends, or null when it does not.",
                      "format": "date-time"
                    },
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "email": {
                      "type": "string"
                    },
                    "origin": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "expired": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "object": "suppression",
                  "id": "8c4a7f2e-5b1d-4c3a-9e6f-2d7b8a9c0e1f",
                  "email": "grace@example.com",
                  "origin": "invalid",
                  "stream": null,
                  "source_id": null,
                  "created_at": "2026-10-07T10:01:13.552907+00:00",
                  "comment": "Mailbox does not exist",
                  "expires_at": null,
                  "expired": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "get": {
        "operationId": "listSuppressions",
        "summary": "List suppressions",
        "description": "List suppressed addresses, newest first. Expired entries (a soft bounce after its 24 hours) are left out unless `include_expired=true`.\n\n- `source_id` is the id of the email that caused a bounce, soft bounce or complaint entry.\n\n- A transient (4xx) bounce adds a `soft_bounce` entry that expires after 24 hours; a later hard bounce or complaint turns it into a permanent one. Allow-listed addresses are never added.\n\n- `expired` is true for an entry past its `expires_at` (only listed with `include_expired=true`).",
        "tags": [
          "Suppressions"
        ],
        "x-docs-ids": [
          "list-suppressions"
        ],
        "parameters": [
          {
            "name": "origin",
            "in": "query",
            "required": false,
            "description": "Only entries with this origin, or one of a comma-separated list: `bounce`, `soft_bounce`, `complaint`, `manual`, `invalid`, `block`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "email",
            "in": "query",
            "required": false,
            "description": "Only addresses containing this text. Case does not matter.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "created_after",
            "in": "query",
            "required": false,
            "description": "Only entries created at or after this time (RFC 3339, a date or Unix seconds).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "created_before",
            "in": "query",
            "required": false,
            "description": "Only entries created before this time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include_expired",
            "in": "query",
            "required": false,
            "description": "`true` also lists entries past their `expires_at` (they no longer suppress).",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "stream",
            "in": "query",
            "required": false,
            "description": "Only the entries that apply on this message stream: its own and the ones of every stream (`stream` null).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Number of items to return, from 1 to 100. All entries are returned when left out.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "Return items created before the item with this id (the next page). Cannot be combined with `before`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "description": "Return items created after the item with this id (the previous page). Cannot be combined with `after`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "stream": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The message stream, or null for every stream."
                          },
                          "source_id": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The email that caused a bounce or complaint entry, or null."
                          },
                          "comment": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Your note, or null."
                          },
                          "expires_at": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "When the suppression ends, or null when it does not.",
                            "format": "date-time"
                          },
                          "id": {
                            "type": "string"
                          },
                          "email": {
                            "type": "string"
                          },
                          "origin": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "expired": {
                            "type": "boolean"
                          }
                        }
                      }
                    },
                    "object": {
                      "type": "string"
                    },
                    "has_more": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "has_more": false,
                  "data": [
                    {
                      "id": "8c4a7f2e-5b1d-4c3a-9e6f-2d7b8a9c0e1f",
                      "email": "grace@example.com",
                      "origin": "bounce",
                      "source_id": "4ef9a417-02e9-4d39-ad75-9611e0fcc33c",
                      "created_at": "2026-10-07T10:01:13.552907+00:00",
                      "comment": null,
                      "expires_at": null,
                      "expired": false
                    },
                    {
                      "id": "5f0a2b3c-4d5e-4f60-8a71-b2c3d4e5f607",
                      "email": "alan@example.com",
                      "origin": "soft_bounce",
                      "source_id": "4ef9a417-02e9-4d39-ad75-9611e0fcc33c",
                      "created_at": "2026-10-07T09:40:02.118204+00:00",
                      "comment": null,
                      "expires_at": "2026-10-08T09:40:02.118204+00:00",
                      "expired": false
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "delete": {
        "operationId": "bulkDeleteSuppressions",
        "summary": "Clear suppressions",
        "description": "Remove every suppression that matches the filters (expired ones included) and get the count. Give at least one filter, or `all=true` to clear the whole list.\n\n- send.io extension.\n\n- Each removed entry sends a `suppression.removed` webhook.\n\n- No filter and no `all=true` answers 422.",
        "tags": [
          "Suppressions"
        ],
        "x-docs-ids": [
          "bulk-delete-suppressions"
        ],
        "parameters": [
          {
            "name": "origin",
            "in": "query",
            "required": false,
            "description": "Only entries with this origin, or one of a comma-separated list (`bounce,soft_bounce`).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "description": "Only entries created before this time (RFC 3339, a date or Unix seconds). `created_before` works too.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "created_after",
            "in": "query",
            "required": false,
            "description": "Only entries created at or after this time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "email",
            "in": "query",
            "required": false,
            "description": "Only addresses containing this text.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "stream",
            "in": "query",
            "required": false,
            "description": "Only this message stream's own entries (not the ones of every stream).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "all",
            "in": "query",
            "required": false,
            "description": "`true` to clear everything when no other filter is given.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "deleted": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "object": "suppression_bulk_delete",
                  "deleted": 42
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/suppressions/{suppression_id}": {
      "get": {
        "operationId": "retrieveSuppression",
        "summary": "Retrieve suppression",
        "description": "Get one suppression entry by its id or by the email address. An expired entry answers 404 unless `include_expired=true`. By address, the entry of every stream comes first; `stream` picks one stream's entry.",
        "tags": [
          "Suppressions"
        ],
        "x-docs-ids": [
          "retrieve-suppression"
        ],
        "parameters": [
          {
            "name": "suppression_id",
            "in": "path",
            "required": true,
            "description": "The suppression id, or the suppressed email address.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include_expired",
            "in": "query",
            "required": false,
            "description": "`true` also finds an entry past its `expires_at`.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "stream",
            "in": "query",
            "required": false,
            "description": "With an address: that stream's own entry.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "stream": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The message stream, or null for every stream."
                    },
                    "source_id": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The email that caused a bounce or complaint entry, or null."
                    },
                    "comment": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Your note, or null."
                    },
                    "expires_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "When the suppression ends, or null when it does not.",
                      "format": "date-time"
                    },
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "email": {
                      "type": "string"
                    },
                    "origin": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "expired": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "object": "suppression",
                  "id": "8c4a7f2e-5b1d-4c3a-9e6f-2d7b8a9c0e1f",
                  "email": "grace@example.com",
                  "origin": "manual",
                  "source_id": null,
                  "created_at": "2026-10-07T10:01:13.552907+00:00",
                  "comment": null,
                  "expires_at": null,
                  "expired": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "delete": {
        "operationId": "deleteSuppression",
        "summary": "Remove suppression",
        "description": "Remove an address from the suppression list so you can send to it again. Expired entries can be removed too. By address, `?stream=` removes that stream's entry (otherwise the entry of every stream first).",
        "tags": [
          "Suppressions"
        ],
        "x-docs-ids": [
          "delete-suppression"
        ],
        "parameters": [
          {
            "name": "suppression_id",
            "in": "path",
            "required": true,
            "description": "The suppression id, or the suppressed email address.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "deleted": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "object": "suppression",
                  "id": "8c4a7f2e-5b1d-4c3a-9e6f-2d7b8a9c0e1f",
                  "deleted": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/suppressions/batch/add": {
      "post": {
        "operationId": "batchAddSuppressions",
        "summary": "Add suppressions in bulk",
        "description": "Add up to 100 addresses in one request.",
        "tags": [
          "Suppressions"
        ],
        "x-docs-ids": [
          "batch-add-suppressions"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "emails": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "1 to 100 email addresses."
                  },
                  "origin": {
                    "type": "string",
                    "description": "Origin for every address (as on Add suppression). Default `manual`."
                  },
                  "comment": {
                    "type": "string",
                    "description": "Comment for every address, up to 500 characters."
                  },
                  "expires_at": {
                    "type": "string",
                    "description": "Expiry for every address."
                  },
                  "stream": {
                    "type": "string",
                    "description": "Message stream for every address (as on Add suppression). Default: every stream."
                  }
                },
                "required": [
                  "emails"
                ]
              },
              "example": {
                "emails": [
                  "grace@example.com",
                  "alan@example.com"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "object": {
                            "type": "string"
                          },
                          "id": {
                            "type": "string"
                          },
                          "email": {
                            "type": "string"
                          },
                          "origin": {
                            "type": "string"
                          },
                          "source_id": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "comment": {},
                          "expires_at": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date-time"
                          },
                          "expired": {
                            "type": "boolean"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "object": "suppression",
                      "id": "8c4a7f2e-5b1d-4c3a-9e6f-2d7b8a9c0e1f",
                      "email": "grace@example.com",
                      "origin": "manual",
                      "source_id": null,
                      "created_at": "2026-10-07T10:01:13.552907+00:00",
                      "comment": null,
                      "expires_at": null,
                      "expired": false
                    },
                    {
                      "object": "suppression",
                      "id": "1e2d3c4b-5a69-4788-9a0b-c1d2e3f4a5b6",
                      "email": "alan@example.com",
                      "origin": "manual",
                      "source_id": null,
                      "created_at": "2026-10-07T10:01:13.552907+00:00",
                      "comment": null,
                      "expires_at": null,
                      "expired": false
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/suppressions/batch/remove": {
      "post": {
        "operationId": "batchRemoveSuppressions",
        "summary": "Remove suppressions in bulk",
        "description": "Remove up to 100 entries in one request, by email address or by id.\n\n- The whole batch fails with 404 if any entry is not found.",
        "tags": [
          "Suppressions"
        ],
        "x-docs-ids": [
          "batch-remove-suppressions"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "emails": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "1 to 100 email addresses. Send `emails` or `ids`, not both."
                  },
                  "ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "1 to 100 suppression ids."
                  }
                }
              },
              "example": {
                "emails": [
                  "grace@example.com",
                  "alan@example.com"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "object": {
                            "type": "string"
                          },
                          "id": {
                            "type": "string"
                          },
                          "deleted": {
                            "type": "boolean"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "object": "suppression",
                      "id": "8c4a7f2e-5b1d-4c3a-9e6f-2d7b8a9c0e1f",
                      "deleted": true
                    },
                    {
                      "object": "suppression",
                      "id": "1e2d3c4b-5a69-4788-9a0b-c1d2e3f4a5b6",
                      "deleted": true
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/suppressions/allowlist": {
      "post": {
        "operationId": "addAllowlistEntry",
        "summary": "Add to allow-list",
        "description": "Add an address or a whole domain that is never suppressed. Sends to it skip the suppression check, and bounces or complaints do not add it. Adding an existing entry updates its comment.\n\n- send.io extension.\n\n- Addresses are stored in canonical form (domain lower-cased); domains lower-cased.\n\n- Existing suppressions of an allowed address stay listed but no longer stop sends.",
        "tags": [
          "Suppressions"
        ],
        "x-docs-ids": [
          "add-allowlist-entry"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "description": "An address to allow. Send one of `email`, `domain` or `value`."
                  },
                  "domain": {
                    "type": "string",
                    "description": "A domain to allow (exact match: `acme.com` does not cover `mail.acme.com`)."
                  },
                  "value": {
                    "type": "string",
                    "description": "An address, `@domain` or a bare domain; the type is worked out from it."
                  },
                  "comment": {
                    "type": "string",
                    "description": "Your note, up to 500 characters."
                  }
                }
              },
              "example": {
                "domain": "partner.example",
                "comment": "Our reseller"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "value": {
                      "type": "string"
                    },
                    "comment": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "object": "allowlist_entry",
                  "id": "7a1b2c3d-4e5f-4061-8728-394a5b6c7d8e",
                  "type": "domain",
                  "value": "partner.example",
                  "comment": "Our reseller",
                  "created_at": "2026-10-07T10:05:41.33812+00:00"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "get": {
        "operationId": "listAllowlist",
        "summary": "List allow-list",
        "description": "List allow-list entries, newest first.",
        "tags": [
          "Suppressions"
        ],
        "x-docs-ids": [
          "list-allowlist"
        ],
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "required": false,
            "description": "`email` or `domain`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "value",
            "in": "query",
            "required": false,
            "description": "Only entries containing this text.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Number of items to return, from 1 to 100. All entries are returned when left out.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "Return items created before the item with this id (the next page). Cannot be combined with `before`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "description": "Return items created after the item with this id (the previous page). Cannot be combined with `after`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "object": {
                            "type": "string"
                          },
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "value": {
                            "type": "string"
                          },
                          "comment": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "has_more": false,
                  "data": [
                    {
                      "object": "allowlist_entry",
                      "id": "7a1b2c3d-4e5f-4061-8728-394a5b6c7d8e",
                      "type": "domain",
                      "value": "partner.example",
                      "comment": "Our reseller",
                      "created_at": "2026-10-07T10:05:41.33812+00:00"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/suppressions/allowlist/{entry_id}": {
      "get": {
        "operationId": "retrieveAllowlistEntry",
        "summary": "Retrieve allow-list entry",
        "description": "Get one allow-list entry by its id, address or domain.",
        "tags": [
          "Suppressions"
        ],
        "x-docs-ids": [
          "retrieve-allowlist-entry"
        ],
        "parameters": [
          {
            "name": "entry_id",
            "in": "path",
            "required": true,
            "description": "The entry id, or the allowed address or domain.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "value": {
                      "type": "string"
                    },
                    "comment": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "object": "allowlist_entry",
                  "id": "7a1b2c3d-4e5f-4061-8728-394a5b6c7d8e",
                  "type": "domain",
                  "value": "partner.example",
                  "comment": "Our reseller",
                  "created_at": "2026-10-07T10:05:41.33812+00:00"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "delete": {
        "operationId": "deleteAllowlistEntry",
        "summary": "Remove from allow-list",
        "description": "Remove an allow-list entry. Existing suppressions of the address apply again.",
        "tags": [
          "Suppressions"
        ],
        "x-docs-ids": [
          "delete-allowlist-entry"
        ],
        "parameters": [
          {
            "name": "entry_id",
            "in": "path",
            "required": true,
            "description": "The entry id, or the allowed address or domain.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "deleted": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "object": "allowlist_entry",
                  "id": "7a1b2c3d-4e5f-4061-8728-394a5b6c7d8e",
                  "deleted": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/templates": {
      "post": {
        "operationId": "createTemplate",
        "summary": "Create template",
        "description": "Create a template. It starts as a draft; publish it before sending with it.\n\n- Template language. `template_engine: \"simple\"` (the default, and every template saved before engines existed): `{{NAME}}` inserts the value HTML-escaped in the HTML part, `{{{NAME}}}` inserts it as-is. Unknown names stay as written.\n\n- `template_engine: \"handlebars\"`: Handlebars. Values: `{{name}}` (escaped in HTML), `{{{html}}}` (as-is), dotted paths `{{order.total}}`, `{{items.[0]}}`, `{{items.length}}`, `this`, `../parent`, `@root.x`. Blocks: `{{#if x}}…{{else if y}}…{{else}}…{{/if}}`, `{{#unless x}}`, `{{#each list}}` over arrays and objects with `@index`, `@key`, `@first`, `@last` and block params `{{#each list as |item i|}}`, `{{#with obj}}`, Mustache sections `{{#x}}` / `{{^x}}`. Comments `{{!-- … --}}` and whitespace control `{{~ … ~}}`. Missing values render empty; `#if` treats `false`, `null`, `\"\"`, `0` and `[]` as false (`includeZero=true` keeps 0).\n\n- Handlebars helpers: `eq`, `ne`, `lt`, `gt`, `lte`, `gte` (also SendGrid's `equals`, `notEquals`, `lessThan`, `greaterThan`; numbers compare with numeric strings), `and`, `or`, `not`, `length`, `lookup obj key`, `default value \"fallback\"`, `uppercase`, `lowercase`, `insert name \"default=x\"` (SendGrid) and `formatDate date \"MMMM D, YYYY\" [\"-0800\"]` (moment-style tokens; ISO 8601 dates or Unix timestamps). Use them inline (`{{default name \"there\"}}`), as subexpressions (`{{#if (gt total 100)}}`) or as blocks (`{{#eq plan \"pro\"}}…{{else}}…{{/eq}}`). Objects iterate in key order.\n\n- Handlebars templates are parsed strictly when saved and when sent inline: an unclosed or mismatched block, an unknown helper, a wrong argument count, a partial (`{{> x}}`) or a decorator answers 422 naming the part, line and column, such as `Template syntax error in html at line 3, column 5: {{#if}} is never closed (missing {{/if}})`. Values a helper cannot use (a date `formatDate` cannot read) answer 422 at send time. `{{name|fallback}}` also works, and per-contact tags (`{{{contact.first_name|there}}}`, `{{{unsubscribe_url}}}`) are left in place for broadcast and automation personalization when the variables have no `contact` key.",
        "tags": [
          "Templates"
        ],
        "x-docs-ids": [
          "create-template"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Name of the template."
                  },
                  "html": {
                    "type": "string",
                    "description": "HTML body. Use `{{NAME}}` for an HTML-escaped variable and `{{{NAME}}}` to insert the value as-is."
                  },
                  "alias": {
                    "type": "string",
                    "description": "A unique alias. You can use it in place of the id in every template endpoint and when sending. Up to 100 characters: lowercase letters (a-z), digits, hyphens and underscores, starting with a letter or digit (for example welcome-email)."
                  },
                  "from": {
                    "type": "string",
                    "description": "Optional default sender, such as `Ada <ada@acme.com>`, for sends that do not give one. Can contain variables. A template is a design: it can be published without a From, and a send or test then needs its own `from`."
                  },
                  "subject": {
                    "type": "string",
                    "description": "Optional default subject for sends that do not give one. Can contain variables."
                  },
                  "reply_to": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "Default Reply-To address or addresses."
                  },
                  "text": {
                    "type": "string",
                    "description": "Plain text body."
                  },
                  "preview_text": {
                    "type": "string",
                    "description": "Inbox preview snippet. It is added as a hidden block at the top of the HTML."
                  },
                  "template_engine": {
                    "type": "string",
                    "description": "`simple` (the default) or `handlebars`. `simple` fills `{{NAME}}` and `{{{NAME}}}`. `handlebars` adds conditions, loops, helpers and nested variables; see Template language below. Stored on the version this call saves; an update that leaves it out keeps the current engine."
                  },
                  "variables": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string",
                          "description": "Variable name, as used in `{{key}}`."
                        },
                        "type": {
                          "type": "string",
                          "description": "`string` or `number`. With `template_engine: \"handlebars\"` also `boolean`, `object` or `array`."
                        },
                        "fallback_value": {
                          "description": "Value used when a send does not provide one."
                        }
                      },
                      "required": [
                        "key",
                        "type"
                      ]
                    },
                    "description": "Variables the template uses. At most 50. Optional with `handlebars`, where any variable may be passed at send time."
                  },
                  "design": {
                    "type": "object",
                    "description": "Editor design JSON, stored with the version. Used by the send.io template editor."
                  },
                  "version_name": {
                    "type": "string",
                    "description": "A name for the version this call saves, shown in the version list. At most 100 characters."
                  },
                  "version_comment": {
                    "type": "string",
                    "description": "A comment for the version this call saves. At most 1000 characters."
                  }
                },
                "required": [
                  "name",
                  "html"
                ]
              },
              "example": {
                "name": "Order receipt",
                "alias": "order-receipt",
                "from": "Ada <ada@acme.com>",
                "subject": "Receipt for order {{ORDER_ID}}",
                "html": "<p>Hi {{NAME}}, thanks for order {{ORDER_ID}}.</p>",
                "variables": [
                  {
                    "key": "NAME",
                    "type": "string",
                    "fallback_value": "there"
                  },
                  {
                    "key": "ORDER_ID",
                    "type": "string"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "object": "template",
                  "id": "34a080c9-b17d-4187-ad80-5af20266e535"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "get": {
        "operationId": "listTemplates",
        "summary": "List templates",
        "description": "List templates, newest first.",
        "tags": [
          "Templates"
        ],
        "x-docs-ids": [
          "list-templates"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Number of items to return, from 1 to 100. Default 20.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "Return items created before the item with this id (the next page). Cannot be combined with `before`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "description": "Return items created after the item with this id (the previous page). Cannot be combined with `after`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "published_version_id": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The version sends use; null until published."
                          },
                          "published_version_number": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "That version's `version_number`."
                          },
                          "owner_automation_id": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The automation that owns this template (an automation email), or null for a template of your own."
                          },
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "alias": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updated_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "published_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "current_version_id": {
                            "type": "string"
                          },
                          "has_unpublished_versions": {
                            "type": "boolean"
                          }
                        }
                      }
                    },
                    "object": {
                      "type": "string"
                    },
                    "has_more": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "has_more": false,
                  "data": [
                    {
                      "id": "34a080c9-b17d-4187-ad80-5af20266e535",
                      "name": "Order receipt",
                      "alias": "order-receipt",
                      "status": "published",
                      "created_at": "2026-10-02T11:40:02.118937+00:00",
                      "updated_at": "2026-10-05T16:22:48.903311+00:00",
                      "published_at": "2026-10-05T16:23:10.004512+00:00",
                      "current_version_id": "6a1f4c2e-8b3d-4e5f-9a7b-0c1d2e3f4a5b",
                      "has_unpublished_versions": false,
                      "owner_automation_id": null,
                      "published_version_id": "6a1f4c2e-8b3d-4e5f-9a7b-0c1d2e3f4a5b",
                      "published_version_number": 2
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/templates/{template_id}": {
      "get": {
        "operationId": "retrieveTemplate",
        "summary": "Retrieve template",
        "description": "Get a template by id or alias. Content comes from the draft version if there is one, otherwise from the published version.\n\n- `status` is `draft` until the first publish, then `published`. send.io adds `preview_text`, `design`, `version_number`, `template_engine`, `published_version_id` and `published_version_number`.",
        "tags": [
          "Templates"
        ],
        "x-docs-ids": [
          "retrieve-template"
        ],
        "parameters": [
          {
            "name": "template_id",
            "in": "path",
            "required": true,
            "description": "The template id or alias.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "published_version_id": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The version sends, transactional emails and new broadcasts use. Null until the template is published."
                    },
                    "published_version_number": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "That version's `version_number`."
                    },
                    "owner_automation_id": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The automation that owns this template (an automation email), or null for a template of your own."
                    },
                    "from": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The default sender, null when the template has none."
                    },
                    "subject": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The default subject, null when the template has none."
                    },
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "alias": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "published_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "current_version_id": {
                      "type": "string"
                    },
                    "has_unpublished_versions": {
                      "type": "boolean"
                    },
                    "reply_to": {
                      "type": "array"
                    },
                    "html": {
                      "type": "string"
                    },
                    "text": {},
                    "preview_text": {},
                    "design": {},
                    "version_number": {
                      "type": "number"
                    },
                    "template_engine": {
                      "type": "string"
                    },
                    "variables": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "key": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "fallback_value": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updated_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "template",
                  "id": "34a080c9-b17d-4187-ad80-5af20266e535",
                  "name": "Order receipt",
                  "alias": "order-receipt",
                  "status": "published",
                  "created_at": "2026-10-02T11:40:02.118937+00:00",
                  "updated_at": "2026-10-05T16:22:48.903311+00:00",
                  "published_at": "2026-10-05T16:23:10.004512+00:00",
                  "current_version_id": "6a1f4c2e-8b3d-4e5f-9a7b-0c1d2e3f4a5b",
                  "has_unpublished_versions": false,
                  "owner_automation_id": null,
                  "published_version_id": "6a1f4c2e-8b3d-4e5f-9a7b-0c1d2e3f4a5b",
                  "published_version_number": 2,
                  "from": "Ada <ada@acme.com>",
                  "subject": "Receipt for order {{ORDER_ID}}",
                  "reply_to": [],
                  "html": "<p>Hi {{NAME}}, thanks for order {{ORDER_ID}}.</p>",
                  "text": null,
                  "preview_text": null,
                  "design": null,
                  "version_number": 2,
                  "template_engine": "simple",
                  "variables": [
                    {
                      "id": "f3e2d1c0-b9a8-4776-8564-534231201f0e",
                      "key": "NAME",
                      "type": "string",
                      "fallback_value": "there",
                      "created_at": "2026-10-05T16:22:48.903311+00:00",
                      "updated_at": "2026-10-05T16:22:48.903311+00:00"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "patch": {
        "operationId": "updateTemplate",
        "summary": "Update template",
        "description": "Change a template. Fields you leave out keep their current values. Each update saves a new draft version; sends keep using the published version until you publish.\n\n- `variables`, when sent, replaces the whole list for the new version.",
        "tags": [
          "Templates"
        ],
        "x-docs-ids": [
          "update-template"
        ],
        "parameters": [
          {
            "name": "template_id",
            "in": "path",
            "required": true,
            "description": "The template id or alias.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Name of the template."
                  },
                  "html": {
                    "type": "string",
                    "description": "HTML body. Use `{{NAME}}` for an HTML-escaped variable and `{{{NAME}}}` to insert the value as-is."
                  },
                  "alias": {
                    "type": "string",
                    "description": "A unique alias. You can use it in place of the id in every template endpoint and when sending. Up to 100 characters: lowercase letters (a-z), digits, hyphens and underscores, starting with a letter or digit (for example welcome-email)."
                  },
                  "from": {
                    "type": "string",
                    "description": "Optional default sender, such as `Ada <ada@acme.com>`, for sends that do not give one. Can contain variables. A template is a design: it can be published without a From, and a send or test then needs its own `from`."
                  },
                  "subject": {
                    "type": "string",
                    "description": "Optional default subject for sends that do not give one. Can contain variables."
                  },
                  "reply_to": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "Default Reply-To address or addresses."
                  },
                  "text": {
                    "type": "string",
                    "description": "Plain text body."
                  },
                  "preview_text": {
                    "type": "string",
                    "description": "Inbox preview snippet. It is added as a hidden block at the top of the HTML."
                  },
                  "template_engine": {
                    "type": "string",
                    "description": "`simple` (the default) or `handlebars`. `simple` fills `{{NAME}}` and `{{{NAME}}}`. `handlebars` adds conditions, loops, helpers and nested variables; see Template language below. Stored on the version this call saves; an update that leaves it out keeps the current engine."
                  },
                  "variables": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string",
                          "description": "Variable name, as used in `{{key}}`."
                        },
                        "type": {
                          "type": "string",
                          "description": "`string` or `number`. With `template_engine: \"handlebars\"` also `boolean`, `object` or `array`."
                        },
                        "fallback_value": {
                          "description": "Value used when a send does not provide one."
                        }
                      },
                      "required": [
                        "key",
                        "type"
                      ]
                    },
                    "description": "Variables the template uses. At most 50. Optional with `handlebars`, where any variable may be passed at send time."
                  },
                  "design": {
                    "type": "object",
                    "description": "Editor design JSON, stored with the version. Used by the send.io template editor."
                  },
                  "version_name": {
                    "type": "string",
                    "description": "A name for the version this call saves, shown in the version list. At most 100 characters."
                  },
                  "version_comment": {
                    "type": "string",
                    "description": "A comment for the version this call saves. At most 1000 characters."
                  }
                }
              },
              "example": {
                "subject": "Your receipt for order {{ORDER_ID}}"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "object": "template",
                  "id": "34a080c9-b17d-4187-ad80-5af20266e535"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "delete": {
        "operationId": "deleteTemplate",
        "summary": "Delete template",
        "description": "Delete a template. Sends that reference it fail from then on.\n\n- send.io extension. A template that an automation's Send email step or a transactional email uses returns 409 `template_in_use`, with the automations (`automations`: id, name, status; always an array) and, when there are any, the transactional emails (`transactional_emails`: id, name). Change or remove those steps, and choose another template for those transactional emails, first.\n\n- send.io extension. An automation email (`owner_automation_id` set) returns 403 `template_owned_by_automation`: it is deleted with its automation.",
        "tags": [
          "Templates"
        ],
        "x-docs-ids": [
          "delete-template"
        ],
        "parameters": [
          {
            "name": "template_id",
            "in": "path",
            "required": true,
            "description": "The template id or alias.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "deleted": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "object": "template",
                  "id": "34a080c9-b17d-4187-ad80-5af20266e535",
                  "deleted": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/templates/{template_id}/publish": {
      "post": {
        "operationId": "publishTemplate",
        "summary": "Publish template",
        "description": "Publish the current draft so sends use it. A template is a design: it needs content (HTML or text), and its From and subject are optional. Transactional emails that use the template switch to the new version within 10 seconds; broadcasts keep the version they were made from.\n\n- Returns 422 \"No draft to publish.\" when there are no unpublished changes.\n\n- Returns 422 when the version has no content, when a `handlebars` part does not parse, or when a default From is set but is not a valid address. The From domain is checked when an email is sent and when a transactional email is saved, not at publish.\n\n- Returns 422 when an automation's Send email step sends this template without a From (or subject) of its own and the version has none: \"This template is sent by workflow X, whose Send email step has no From address of its own. Keep a default From address on the template or set one on the step.\"\n\n- A version that was ever published never changes: later edits save a new version. Call Get publish impact first to see what a publish would change.",
        "tags": [
          "Templates"
        ],
        "x-docs-ids": [
          "publish-template"
        ],
        "parameters": [
          {
            "name": "template_id",
            "in": "path",
            "required": true,
            "description": "The template id or alias.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "object": "template",
                  "id": "34a080c9-b17d-4187-ad80-5af20266e535"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/templates/{template_id}/unpublish": {
      "post": {
        "operationId": "unpublishTemplate",
        "summary": "Unpublish template",
        "description": "Take a template's published version back to a draft, so sends that name the template fail until it is published again.\n\n- send.io extension. Returns 409 `template_in_use` while an automation's Send email step or a transactional email uses the template; the body lists them in `automations` (always an array) and `transactional_emails` (`id`, `name`). Broadcasts never block it: they keep their own copy.",
        "tags": [
          "Templates"
        ],
        "x-docs-ids": [
          "unpublish-template"
        ],
        "parameters": [
          {
            "name": "template_id",
            "in": "path",
            "required": true,
            "description": "The template id or alias.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "object": "template",
                  "id": "34a080c9-b17d-4187-ad80-5af20266e535"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/templates/{template_id}/publish-impact": {
      "get": {
        "operationId": "templatePublishImpact",
        "summary": "Get publish impact",
        "description": "What publishing a version would change for what sends the template now, compared with the version published now. Read only.\n\n- send.io extension. Members may call it. Broadcasts are not listed: they keep the version they were made from.",
        "tags": [
          "Templates"
        ],
        "x-docs-ids": [
          "template-publish-impact"
        ],
        "parameters": [
          {
            "name": "template_id",
            "in": "path",
            "required": true,
            "description": "The template id or alias.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "version",
            "in": "query",
            "required": false,
            "description": "The version to check, by id or `version_number`. Default: the draft (or the published version when there is no draft).",
            "schema": {
              "type": [
                "string",
                "number"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "new_required_variables": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Variables the version requires (used, no fallback) that the published version does not: sends without them will fail with \"Missing template variable\"."
                    },
                    "removed_defaults": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Defaults the published version sets and this one leaves empty: `from`, `subject`, `preview_text` or `reply_to`. Sends that relied on them must pass their own."
                    },
                    "transactional_emails": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          }
                        }
                      },
                      "description": "Transactional emails that use the template (`id`, `name`). They switch to the version within 10 seconds of a publish."
                    },
                    "automations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "blocking": {
                            "type": "boolean"
                          }
                        }
                      },
                      "description": "Automations whose Send email step sends the template (`id`, `name`, `blocking`). `blocking` is true when the publish would be refused, because the step has no From or subject of its own and the version has none."
                    },
                    "recent_template_sends": {
                      "type": "number",
                      "description": "Emails sent with the template in the last 30 days, at most 10,000. Counted only when `removed_defaults` is not empty, otherwise 0."
                    },
                    "object": {
                      "type": "string"
                    },
                    "version_id": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "object": "template_publish_impact",
                  "version_id": "6a1f4c2e-8b3d-4e5f-9a7b-0c1d2e3f4a5b",
                  "new_required_variables": [
                    "ORDER_URL"
                  ],
                  "removed_defaults": [
                    "from"
                  ],
                  "transactional_emails": [
                    {
                      "id": "tx_2hX9Yq1bVv0kq3W4m8sZJt1aB7c",
                      "name": "Order receipt"
                    }
                  ],
                  "automations": [
                    {
                      "id": "5b0f6f2e-3c1d-4a8e-9f7b-2d6c8e1a4b90",
                      "name": "Post-purchase",
                      "blocking": false
                    }
                  ],
                  "recent_template_sends": 1840
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/templates/{template_id}/duplicate": {
      "post": {
        "operationId": "duplicateTemplate",
        "summary": "Duplicate template",
        "description": "Copy a template into a new draft template named \"<name> (copy)\". The alias is not copied.",
        "tags": [
          "Templates"
        ],
        "x-docs-ids": [
          "duplicate-template"
        ],
        "parameters": [
          {
            "name": "template_id",
            "in": "path",
            "required": true,
            "description": "The template id or alias.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "object": "template",
                  "id": "9b8a7c6d-5e4f-4321-a0b9-c8d7e6f5a4b3"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/templates/{template_id}/test": {
      "post": {
        "operationId": "testTemplate",
        "summary": "Send test email",
        "description": "Send the template to up to 5 addresses to check how it looks. Uses the draft if there is one. The subject is prefixed with \"[Test]\" (the template's name stands in when it has no subject).\n\n- send.io extension. Test emails are real sends and count toward your quota.\n\n- Without `from` on a template with no default From: 422 `missing_required_field` \"The `from` field is required: template X has no default From address.\"",
        "tags": [
          "Templates"
        ],
        "x-docs-ids": [
          "test-template"
        ],
        "parameters": [
          {
            "name": "template_id",
            "in": "path",
            "required": true,
            "description": "The template id or alias.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "to": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "1 to 5 recipient addresses."
                  },
                  "variables": {
                    "type": "object",
                    "description": "Values for the template variables.",
                    "properties": {
                      "NAME": {
                        "type": "string"
                      },
                      "ORDER_ID": {
                        "type": "string"
                      }
                    }
                  },
                  "from": {
                    "type": "string",
                    "description": "Sender for the test, on a verified domain of your team. Overrides the template's default From; required when the template has none."
                  },
                  "reply_to": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "Reply-To for the test. Overrides the template's default."
                  }
                },
                "required": [
                  "to"
                ]
              },
              "example": {
                "to": [
                  "ada@acme.com"
                ],
                "from": "Ada <ada@acme.com>",
                "variables": {
                  "NAME": "Ada",
                  "ORDER_ID": "1042"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "id": "4ef9a417-02e9-4d39-ad75-9611e0fcc33c"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/templates/{template_id}/render": {
      "post": {
        "operationId": "renderTemplate",
        "summary": "Render template",
        "description": "Fill a template with variables and return the result, without sending. Uses the same renderer as sends, so missing variables and wrong types fail the same way.\n\n- send.io extension. Returns 422 \"Missing template variable: KEY\" when the content uses a variable that has no value and no fallback, and 422 with the part, line and column when a `handlebars` template cannot render (see Create template).",
        "tags": [
          "Templates"
        ],
        "x-docs-ids": [
          "render-template"
        ],
        "parameters": [
          {
            "name": "template_id",
            "in": "path",
            "required": true,
            "description": "The template id or alias.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "variables": {
                    "type": "object",
                    "description": "Values for the template variables. Fallbacks fill the rest.",
                    "properties": {
                      "NAME": {
                        "type": "string"
                      },
                      "ORDER_ID": {
                        "type": "string"
                      }
                    }
                  },
                  "version_id": {
                    "type": [
                      "string",
                      "number"
                    ],
                    "description": "The version to render, by id or version_number. Defaults to the published version, or the draft when nothing is published yet."
                  },
                  "template_engine": {
                    "type": "string",
                    "description": "Preview the version with `simple` or `handlebars` instead of its own engine."
                  }
                }
              },
              "example": {
                "variables": {
                  "NAME": "Ada",
                  "ORDER_ID": "1042"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "template_id": {
                      "type": "string"
                    },
                    "version_id": {
                      "type": "string"
                    },
                    "template_engine": {
                      "type": "string"
                    },
                    "from": {
                      "type": "string"
                    },
                    "subject": {
                      "type": "string"
                    },
                    "html": {
                      "type": "string"
                    },
                    "text": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "object": "template_render",
                  "template_id": "34a080c9-b17d-4187-ad80-5af20266e535",
                  "version_id": "6a1f4c2e-8b3d-4e5f-9a7b-0c1d2e3f4a5b",
                  "template_engine": "simple",
                  "from": "Ada <ada@acme.com>",
                  "subject": "Receipt for order 1042",
                  "html": "<p>Hi Ada, thanks for order 1042.</p>",
                  "text": ""
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/templates/{template_id}/stats": {
      "get": {
        "operationId": "templateStats",
        "summary": "Template stats",
        "description": "Delivery and engagement of the emails sent with a template in a period: totals and rates, a series per day (or hour), the split by version and the most clicked links.\n\n- send.io extension. The numbers are GET /emails/metrics' numbers for this template's emails: counted by the time an email was created, rates as fractions (open and click rates over delivered, delivery and bounce rates over sent). `bounced_hard` counts permanent bounces. Answers are cached for 30 seconds.\n\n- Counts emails sent with the template through the API (single and batch), transactional emails, automations and account emails. A transactional email's sends therefore count here and in its own stats. Test sends and broadcasts (which copy a template's content) are not counted.\n\n- `per_version` lists the versions that sent in the period, newest first, and the live version even when it sent nothing. `top_links` holds the five most clicked links.\n\n- Returns 422 for a period over 90 days and 404 for an unknown template or version.",
        "tags": [
          "Templates"
        ],
        "x-docs-ids": [
          "template-stats"
        ],
        "parameters": [
          {
            "name": "template_id",
            "in": "path",
            "required": true,
            "description": "The template id or alias.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "Start of the period: a date (`2026-11-01`) or an ISO 8601 timestamp, in `timezone`. Default: 7 days before `to`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "End of the period. A bare date covers that whole day. Default: now. The period is at most 90 days.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "timezone",
            "in": "query",
            "required": false,
            "description": "IANA time zone for the dates and the series. Default `UTC`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "version",
            "in": "query",
            "required": false,
            "description": "Only this version, by id or version_number: narrows `totals`, `daily` and `top_links` (`per_version` always lists every version).",
            "schema": {
              "type": [
                "string",
                "number"
              ]
            }
          },
          {
            "name": "granularity",
            "in": "query",
            "required": false,
            "description": "`daily` (default) or `hourly`: one `daily` entry per day or per hour.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "template_id": {
                      "type": "string"
                    },
                    "range": {
                      "type": "object",
                      "properties": {
                        "from": {
                          "type": "string"
                        },
                        "to": {
                          "type": "string"
                        },
                        "timezone": {
                          "type": "string"
                        },
                        "granularity": {
                          "type": "string"
                        }
                      }
                    },
                    "version": {},
                    "live_version": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "version_number": {
                          "type": "number"
                        },
                        "name": {
                          "type": "string"
                        },
                        "published_at": {
                          "type": "string",
                          "format": "date-time"
                        }
                      }
                    },
                    "totals": {
                      "type": "object",
                      "properties": {
                        "sent": {
                          "type": "number"
                        },
                        "delivered": {
                          "type": "number"
                        },
                        "opened_unique": {
                          "type": "number"
                        },
                        "clicked_unique": {
                          "type": "number"
                        },
                        "bounced": {
                          "type": "number"
                        },
                        "bounced_hard": {
                          "type": "number"
                        },
                        "complaints": {
                          "type": "number"
                        },
                        "delivery_rate": {
                          "type": "number"
                        },
                        "open_rate": {
                          "type": "number"
                        },
                        "click_rate": {
                          "type": "number"
                        },
                        "bounce_rate": {
                          "type": "number"
                        },
                        "hard_bounce_rate": {
                          "type": "number"
                        },
                        "complaint_rate": {
                          "type": "number"
                        }
                      }
                    },
                    "daily": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "date": {
                            "type": "string"
                          },
                          "sent": {
                            "type": "number"
                          },
                          "delivered": {
                            "type": "number"
                          },
                          "opened": {
                            "type": "number"
                          },
                          "clicked": {
                            "type": "number"
                          }
                        }
                      }
                    },
                    "per_version": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "version_id": {
                            "type": "string"
                          },
                          "version_number": {
                            "type": "number"
                          },
                          "name": {
                            "type": "string"
                          },
                          "published_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "deleted": {
                            "type": "boolean"
                          },
                          "live": {
                            "type": "boolean"
                          },
                          "sent": {
                            "type": "number"
                          },
                          "delivered": {
                            "type": "number"
                          },
                          "opened_unique": {
                            "type": "number"
                          },
                          "clicked_unique": {
                            "type": "number"
                          },
                          "open_rate": {
                            "type": "number"
                          },
                          "click_rate": {
                            "type": "number"
                          }
                        }
                      }
                    },
                    "top_links": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "url": {
                            "type": "string"
                          },
                          "clicks": {
                            "type": "number"
                          },
                          "unique_clicks": {
                            "type": "number"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "template_stats",
                  "template_id": "34a080c9-b17d-4187-ad80-5af20266e535",
                  "range": {
                    "from": "2026-11-05T14:00:00Z",
                    "to": "2026-11-12T14:00:00Z",
                    "timezone": "UTC",
                    "granularity": "daily"
                  },
                  "version": null,
                  "live_version": {
                    "id": "6a1f4c2e-8b3d-4e5f-9a7b-0c1d2e3f4a5b",
                    "version_number": 3,
                    "name": "Shorter subject",
                    "published_at": "2026-11-09T14:20:00Z"
                  },
                  "totals": {
                    "sent": 12480,
                    "delivered": 12305,
                    "opened_unique": 5070,
                    "clicked_unique": 1206,
                    "bounced": 137,
                    "bounced_hard": 21,
                    "complaints": 3,
                    "delivery_rate": 0.986,
                    "open_rate": 0.412,
                    "click_rate": 0.098,
                    "bounce_rate": 0.011,
                    "hard_bounce_rate": 0.0017,
                    "complaint_rate": 0.0002
                  },
                  "daily": [
                    {
                      "date": "2026-11-12",
                      "sent": 1830,
                      "delivered": 1804,
                      "opened": 790,
                      "clicked": 180
                    }
                  ],
                  "per_version": [
                    {
                      "version_id": "6a1f4c2e-8b3d-4e5f-9a7b-0c1d2e3f4a5b",
                      "version_number": 3,
                      "name": "Shorter subject",
                      "published_at": "2026-11-09T14:20:00Z",
                      "deleted": false,
                      "live": true,
                      "sent": 4210,
                      "delivered": 4150,
                      "opened_unique": 1826,
                      "clicked_unique": 465,
                      "open_rate": 0.44,
                      "click_rate": 0.112
                    }
                  ],
                  "top_links": [
                    {
                      "url": "https://app.acme.com/dashboard",
                      "clicks": 1102,
                      "unique_clicks": 870
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/templates/{template_id}/versions": {
      "get": {
        "operationId": "listTemplateVersions",
        "summary": "List template versions",
        "description": "Every saved version of a template, newest first. Each create or update of the template saves one.\n\n- send.io extension. `published` marks the version sends use; `draft` marks the newest unpublished edit.",
        "tags": [
          "Templates"
        ],
        "x-docs-ids": [
          "list-template-versions"
        ],
        "parameters": [
          {
            "name": "template_id",
            "in": "path",
            "required": true,
            "description": "The template id or alias.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Number of items to return, from 1 to 100. Default: all versions.",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "object": {
                            "type": "string"
                          },
                          "id": {
                            "type": "string"
                          },
                          "template_id": {
                            "type": "string"
                          },
                          "version_number": {
                            "type": "number"
                          },
                          "name": {
                            "type": "string"
                          },
                          "comment": {
                            "type": "string"
                          },
                          "subject": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "published_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "published": {
                            "type": "boolean"
                          },
                          "draft": {
                            "type": "boolean"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "has_more": false,
                  "data": [
                    {
                      "object": "template_version",
                      "id": "6a1f4c2e-8b3d-4e5f-9a7b-0c1d2e3f4a5b",
                      "template_id": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
                      "version_number": 2,
                      "name": "Shorter subject",
                      "comment": "Tested better in March.",
                      "subject": "Receipt for order {{ORDER_ID}}",
                      "status": "published",
                      "created_at": "2026-10-05T16:22:48.903311+00:00",
                      "published_at": "2026-10-05T16:23:10.004512+00:00",
                      "published": true,
                      "draft": false
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/templates/{template_id}/versions/{version_id}": {
      "get": {
        "operationId": "retrieveTemplateVersion",
        "summary": "Retrieve template version",
        "description": "One version with its full content and variables.\n\n- send.io extension.",
        "tags": [
          "Templates"
        ],
        "x-docs-ids": [
          "retrieve-template-version"
        ],
        "parameters": [
          {
            "name": "template_id",
            "in": "path",
            "required": true,
            "description": "The template id or alias.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "version_id",
            "in": "path",
            "required": true,
            "description": "The version id, or its version_number.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "template_id": {
                      "type": "string"
                    },
                    "version_number": {
                      "type": "number"
                    },
                    "name": {
                      "type": "string"
                    },
                    "comment": {
                      "type": "string"
                    },
                    "subject": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "published_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "published": {
                      "type": "boolean"
                    },
                    "draft": {
                      "type": "boolean"
                    },
                    "from": {
                      "type": "string"
                    },
                    "reply_to": {
                      "type": "array"
                    },
                    "html": {
                      "type": "string"
                    },
                    "text": {},
                    "preview_text": {},
                    "design": {},
                    "template_engine": {
                      "type": "string"
                    },
                    "variables": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "key": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "fallback_value": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updated_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "template_version",
                  "id": "6a1f4c2e-8b3d-4e5f-9a7b-0c1d2e3f4a5b",
                  "template_id": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
                  "version_number": 2,
                  "name": "Shorter subject",
                  "comment": "Tested better in March.",
                  "subject": "Receipt for order {{ORDER_ID}}",
                  "status": "published",
                  "created_at": "2026-10-05T16:22:48.903311+00:00",
                  "published_at": "2026-10-05T16:23:10.004512+00:00",
                  "published": true,
                  "draft": false,
                  "from": "Ada <ada@acme.com>",
                  "reply_to": [],
                  "html": "<p>Hi {{NAME}}, thanks for order {{ORDER_ID}}.</p>",
                  "text": null,
                  "preview_text": null,
                  "design": null,
                  "template_engine": "simple",
                  "variables": [
                    {
                      "id": "f3e2d1c0-b9a8-4776-8564-534231201f0e",
                      "key": "NAME",
                      "type": "string",
                      "fallback_value": "there",
                      "created_at": "2026-10-05T16:22:48.903311+00:00",
                      "updated_at": "2026-10-05T16:22:48.903311+00:00"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "patch": {
        "operationId": "updateTemplateVersion",
        "summary": "Update template version",
        "description": "Rename a version or change its comment. A version's content cannot change: update the template to save a new version.\n\n- send.io extension. Any other field returns 422.",
        "tags": [
          "Templates"
        ],
        "x-docs-ids": [
          "update-template-version"
        ],
        "parameters": [
          {
            "name": "template_id",
            "in": "path",
            "required": true,
            "description": "The template id or alias.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "version_id",
            "in": "path",
            "required": true,
            "description": "The version id, or its version_number.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Version name. At most 100 characters."
                  },
                  "comment": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Version comment. At most 1000 characters."
                  }
                }
              },
              "example": {
                "name": "Shorter subject",
                "comment": "Tested better in March."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "template_id": {
                      "type": "string"
                    },
                    "version_number": {
                      "type": "number"
                    },
                    "name": {
                      "type": "string"
                    },
                    "comment": {
                      "type": "string"
                    },
                    "subject": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "published_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "published": {
                      "type": "boolean"
                    },
                    "draft": {
                      "type": "boolean"
                    },
                    "from": {
                      "type": "string"
                    },
                    "reply_to": {
                      "type": "array"
                    },
                    "html": {
                      "type": "string"
                    },
                    "text": {},
                    "preview_text": {},
                    "design": {},
                    "template_engine": {
                      "type": "string"
                    },
                    "variables": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "key": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "fallback_value": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updated_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "template_version",
                  "id": "6a1f4c2e-8b3d-4e5f-9a7b-0c1d2e3f4a5b",
                  "template_id": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
                  "version_number": 2,
                  "name": "Shorter subject",
                  "comment": "Tested better in March.",
                  "subject": "Receipt for order {{ORDER_ID}}",
                  "status": "published",
                  "created_at": "2026-10-05T16:22:48.903311+00:00",
                  "published_at": "2026-10-05T16:23:10.004512+00:00",
                  "published": true,
                  "draft": false,
                  "from": "Ada <ada@acme.com>",
                  "reply_to": [],
                  "html": "<p>Hi {{NAME}}, thanks for order {{ORDER_ID}}.</p>",
                  "text": null,
                  "preview_text": null,
                  "design": null,
                  "template_engine": "simple",
                  "variables": [
                    {
                      "id": "f3e2d1c0-b9a8-4776-8564-534231201f0e",
                      "key": "NAME",
                      "type": "string",
                      "fallback_value": "there",
                      "created_at": "2026-10-05T16:22:48.903311+00:00",
                      "updated_at": "2026-10-05T16:22:48.903311+00:00"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "delete": {
        "operationId": "deleteTemplateVersion",
        "summary": "Delete template version",
        "description": "Remove a version from the list. Emails already sent from it keep their history. Deleting the draft discards the unpublished changes.\n\n- send.io extension. Returns 409 for the published version (activate another one first) and for the only version of a template that was never published.",
        "tags": [
          "Templates"
        ],
        "x-docs-ids": [
          "delete-template-version"
        ],
        "parameters": [
          {
            "name": "template_id",
            "in": "path",
            "required": true,
            "description": "The template id or alias.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "version_id",
            "in": "path",
            "required": true,
            "description": "The version id, or its version_number.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "deleted": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "object": "template_version",
                  "id": "6a1f4c2e-8b3d-4e5f-9a7b-0c1d2e3f4a5b",
                  "deleted": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/templates/{template_id}/versions/{version_id}/activate": {
      "post": {
        "operationId": "activateTemplateVersion",
        "summary": "Activate template version",
        "description": "Make this version the published one, so sends use it. Use it to roll back to an earlier version. The same rules as Publish template apply: the version needs content, and its From and subject are optional.\n\n- send.io extension. Activating an older version leaves a newer draft in place; activating the draft is the same as publishing.\n\n- Transactional emails that use the template switch to the version within 10 seconds. Call Get publish impact with `version` first to see what changes.",
        "tags": [
          "Templates"
        ],
        "x-docs-ids": [
          "activate-template-version"
        ],
        "parameters": [
          {
            "name": "template_id",
            "in": "path",
            "required": true,
            "description": "The template id or alias.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "version_id",
            "in": "path",
            "required": true,
            "description": "The version id, or its version_number.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "template_id": {
                      "type": "string"
                    },
                    "version_number": {
                      "type": "number"
                    },
                    "name": {
                      "type": "string"
                    },
                    "comment": {
                      "type": "string"
                    },
                    "subject": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "published_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "published": {
                      "type": "boolean"
                    },
                    "draft": {
                      "type": "boolean"
                    },
                    "from": {
                      "type": "string"
                    },
                    "reply_to": {
                      "type": "array"
                    },
                    "html": {
                      "type": "string"
                    },
                    "text": {},
                    "preview_text": {},
                    "design": {},
                    "template_engine": {
                      "type": "string"
                    },
                    "variables": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "key": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "fallback_value": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updated_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "template_version",
                  "id": "6a1f4c2e-8b3d-4e5f-9a7b-0c1d2e3f4a5b",
                  "template_id": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
                  "version_number": 2,
                  "name": "Shorter subject",
                  "comment": "Tested better in March.",
                  "subject": "Receipt for order {{ORDER_ID}}",
                  "status": "published",
                  "created_at": "2026-10-05T16:22:48.903311+00:00",
                  "published_at": "2026-10-05T16:23:10.004512+00:00",
                  "published": true,
                  "draft": false,
                  "from": "Ada <ada@acme.com>",
                  "reply_to": [],
                  "html": "<p>Hi {{NAME}}, thanks for order {{ORDER_ID}}.</p>",
                  "text": null,
                  "preview_text": null,
                  "design": null,
                  "template_engine": "simple",
                  "variables": [
                    {
                      "id": "f3e2d1c0-b9a8-4776-8564-534231201f0e",
                      "key": "NAME",
                      "type": "string",
                      "fallback_value": "there",
                      "created_at": "2026-10-05T16:22:48.903311+00:00",
                      "updated_at": "2026-10-05T16:22:48.903311+00:00"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/audience/stats": {
      "get": {
        "operationId": "getAudienceStats",
        "summary": "Get audience stats",
        "description": "Counts for the whole audience: contacts, subscribed and unsubscribed, then the contacts and subscribed contacts of each segment and the subscribers of each topic, newest first.\n\n- send.io extension. The numbers can be up to 10 seconds old.",
        "tags": [
          "Contacts"
        ],
        "x-docs-ids": [
          "get-audience-stats"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "contacts": {
                      "type": "number"
                    },
                    "subscribed": {
                      "type": "number"
                    },
                    "unsubscribed": {
                      "type": "number"
                    },
                    "segments": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "contacts": {
                            "type": "number"
                          },
                          "subscribed": {
                            "type": "number"
                          }
                        }
                      }
                    },
                    "topics": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "subscribers": {
                            "type": "number"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "audience_stats",
                  "contacts": 1250,
                  "subscribed": 1198,
                  "unsubscribed": 52,
                  "segments": [
                    {
                      "id": "b7e4c2a1-5d3f-4e8b-9a6c-1f2e3d4c5b6a",
                      "name": "Paying customers",
                      "contacts": 310,
                      "subscribed": 301
                    }
                  ],
                  "topics": [
                    {
                      "id": "c8f5d3b2-6e4a-4f9c-8b7d-2a3b4c5d6e7f",
                      "name": "Product updates",
                      "subscribers": 1120
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/contacts": {
      "post": {
        "operationId": "createContact",
        "summary": "Create contact",
        "description": "Create a contact. You can add it to segments and set its topic subscriptions in the same call.\n\n- A second contact with the same email (case-insensitive) fails with 409 and \"A contact with this email already exists.\"\n\n- Property keys must already exist; an unknown key or a value of the wrong type fails the whole call with 422. On a `string` or `number` property, boolean values are accepted and stored as given.\n\n- A value a `boolean` or `date` property cannot read fails the whole call with 422 `validation_error` naming the property, with or without `create_missing_properties`. A number is not accepted as a date.\n\n- With `create_missing_properties: true`, the response also lists the properties it created as `created_properties: [{ key, type }]`.\n\n- `segments` and `audience_id` take manual segments only. A rule-based segment is refused with 422 `validation_error` \"This segment is rule-based: its members are decided by its rule.\" Its members are added and removed by its rule.",
        "tags": [
          "Contacts"
        ],
        "x-docs-ids": [
          "create-contact"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "description": "Email address. Must be unique within your team."
                  },
                  "first_name": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "First name. At most 200 characters; a longer one is refused with 422 `validation_error`, never cut short."
                  },
                  "last_name": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Last name. At most 200 characters; a longer one is refused with 422 `validation_error`, never cut short."
                  },
                  "unsubscribed": {
                    "type": "boolean",
                    "description": "Whether the contact is unsubscribed from all broadcasts. Defaults to false."
                  },
                  "properties": {
                    "type": "object",
                    "description": "Custom property values keyed by property key. Each key must exist (create it with Create contact property) and the value must match its type, unless `create_missing_properties` is true. A `boolean` property takes true, false, or the text \"true\" or \"false\" (any case). A `date` property takes an RFC 3339 time (2026-01-31T09:30:00Z), a time without a zone (2026-01-31T09:30:00, read as UTC) or a day (2026-01-31, read as 00:00 UTC); it is stored and returned as RFC 3339 in UTC. A string value is at most 2,000 characters; a longer one is refused with 422 `validation_error` naming the property.",
                    "properties": {
                      "company": {
                        "type": "string"
                      },
                      "seats": {
                        "type": "number"
                      }
                    }
                  },
                  "create_missing_properties": {
                    "type": "boolean",
                    "description": "send.io extension. When true, a key in `properties` with no contact property yet creates one instead of failing: `number` for a number value, otherwise `string` (booleans are stored as given, ISO dates as text). A property made this way is never `boolean` or `date`; create those with Create contact property. Values are also converted to an existing `string` or `number` property's type when that is unambiguous, such as \"42\" for a number property. Defaults to false."
                  },
                  "segments": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "Segment id."
                        },
                        "status": {
                          "type": "string",
                          "description": "send.io extension. The contact's status in this segment: `subscribed` (the default), `unsubscribed`, `cleaned` or `pending`."
                        }
                      },
                      "required": [
                        "id"
                      ]
                    },
                    "description": "Segments to add the contact to, as `[{ id }]`. Manual segments only: a rule-based segment is a 422."
                  },
                  "topics": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "Topic id."
                        },
                        "subscription": {
                          "type": "string",
                          "description": "`opt_in` or `opt_out`."
                        }
                      },
                      "required": [
                        "id",
                        "subscription"
                      ]
                    },
                    "description": "Topic subscriptions, as `[{ id, subscription }]`."
                  },
                  "audience_id": {
                    "type": "string",
                    "description": "Older way to add the contact to one segment. Cannot be combined with `segments` or `topics`."
                  }
                },
                "required": [
                  "email"
                ]
              },
              "example": {
                "email": "steve.wozniak@acme.com",
                "first_name": "Steve",
                "last_name": "Wozniak",
                "unsubscribed": false,
                "properties": {
                  "company": "Acme",
                  "seats": 25
                },
                "segments": [
                  {
                    "id": "78261eea-8f8b-4381-83c6-79fa7120f1cf"
                  }
                ],
                "topics": [
                  {
                    "id": "b6d24b8e-af0b-4c3c-be0c-359bbd97381e",
                    "subscription": "opt_in"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "object": "contact",
                  "id": "4f3c2a1e-8b6d-4e2f-9a7c-1d5e3b8f6a20"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "get": {
        "operationId": "listContacts",
        "summary": "List contacts",
        "description": "List contacts, newest first. Filter by segment, topic, status or a search term.\n\n- send.io extension: the `search`, `status` and `topic_id` filters.\n\n- List items do not include `properties`; retrieve a contact to get them.",
        "tags": [
          "Contacts"
        ],
        "x-docs-ids": [
          "list-contacts"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Number of items to return, 1 to 100. When omitted, all items are returned.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "Return items after this id (the next page). Cannot be used with `before`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "description": "Return items before this id (the previous page). Cannot be used with `after`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "segment_id",
            "in": "query",
            "required": false,
            "description": "Only contacts in this segment.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "audience_id",
            "in": "query",
            "required": false,
            "description": "Same as `segment_id`, for older SDKs. Ignored when `segment_id` is set.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Case-insensitive match on email or full name.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "`subscribed` or `unsubscribed`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "topic_id",
            "in": "query",
            "required": false,
            "description": "Only contacts whose effective subscription to this topic is `opt_in`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "email": {
                            "type": "string"
                          },
                          "first_name": {
                            "type": "string"
                          },
                          "last_name": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "unsubscribed": {
                            "type": "boolean"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "has_more": false,
                  "data": [
                    {
                      "id": "4f3c2a1e-8b6d-4e2f-9a7c-1d5e3b8f6a20",
                      "email": "steve.wozniak@acme.com",
                      "first_name": "Steve",
                      "last_name": "Wozniak",
                      "created_at": "2026-10-07T09:15:22.481203+00:00",
                      "unsubscribed": false
                    },
                    {
                      "id": "a81b6c2d-3e4f-4a5b-8c7d-9e0f1a2b3c4d",
                      "email": "ada.lovelace@acme.com",
                      "first_name": "Ada",
                      "last_name": null,
                      "created_at": "2026-10-05T14:02:10.117845+00:00",
                      "unsubscribed": true
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/contacts/{contact_id}": {
      "get": {
        "operationId": "getContact",
        "summary": "Retrieve contact",
        "description": "Get a contact by id or by email address.\n\n- `properties` lists only the properties set on the contact, each as `{ value, type }`. `type` is `string`, `number`, `boolean` or `date`; a boolean value is true or false and a date value an RFC 3339 time in UTC.\n\n- A request whose `User-Agent` starts with `resend-` (Resend's own SDKs, which only know `string` and `number`) is shown `boolean` and `date` properties as `type: \"string\"`, and boolean values as the text `\"true\"` or `\"false\"`. Every other client, send.io's SDKs included, gets the real types.",
        "tags": [
          "Contacts"
        ],
        "x-docs-ids": [
          "get-contact"
        ],
        "parameters": [
          {
            "name": "contact_id",
            "in": "path",
            "required": true,
            "description": "The contact id or the contact's email address.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "email": {
                      "type": "string"
                    },
                    "first_name": {
                      "type": "string"
                    },
                    "last_name": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "unsubscribed": {
                      "type": "boolean"
                    },
                    "properties": {
                      "type": "object",
                      "properties": {
                        "company": {
                          "type": "object",
                          "properties": {
                            "value": {
                              "type": "string"
                            },
                            "type": {
                              "type": "string"
                            }
                          }
                        },
                        "seats": {
                          "type": "object",
                          "properties": {
                            "value": {
                              "type": "number"
                            },
                            "type": {
                              "type": "string"
                            }
                          }
                        },
                        "vip": {
                          "type": "object",
                          "properties": {
                            "value": {
                              "type": "boolean"
                            },
                            "type": {
                              "type": "string"
                            }
                          }
                        },
                        "renews_at": {
                          "type": "object",
                          "properties": {
                            "value": {
                              "type": "string"
                            },
                            "type": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "contact",
                  "id": "4f3c2a1e-8b6d-4e2f-9a7c-1d5e3b8f6a20",
                  "email": "steve.wozniak@acme.com",
                  "first_name": "Steve",
                  "last_name": "Wozniak",
                  "created_at": "2026-10-07T09:15:22.481203+00:00",
                  "unsubscribed": false,
                  "properties": {
                    "company": {
                      "value": "Acme",
                      "type": "string"
                    },
                    "seats": {
                      "value": 25,
                      "type": "number"
                    },
                    "vip": {
                      "value": true,
                      "type": "boolean"
                    },
                    "renews_at": {
                      "value": "2027-01-31T00:00:00Z",
                      "type": "date"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "patch": {
        "operationId": "updateContact",
        "summary": "Update contact",
        "description": "Update a contact by id or by email address. Only the fields you send change.\n\n- The email of a contact cannot be changed. Sending a different `email` fails with 422.\n\n- With `create_missing_properties: true`, the response also lists the properties it created as `created_properties: [{ key, type }]`.",
        "tags": [
          "Contacts"
        ],
        "x-docs-ids": [
          "update-contact"
        ],
        "parameters": [
          {
            "name": "contact_id",
            "in": "path",
            "required": true,
            "description": "The contact id or the contact's email address.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "first_name": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "First name. At most 200 characters; a longer one is refused with 422 `validation_error`, never cut short. Send null to clear it."
                  },
                  "last_name": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Last name. At most 200 characters; a longer one is refused with 422 `validation_error`, never cut short. Send null to clear it."
                  },
                  "unsubscribed": {
                    "type": "boolean",
                    "description": "Whether the contact is unsubscribed from all broadcasts. Must be a boolean."
                  },
                  "properties": {
                    "type": "object",
                    "description": "Property values to set, merged into the existing ones. Send null for a key to remove it from the contact. `boolean` and `date` properties take the same values as on Create contact. A string value is at most 2,000 characters (422 `validation_error` otherwise).",
                    "properties": {
                      "seats": {
                        "type": "number"
                      },
                      "company": {}
                    }
                  },
                  "create_missing_properties": {
                    "type": "boolean",
                    "description": "send.io extension. When true, a key in `properties` with no contact property yet creates one instead of failing: `number` for a number value, otherwise `string` (booleans are stored as given, ISO dates as text). A property made this way is never `boolean` or `date`; create those with Create contact property. Values are also converted to an existing `string` or `number` property's type when that is unambiguous, such as \"42\" for a number property. Defaults to false."
                  }
                }
              },
              "example": {
                "first_name": "Stephen",
                "unsubscribed": true,
                "properties": {
                  "seats": 40,
                  "company": null
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "object": "contact",
                  "id": "4f3c2a1e-8b6d-4e2f-9a7c-1d5e3b8f6a20"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "delete": {
        "operationId": "deleteContact",
        "summary": "Delete contact",
        "description": "Permanently delete a contact by id or by email address. It is removed from every segment.",
        "tags": [
          "Contacts"
        ],
        "x-docs-ids": [
          "delete-contact"
        ],
        "parameters": [
          {
            "name": "contact_id",
            "in": "path",
            "required": true,
            "description": "The contact id or the contact's email address.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "contact": {
                      "type": "string"
                    },
                    "deleted": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "object": "contact",
                  "contact": "4f3c2a1e-8b6d-4e2f-9a7c-1d5e3b8f6a20",
                  "deleted": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/contacts/{contact_id}/segments": {
      "get": {
        "operationId": "listContactSegments",
        "summary": "List contact segments",
        "description": "List the segments a contact belongs to, with its status in each (send.io extension).\n\n- `type` is `manual` or `rule`. A rule-based segment lists the contact while its rule matches it.",
        "tags": [
          "Contacts"
        ],
        "x-docs-ids": [
          "list-contact-segments"
        ],
        "parameters": [
          {
            "name": "contact_id",
            "in": "path",
            "required": true,
            "description": "The contact id or the contact's email address.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Number of items to return, 1 to 100. Defaults to 20.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "Return items after this id (the next page). Cannot be used with `before`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "description": "Return items before this id (the previous page). Cannot be used with `after`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "type": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "status_changed_at": {
                            "type": [
                              "null",
                              "string"
                            ],
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "has_more": false,
                  "data": [
                    {
                      "id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
                      "name": "Registered users",
                      "created_at": "2026-10-07T09:15:22.481203+00:00",
                      "type": "manual",
                      "status": "subscribed",
                      "status_changed_at": null
                    },
                    {
                      "id": "d2b7f4e1-6a3c-4e8d-b1f5-9c0a2e4d6b8f",
                      "name": "Dormant pros",
                      "created_at": "2026-10-05T14:02:10.117845+00:00",
                      "type": "rule",
                      "status": "unsubscribed",
                      "status_changed_at": "2026-10-06T08:12:40.203114+00:00"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/contacts/{contact_id}/segments/{segment_id}": {
      "post": {
        "operationId": "addContactToSegment",
        "summary": "Add contact to segment",
        "description": "Add a contact to a segment. Adding a contact that is already in the segment succeeds and changes nothing.\n\n- `id` is the segment's id (kept for existing clients); `contact_id` and `segment_id` name both sides.\n\n- A rule-based segment is refused with 422 `validation_error` \"This segment is rule-based: its members are decided by its rule.\" Its members are added and removed by its rule.",
        "tags": [
          "Contacts"
        ],
        "x-docs-ids": [
          "add-contact-to-segment"
        ],
        "parameters": [
          {
            "name": "contact_id",
            "in": "path",
            "required": true,
            "description": "The contact id or the contact's email address.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "segment_id",
            "in": "path",
            "required": true,
            "description": "The segment id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "contact_id": {
                      "type": "string"
                    },
                    "segment_id": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "object": "contact_segment",
                  "id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
                  "contact_id": "4f3c2a1e-8b6d-4e2f-9a7c-1d5e3b8f6a20",
                  "segment_id": "78261eea-8f8b-4381-83c6-79fa7120f1cf"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "delete": {
        "operationId": "removeContactFromSegment",
        "summary": "Remove contact from segment",
        "description": "Remove a contact from a segment. The contact itself is kept.\n\n- `id` is the contact's id and `audienceId` the segment's (both kept for existing clients); `contact_id` and `segment_id` name both sides.\n\n- Fails with 404 \"The contact is not in this segment.\" when the contact is not a member.\n\n- A rule-based segment is refused with 422 `validation_error` \"This segment is rule-based: its members are decided by its rule.\" Its members are added and removed by its rule.",
        "tags": [
          "Contacts"
        ],
        "x-docs-ids": [
          "remove-contact-from-segment"
        ],
        "parameters": [
          {
            "name": "contact_id",
            "in": "path",
            "required": true,
            "description": "The contact id or the contact's email address.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "segment_id",
            "in": "path",
            "required": true,
            "description": "The segment id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "audienceId": {
                      "type": "string"
                    },
                    "contact_id": {
                      "type": "string"
                    },
                    "segment_id": {
                      "type": "string"
                    },
                    "deleted": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "object": "contact_segment",
                  "id": "4f3c2a1e-8b6d-4e2f-9a7c-1d5e3b8f6a20",
                  "audienceId": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
                  "contact_id": "4f3c2a1e-8b6d-4e2f-9a7c-1d5e3b8f6a20",
                  "segment_id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
                  "deleted": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/contacts/{contact_id}/topics": {
      "get": {
        "operationId": "getContactTopics",
        "summary": "Retrieve contact topics",
        "description": "List every topic with the contact's subscription to it. When the contact has no choice saved, the topic's default subscription is shown.",
        "tags": [
          "Contacts"
        ],
        "x-docs-ids": [
          "get-contact-topics"
        ],
        "parameters": [
          {
            "name": "contact_id",
            "in": "path",
            "required": true,
            "description": "The contact id or the contact's email address.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Number of items to return, 1 to 100. Defaults to 20.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "Return items after this id (the next page). Cannot be used with `before`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "description": "Return items before this id (the previous page). Cannot be used with `after`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "description": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "subscription": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "has_more": false,
                  "data": [
                    {
                      "id": "b6d24b8e-af0b-4c3c-be0c-359bbd97381e",
                      "name": "Product updates",
                      "description": "New features and changes, about once a month.",
                      "subscription": "opt_in"
                    },
                    {
                      "id": "e2a9c7f1-5d3b-4a8e-b6c4-0f7d1e2a3b9c",
                      "name": "Events",
                      "description": null,
                      "subscription": "opt_out"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "patch": {
        "operationId": "updateContactTopics",
        "summary": "Update contact topics",
        "description": "Set a contact's subscription to one or more topics. Topics you do not list are left as they are.",
        "tags": [
          "Contacts"
        ],
        "x-docs-ids": [
          "update-contact-topics"
        ],
        "parameters": [
          {
            "name": "contact_id",
            "in": "path",
            "required": true,
            "description": "The contact id or the contact's email address.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "topics": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "Topic id."
                        },
                        "subscription": {
                          "type": "string",
                          "description": "`opt_in` or `opt_out`."
                        }
                      },
                      "required": [
                        "id",
                        "subscription"
                      ]
                    },
                    "description": "The subscriptions to set. A bare array of the same objects is also accepted as the body."
                  }
                },
                "required": [
                  "topics"
                ]
              },
              "example": {
                "topics": [
                  {
                    "id": "b6d24b8e-af0b-4c3c-be0c-359bbd97381e",
                    "subscription": "opt_out"
                  },
                  {
                    "id": "e2a9c7f1-5d3b-4a8e-b6c4-0f7d1e2a3b9c",
                    "subscription": "opt_in"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "object": "contact_topics",
                  "id": "4f3c2a1e-8b6d-4e2f-9a7c-1d5e3b8f6a20"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/contacts/imports": {
      "post": {
        "operationId": "createContactImport",
        "summary": "Import contacts",
        "description": "Upload a CSV file of contacts, or create the import with `upload` = `url` (the example) and PUT the file to its `upload_url` next. The import runs in the background in batches of 1,000 rows; check its progress with Retrieve contact import. A row that cannot be imported (an invalid address, a first or last name over 200 characters, a string property value over 2,000 characters, a value a number property cannot hold) is not imported and is counted in `failed`; values are never cut short. With `start=false` the import is staged instead: the file is stored and nothing runs until Start contact import.\n\n- send.io extension.\n\n- Send the request as multipart/form-data. Without a file (`upload` = `url`) a JSON body with the same fields works too.\n\n- Every column named in `column_map` must exist in the file. A staged import shows the file's first row as `columns`, to map against.\n\n- Rows with an invalid email count as `failed`. In the `unsubscribed` column, true, 1, yes and y mean unsubscribed.\n\n- With `upload` = `url` the answer has `upload_url` (valid while the import is staged, 24 hours; one upload). PUT the CSV there as the raw body; gzip is accepted.",
        "tags": [
          "Contacts"
        ],
        "x-docs-ids": [
          "create-contact-import"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "contentMediaType": "application/octet-stream",
                    "description": "The CSV file. At most 200 MB. Required unless `upload` is `url`."
                  },
                  "column_map": {
                    "type": "string",
                    "description": "Maps contact fields to CSV columns, e.g. {\"email\":\"Email\",\"first_name\":\"First name\"}: header names, or zero-based column positions ({\"email\":0}). `email` is required; `first_name`, `last_name` and `unsubscribed` are optional. Required unless `start` is false (then give it to Start contact import).",
                    "properties": {
                      "properties": {
                        "type": "object",
                        "description": "Property columns, as {\"<property key>\": {\"column\": \"<CSV column>\"}}. Only properties that already exist are imported. For an existing `boolean` or `date` property the cell must be true or false, or a day (2026-01-31) or time (2026-01-31T09:30:00Z); a row with another value fails with that reason."
                      },
                      "email": {
                        "type": "string"
                      },
                      "first_name": {
                        "type": "string"
                      }
                    }
                  },
                  "start": {
                    "type": "boolean",
                    "description": "`false` stages the import (status `staged`, kept 24 hours) until Start contact import. Defaults to `true`."
                  },
                  "file_url": {
                    "type": "string",
                    "description": "Instead of `file`: a public https URL of the CSV, which send.io downloads now (at most 50 MB, status 200 without a redirect or sign-in, 20 an hour per team). For larger files use `upload`."
                  },
                  "upload": {
                    "type": "string",
                    "description": "`url`: send no file; the answer's `upload_url` takes it later as a plain PUT, without an API key. With `start` true (the default) the import starts when the file arrives."
                  },
                  "has_header": {
                    "type": "boolean",
                    "description": "`false` when the first row is data. column_map then uses column positions. Defaults to `true`."
                  },
                  "delimiter": {
                    "type": "string",
                    "description": "`,` `;` `|` or `tab`. Guessed from the first line when omitted."
                  },
                  "unsubscribed": {
                    "type": "boolean",
                    "description": "Give every imported contact this subscription state (instead of an `unsubscribed` column)."
                  },
                  "create_missing_properties": {
                    "type": "boolean",
                    "description": "Create the properties column_map.properties names that do not exist yet (as strings, or numbers with \"type\":\"number\"). A property made by an import is never `boolean` or `date`: create those first with Create contact property."
                  },
                  "source": {
                    "type": "string",
                    "description": "A label stored on the import (lowercase letters, digits, `_ . : -`, at most 40). Defaults to `api`."
                  },
                  "on_conflict": {
                    "type": "string",
                    "description": "What to do when a contact with the email exists: `upsert` (update it) or `skip`. Defaults to `upsert`."
                  },
                  "segments": {
                    "type": "string",
                    "description": "Segments to add every imported contact to, as [{\"id\":\"...\"}] or [\"...\"] (segment ids). Manual segments only: a rule-based segment is a 422."
                  },
                  "topics": {
                    "type": "string",
                    "description": "Topic subscriptions to set on every imported contact, as [{\"id\":\"...\",\"subscription\":\"opt_in\"}]."
                  }
                }
              },
              "example": {
                "upload": "url",
                "column_map": {
                  "email": "Email",
                  "first_name": "First name"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "completed_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    },
                    "counts": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "number"
                        },
                        "created": {
                          "type": "number"
                        },
                        "updated": {
                          "type": "number"
                        },
                        "skipped": {
                          "type": "number"
                        },
                        "failed": {
                          "type": "number"
                        }
                      }
                    },
                    "error": {},
                    "source": {
                      "type": "string"
                    },
                    "column_map": {
                      "type": "object",
                      "properties": {
                        "email": {
                          "type": "string"
                        },
                        "first_name": {
                          "type": "string"
                        }
                      }
                    },
                    "segments": {
                      "type": "array"
                    },
                    "topics": {
                      "type": "array"
                    },
                    "on_conflict": {
                      "type": "string"
                    },
                    "unsubscribed": {},
                    "columns": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "delimiter": {
                      "type": "string"
                    },
                    "has_header": {
                      "type": "boolean"
                    },
                    "file_received": {
                      "type": "boolean"
                    },
                    "start_on_upload": {
                      "type": "boolean"
                    },
                    "expires_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "upload_url": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "object": "contact_import",
                  "id": "3a9e7c5b-1f2d-4e6a-8b0c-7d9f1a3c5e2b",
                  "status": "staged",
                  "created_at": "2026-10-07T09:15:22.481203+00:00",
                  "completed_at": null,
                  "counts": {
                    "total": 0,
                    "created": 0,
                    "updated": 0,
                    "skipped": 0,
                    "failed": 0
                  },
                  "error": null,
                  "source": "api",
                  "column_map": {
                    "email": "Email",
                    "first_name": "First name"
                  },
                  "segments": [],
                  "topics": [],
                  "on_conflict": "upsert",
                  "unsubscribed": null,
                  "columns": [
                    "Email",
                    "First name",
                    "Plan"
                  ],
                  "delimiter": ",",
                  "has_header": true,
                  "file_received": true,
                  "start_on_upload": false,
                  "expires_at": "2026-10-08T09:15:22.481203+00:00",
                  "upload_url": "https://api.send.io/uploads/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwdXJwb3NlIjoiaW1wb3J0X3VwbG9hZCJ9.4kq..."
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "get": {
        "operationId": "listContactImports",
        "summary": "List contact imports",
        "description": "List the workspace's contact imports, newest first, with their status and row counts (the console's Contacts > Imports). The list leaves out `failed_rows`; retrieve one import to get them.\n\n- send.io extension.",
        "tags": [
          "Contacts"
        ],
        "x-docs-ids": [
          "list-contact-imports"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Number of items to return, 1 to 100. Defaults to 20.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "Return items after this id (the next page). Cannot be used with `before`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "description": "Return items before this id (the previous page). Cannot be used with `after`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Only imports with this status: `staged`, `queued`, `in_progress`, `completed` or `failed`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "object": {
                            "type": "string"
                          },
                          "id": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "completed_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "counts": {
                            "type": "object",
                            "properties": {
                              "total": {
                                "type": "number"
                              },
                              "created": {
                                "type": "number"
                              },
                              "updated": {
                                "type": "number"
                              },
                              "skipped": {
                                "type": "number"
                              },
                              "failed": {
                                "type": "number"
                              }
                            }
                          },
                          "error": {},
                          "source": {
                            "type": "string"
                          },
                          "column_map": {
                            "type": "object",
                            "properties": {
                              "email": {
                                "type": "string"
                              },
                              "first_name": {
                                "type": "string"
                              }
                            }
                          },
                          "segments": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                }
                              }
                            }
                          },
                          "topics": {
                            "type": "array"
                          },
                          "on_conflict": {
                            "type": "string"
                          },
                          "unsubscribed": {},
                          "columns": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "delimiter": {
                            "type": "string"
                          },
                          "has_header": {
                            "type": "boolean"
                          },
                          "file_received": {
                            "type": "boolean"
                          },
                          "start_on_upload": {
                            "type": "boolean"
                          },
                          "expires_at": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "has_more": false,
                  "data": [
                    {
                      "object": "contact_import",
                      "id": "3a9e7c5b-1f2d-4e6a-8b0c-7d9f1a3c5e2b",
                      "status": "completed",
                      "created_at": "2026-10-07T09:15:22.481203+00:00",
                      "completed_at": "2026-10-07T09:15:31.902114+00:00",
                      "counts": {
                        "total": 1200,
                        "created": 1150,
                        "updated": 40,
                        "skipped": 0,
                        "failed": 10
                      },
                      "error": null,
                      "source": "api",
                      "column_map": {
                        "email": "Email",
                        "first_name": "First name"
                      },
                      "segments": [
                        {
                          "id": "78261eea-8f8b-4381-83c6-79fa7120f1cf"
                        }
                      ],
                      "topics": [],
                      "on_conflict": "upsert",
                      "unsubscribed": null,
                      "columns": [
                        "Email",
                        "First name",
                        "Plan"
                      ],
                      "delimiter": ",",
                      "has_header": true,
                      "file_received": true,
                      "start_on_upload": false,
                      "expires_at": null
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/contacts/imports/{import_id}": {
      "get": {
        "operationId": "getContactImport",
        "summary": "Retrieve contact import",
        "description": "Get the status, options and row counts of a contact import. `status` is `staged`, `queued`, `in_progress`, `completed` or `failed`; `error` explains a failure. A staged import waiting for its file has its `upload_url`. With `verify`, `verification` counts the imported addresses by verification result (`pending`, `valid`, `invalid`, `risky`, `unknown`) and says whether verification is `paused` for lack of credits; it is null without `verify`. `failed_rows` lists the first 1,000 rows that were not imported, each with its `line` in the file, its `email` and the `reason`.\n\n- send.io extension.",
        "tags": [
          "Contacts"
        ],
        "x-docs-ids": [
          "get-contact-import"
        ],
        "parameters": [
          {
            "name": "import_id",
            "in": "path",
            "required": true,
            "description": "The import id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "completed_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "counts": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "number"
                        },
                        "created": {
                          "type": "number"
                        },
                        "updated": {
                          "type": "number"
                        },
                        "skipped": {
                          "type": "number"
                        },
                        "failed": {
                          "type": "number"
                        }
                      }
                    },
                    "error": {},
                    "source": {
                      "type": "string"
                    },
                    "column_map": {
                      "type": "object",
                      "properties": {
                        "email": {
                          "type": "string"
                        },
                        "first_name": {
                          "type": "string"
                        }
                      }
                    },
                    "segments": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "topics": {
                      "type": "array"
                    },
                    "on_conflict": {
                      "type": "string"
                    },
                    "unsubscribed": {},
                    "columns": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "delimiter": {
                      "type": "string"
                    },
                    "has_header": {
                      "type": "boolean"
                    },
                    "file_received": {
                      "type": "boolean"
                    },
                    "start_on_upload": {
                      "type": "boolean"
                    },
                    "expires_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    },
                    "failed_rows": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "line": {
                            "type": "number"
                          },
                          "email": {
                            "type": "string"
                          },
                          "reason": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "contact_import",
                  "id": "3a9e7c5b-1f2d-4e6a-8b0c-7d9f1a3c5e2b",
                  "status": "completed",
                  "created_at": "2026-10-07T09:15:22.481203+00:00",
                  "completed_at": "2026-10-07T09:15:31.902114+00:00",
                  "counts": {
                    "total": 1200,
                    "created": 1150,
                    "updated": 40,
                    "skipped": 0,
                    "failed": 10
                  },
                  "error": null,
                  "source": "api",
                  "column_map": {
                    "email": "Email",
                    "first_name": "First name"
                  },
                  "segments": [
                    {
                      "id": "78261eea-8f8b-4381-83c6-79fa7120f1cf"
                    }
                  ],
                  "topics": [],
                  "on_conflict": "upsert",
                  "unsubscribed": null,
                  "columns": [
                    "Email",
                    "First name",
                    "Plan"
                  ],
                  "delimiter": ",",
                  "has_header": true,
                  "file_received": true,
                  "start_on_upload": false,
                  "expires_at": null,
                  "failed_rows": [
                    {
                      "line": 14,
                      "email": "ada@example.com",
                      "reason": "first_name must be at most 200 characters."
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/contacts/imports/{import_id}/start": {
      "post": {
        "operationId": "startContactImport",
        "summary": "Start contact import",
        "description": "Start a staged import. Every field is optional and replaces what the import was created with; the import is queued and runs like any other. If its file has not arrived at `upload_url` yet, it starts when it does.\n\n- send.io extension.\n\n- Only a `staged` import can be started (409 otherwise). A staged import not started within 24 hours is deleted with its file (404).",
        "tags": [
          "Contacts"
        ],
        "x-docs-ids": [
          "start-contact-import"
        ],
        "parameters": [
          {
            "name": "import_id",
            "in": "path",
            "required": true,
            "description": "The import id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "column_map": {
                    "type": "object",
                    "description": "As on Import contacts (header names or zero-based positions). Required if the import has none yet.",
                    "properties": {
                      "email": {
                        "type": "string"
                      },
                      "first_name": {
                        "type": "string"
                      },
                      "properties": {
                        "type": "object",
                        "properties": {
                          "plan": {
                            "type": "object",
                            "properties": {
                              "column": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    }
                  },
                  "segments": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        }
                      }
                    },
                    "description": "Segments to add every imported contact to, as [{\"id\":\"...\"}] or [\"...\"] (segment ids). Manual segments only: a rule-based segment is a 422."
                  },
                  "topics": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    },
                    "description": "Topic subscriptions to set, as [{\"id\":\"...\",\"subscription\":\"opt_in\"}]."
                  },
                  "on_conflict": {
                    "type": "string",
                    "description": "`upsert` or `skip`."
                  },
                  "unsubscribed": {
                    "type": [
                      "boolean",
                      "null"
                    ],
                    "description": "Give every contact this subscription state; null uses the mapped column again."
                  },
                  "has_header": {
                    "type": "boolean",
                    "description": "`false` when the first row is data."
                  },
                  "create_missing_properties": {
                    "type": "boolean",
                    "description": "Create the mapped properties that do not exist yet."
                  }
                }
              },
              "example": {
                "column_map": {
                  "email": "Email",
                  "first_name": "First name",
                  "properties": {
                    "plan": {
                      "column": "Plan"
                    }
                  }
                },
                "segments": [
                  {
                    "id": "78261eea-8f8b-4381-83c6-79fa7120f1cf"
                  }
                ],
                "create_missing_properties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "completed_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    },
                    "counts": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "number"
                        },
                        "created": {
                          "type": "number"
                        },
                        "updated": {
                          "type": "number"
                        },
                        "skipped": {
                          "type": "number"
                        },
                        "failed": {
                          "type": "number"
                        }
                      }
                    },
                    "error": {},
                    "source": {
                      "type": "string"
                    },
                    "column_map": {
                      "type": "object",
                      "properties": {
                        "email": {
                          "type": "string"
                        },
                        "first_name": {
                          "type": "string"
                        }
                      }
                    },
                    "segments": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "topics": {
                      "type": "array"
                    },
                    "on_conflict": {
                      "type": "string"
                    },
                    "unsubscribed": {},
                    "columns": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "delimiter": {
                      "type": "string"
                    },
                    "has_header": {
                      "type": "boolean"
                    },
                    "file_received": {
                      "type": "boolean"
                    },
                    "start_on_upload": {
                      "type": "boolean"
                    },
                    "expires_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "object": "contact_import",
                  "id": "3a9e7c5b-1f2d-4e6a-8b0c-7d9f1a3c5e2b",
                  "status": "queued",
                  "created_at": "2026-10-07T09:15:22.481203+00:00",
                  "completed_at": null,
                  "counts": {
                    "total": 0,
                    "created": 0,
                    "updated": 0,
                    "skipped": 0,
                    "failed": 0
                  },
                  "error": null,
                  "source": "api",
                  "column_map": {
                    "email": "Email",
                    "first_name": "First name"
                  },
                  "segments": [
                    {
                      "id": "78261eea-8f8b-4381-83c6-79fa7120f1cf"
                    }
                  ],
                  "topics": [],
                  "on_conflict": "upsert",
                  "unsubscribed": null,
                  "columns": [
                    "Email",
                    "First name",
                    "Plan"
                  ],
                  "delimiter": ",",
                  "has_header": true,
                  "file_received": true,
                  "start_on_upload": false,
                  "expires_at": null
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/uploads/{token}": {
      "put": {
        "operationId": "uploadContactImportFile",
        "summary": "Upload an import file",
        "description": "The `upload_url` of an import created with `upload` = `url`: PUT the CSV as the raw body (gzip accepted). No API key: the signed token is the authority, once, while the import is staged.\n\n- send.io extension.\n\n- A second upload answers 409; an expired or unknown link 404. If the import was started (or created with `start` true) it is queued now.",
        "tags": [
          "Contacts"
        ],
        "x-docs-ids": [
          "upload-contact-import-file"
        ],
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "description": "The signed token in `upload_url`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "completed_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    },
                    "counts": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "number"
                        },
                        "created": {
                          "type": "number"
                        },
                        "updated": {
                          "type": "number"
                        },
                        "skipped": {
                          "type": "number"
                        },
                        "failed": {
                          "type": "number"
                        }
                      }
                    },
                    "error": {},
                    "source": {
                      "type": "string"
                    },
                    "column_map": {
                      "type": "object"
                    },
                    "segments": {
                      "type": "array"
                    },
                    "topics": {
                      "type": "array"
                    },
                    "on_conflict": {
                      "type": "string"
                    },
                    "unsubscribed": {},
                    "columns": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "delimiter": {
                      "type": "string"
                    },
                    "has_header": {
                      "type": "boolean"
                    },
                    "file_received": {
                      "type": "boolean"
                    },
                    "start_on_upload": {
                      "type": "boolean"
                    },
                    "expires_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "object": "contact_import",
                  "id": "3a9e7c5b-1f2d-4e6a-8b0c-7d9f1a3c5e2b",
                  "status": "staged",
                  "created_at": "2026-10-07T09:15:22.481203+00:00",
                  "completed_at": null,
                  "counts": {
                    "total": 0,
                    "created": 0,
                    "updated": 0,
                    "skipped": 0,
                    "failed": 0
                  },
                  "error": null,
                  "source": "api",
                  "column_map": {},
                  "segments": [],
                  "topics": [],
                  "on_conflict": "upsert",
                  "unsubscribed": null,
                  "columns": [
                    "Email",
                    "First name",
                    "Plan"
                  ],
                  "delimiter": ",",
                  "has_header": true,
                  "file_received": true,
                  "start_on_upload": false,
                  "expires_at": "2026-10-08T09:15:22.481203+00:00"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/contacts/export": {
      "get": {
        "operationId": "exportContacts",
        "summary": "Export contacts",
        "description": "Download contacts as CSV (or JSON lines). With `signed=true` the answer is a short-lived link instead, which serves the same export without an API key.\n\n- send.io extension.\n\n- Without `signed` the response is the file itself. Columns: id, email, first_name, last_name, unsubscribed, created_at, then one per contact property. One file holds at most 200,000 contacts, newest first; a larger export comes in parts: add `part=2`, `part=3` and so on for the rest. `summary=true` answers `{total, parts, part_rows, as_of}` without the file; pass the same `as_of` to every part.\n\n- The signed link builds the file when it is fetched, from the contacts at that time.",
        "tags": [
          "Contacts"
        ],
        "x-docs-ids": [
          "export-contacts"
        ],
        "parameters": [
          {
            "name": "segment_id",
            "in": "query",
            "required": false,
            "description": "Only contacts in this segment. Repeat it for contacts in any of several segments (each once).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "`subscribed` or `unsubscribed`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "topic_id",
            "in": "query",
            "required": false,
            "description": "Only contacts subscribed to this topic.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Matches email and name.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "description": "`csv` (default) or `json` (one object per line, property values under `properties`).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "column_names",
            "in": "query",
            "required": false,
            "description": "Rename output columns, e.g. {\"email\":\"EMAIL\"} (with format json, \"properties\" renames the property object).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "signed",
            "in": "query",
            "required": false,
            "description": "`true`: answer {url, expires_at}; the url works for one hour without an API key.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "format": {
                      "type": "string"
                    },
                    "expires_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "object": "contact_export",
                  "url": "https://api.send.io/download/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwdXJwb3NlIjoiY29udGFjdF9leHBvcnQifQ.9xd...",
                  "format": "csv",
                  "expires_at": "2026-10-07T10:15:22Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/audiences": {
      "post": {
        "operationId": "createAudience",
        "summary": "Create audience",
        "description": "Create an audience. This creates a segment.",
        "tags": [
          "Audiences"
        ],
        "x-docs-ids": [
          "create-audience"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "The audience name."
                  }
                },
                "required": [
                  "name"
                ]
              },
              "example": {
                "name": "Registered users"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "object": "audience",
                  "id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
                  "name": "Registered users"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "get": {
        "operationId": "listAudiences",
        "summary": "List audiences",
        "description": "List audiences, newest first. This returns all segments.\n\n- Rule-based segments are listed too, with `type: \"rule\"`, their `rule` and `sync`. They are read, renamed and deleted here like any audience; their rule is changed with Update segment, and contacts cannot be added to them by hand.",
        "tags": [
          "Audiences"
        ],
        "x-docs-ids": [
          "list-audiences"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Number of items to return, 1 to 100. When omitted, all items are returned.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "Return items after this id (the next page). Cannot be used with `before`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "description": "Return items before this id (the previous page). Cannot be used with `after`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "type": {
                            "type": "string"
                          },
                          "updated_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "has_more": false,
                  "data": [
                    {
                      "id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
                      "name": "Registered users",
                      "created_at": "2026-10-07T09:15:22.481203+00:00",
                      "type": "manual",
                      "updated_at": "2026-10-07T09:15:22.481203+00:00"
                    },
                    {
                      "id": "c5d0e9a4-2b7f-4c13-9e8a-6f1d2b3c4e5f",
                      "name": "Beta testers",
                      "created_at": "2026-10-05T14:02:10.117845+00:00",
                      "type": "manual",
                      "updated_at": "2026-10-05T14:02:10.117845+00:00"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/audiences/{audience_id}": {
      "get": {
        "operationId": "getAudience",
        "summary": "Retrieve audience",
        "description": "Get an audience by id.",
        "tags": [
          "Audiences"
        ],
        "x-docs-ids": [
          "get-audience"
        ],
        "parameters": [
          {
            "name": "audience_id",
            "in": "path",
            "required": true,
            "description": "The audience id. Audiences are segments, so a segment id works here.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "object": "audience",
                  "id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
                  "name": "Registered users",
                  "created_at": "2026-10-07T09:15:22.481203+00:00"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "patch": {
        "operationId": "updateAudience",
        "summary": "Update audience",
        "description": "Rename an audience.\n\n- send.io extension.",
        "tags": [
          "Audiences"
        ],
        "x-docs-ids": [
          "update-audience"
        ],
        "parameters": [
          {
            "name": "audience_id",
            "in": "path",
            "required": true,
            "description": "The audience id. Audiences are segments, so a segment id works here.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "The new name."
                  }
                },
                "required": [
                  "name"
                ]
              },
              "example": {
                "name": "All registered users"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "object": "audience",
                  "id": "78261eea-8f8b-4381-83c6-79fa7120f1cf"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "delete": {
        "operationId": "deleteAudience",
        "summary": "Delete audience",
        "description": "Delete an audience. Its contacts are kept; only their membership is removed.",
        "tags": [
          "Audiences"
        ],
        "x-docs-ids": [
          "delete-audience"
        ],
        "parameters": [
          {
            "name": "audience_id",
            "in": "path",
            "required": true,
            "description": "The audience id. Audiences are segments, so a segment id works here.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "deleted": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "object": "audience",
                  "id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
                  "deleted": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/audiences/{audience_id}/contacts": {
      "post": {
        "operationId": "createAudienceContact",
        "summary": "Create audience contact",
        "description": "Create a contact and add it to the audience.\n\n- Contacts are global per team, not per audience. If a contact with the email already exists, this fails with 409 even when it is not in this audience; use Add contact to segment instead.\n\n- A rule-based segment is refused with 422 `validation_error` \"This segment is rule-based: its members are decided by its rule.\" Its members are added and removed by its rule.",
        "tags": [
          "Audiences"
        ],
        "x-docs-ids": [
          "create-audience-contact"
        ],
        "parameters": [
          {
            "name": "audience_id",
            "in": "path",
            "required": true,
            "description": "The audience id. Audiences are segments, so a segment id works here.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "description": "Email address. Must be unique within your team."
                  },
                  "first_name": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "First name. At most 200 characters; a longer one is refused with 422 `validation_error`, never cut short."
                  },
                  "last_name": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Last name. At most 200 characters; a longer one is refused with 422 `validation_error`, never cut short."
                  },
                  "unsubscribed": {
                    "type": "boolean",
                    "description": "Whether the contact is unsubscribed from all broadcasts. Defaults to false."
                  },
                  "properties": {
                    "type": "object",
                    "description": "Custom property values keyed by property key. Each key must exist (create it with Create contact property) and the value must match its type, unless `create_missing_properties` is true. A `boolean` property takes true, false, or the text \"true\" or \"false\" (any case). A `date` property takes an RFC 3339 time (2026-01-31T09:30:00Z), a time without a zone (2026-01-31T09:30:00, read as UTC) or a day (2026-01-31, read as 00:00 UTC); it is stored and returned as RFC 3339 in UTC. A string value is at most 2,000 characters; a longer one is refused with 422 `validation_error` naming the property."
                  },
                  "create_missing_properties": {
                    "type": "boolean",
                    "description": "send.io extension. When true, a key in `properties` with no contact property yet creates one instead of failing: `number` for a number value, otherwise `string` (booleans are stored as given, ISO dates as text). A property made this way is never `boolean` or `date`; create those with Create contact property. Values are also converted to an existing `string` or `number` property's type when that is unambiguous, such as \"42\" for a number property. Defaults to false."
                  }
                },
                "required": [
                  "email"
                ]
              },
              "example": {
                "email": "steve.wozniak@acme.com",
                "first_name": "Steve",
                "last_name": "Wozniak",
                "unsubscribed": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "object": "contact",
                  "id": "4f3c2a1e-8b6d-4e2f-9a7c-1d5e3b8f6a20"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "get": {
        "operationId": "listAudienceContacts",
        "summary": "List audience contacts",
        "description": "List the contacts in an audience, newest first.",
        "tags": [
          "Audiences"
        ],
        "x-docs-ids": [
          "list-audience-contacts"
        ],
        "parameters": [
          {
            "name": "audience_id",
            "in": "path",
            "required": true,
            "description": "The audience id. Audiences are segments, so a segment id works here.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Number of items to return, 1 to 100. When omitted, all items are returned.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "Return items after this id (the next page). Cannot be used with `before`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "description": "Return items before this id (the previous page). Cannot be used with `after`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "email": {
                            "type": "string"
                          },
                          "first_name": {
                            "type": "string"
                          },
                          "last_name": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "unsubscribed": {
                            "type": "boolean"
                          },
                          "status": {
                            "type": "string"
                          },
                          "status_changed_at": {
                            "type": [
                              "null",
                              "string"
                            ],
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "has_more": false,
                  "data": [
                    {
                      "id": "4f3c2a1e-8b6d-4e2f-9a7c-1d5e3b8f6a20",
                      "email": "steve.wozniak@acme.com",
                      "first_name": "Steve",
                      "last_name": "Wozniak",
                      "created_at": "2026-10-07T09:15:22.481203+00:00",
                      "unsubscribed": false,
                      "status": "subscribed",
                      "status_changed_at": null
                    },
                    {
                      "id": "a81b6c2d-3e4f-4a5b-8c7d-9e0f1a2b3c4d",
                      "email": "ada.lovelace@acme.com",
                      "first_name": "Ada",
                      "last_name": null,
                      "created_at": "2026-10-05T14:02:10.117845+00:00",
                      "unsubscribed": true,
                      "status": "unsubscribed",
                      "status_changed_at": "2026-10-06T08:12:40.203114+00:00"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/audiences/{audience_id}/contacts/{contact_id}": {
      "get": {
        "operationId": "getAudienceContact",
        "summary": "Retrieve audience contact",
        "description": "Get a contact by id or by email address. Same as Retrieve contact.\n\n- The audience id is not checked; the contact is returned even if it is not in that audience.",
        "tags": [
          "Audiences"
        ],
        "x-docs-ids": [
          "get-audience-contact"
        ],
        "parameters": [
          {
            "name": "audience_id",
            "in": "path",
            "required": true,
            "description": "The audience id. Audiences are segments, so a segment id works here.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "contact_id",
            "in": "path",
            "required": true,
            "description": "The contact id or the contact's email address.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "email": {
                      "type": "string"
                    },
                    "first_name": {
                      "type": "string"
                    },
                    "last_name": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "unsubscribed": {
                      "type": "boolean"
                    },
                    "properties": {
                      "type": "object",
                      "properties": {
                        "company": {
                          "type": "object",
                          "properties": {
                            "value": {
                              "type": "string"
                            },
                            "type": {
                              "type": "string"
                            }
                          }
                        },
                        "seats": {
                          "type": "object",
                          "properties": {
                            "value": {
                              "type": "number"
                            },
                            "type": {
                              "type": "string"
                            }
                          }
                        },
                        "vip": {
                          "type": "object",
                          "properties": {
                            "value": {
                              "type": "boolean"
                            },
                            "type": {
                              "type": "string"
                            }
                          }
                        },
                        "renews_at": {
                          "type": "object",
                          "properties": {
                            "value": {
                              "type": "string"
                            },
                            "type": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "contact",
                  "id": "4f3c2a1e-8b6d-4e2f-9a7c-1d5e3b8f6a20",
                  "email": "steve.wozniak@acme.com",
                  "first_name": "Steve",
                  "last_name": "Wozniak",
                  "created_at": "2026-10-07T09:15:22.481203+00:00",
                  "unsubscribed": false,
                  "properties": {
                    "company": {
                      "value": "Acme",
                      "type": "string"
                    },
                    "seats": {
                      "value": 25,
                      "type": "number"
                    },
                    "vip": {
                      "value": true,
                      "type": "boolean"
                    },
                    "renews_at": {
                      "value": "2027-01-31T00:00:00Z",
                      "type": "date"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "patch": {
        "operationId": "updateAudienceContact",
        "summary": "Update audience contact",
        "description": "Update a contact by id or by email address. Same body and rules as Update contact.\n\n- The audience id is not checked. The change applies to the contact everywhere.",
        "tags": [
          "Audiences"
        ],
        "x-docs-ids": [
          "update-audience-contact"
        ],
        "parameters": [
          {
            "name": "audience_id",
            "in": "path",
            "required": true,
            "description": "The audience id. Audiences are segments, so a segment id works here.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "contact_id",
            "in": "path",
            "required": true,
            "description": "The contact id or the contact's email address.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "first_name": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "First name, at most 200 characters. Send null to clear it."
                  },
                  "last_name": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Last name, at most 200 characters. Send null to clear it."
                  },
                  "unsubscribed": {
                    "type": "boolean",
                    "description": "Whether the contact is unsubscribed from all broadcasts."
                  },
                  "properties": {
                    "type": "object",
                    "description": "Property values to set, merged into the existing ones. Send null for a key to remove it."
                  },
                  "create_missing_properties": {
                    "type": "boolean",
                    "description": "send.io extension. Create properties for unknown keys and convert values to existing types. See Update contact."
                  }
                }
              },
              "example": {
                "unsubscribed": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "object": "contact",
                  "id": "4f3c2a1e-8b6d-4e2f-9a7c-1d5e3b8f6a20"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "delete": {
        "operationId": "deleteAudienceContact",
        "summary": "Delete audience contact",
        "description": "Permanently delete the contact. The audience must exist.\n\n- This deletes the contact from your team, not just from the audience. To only remove it from the audience, use Remove contact from segment.",
        "tags": [
          "Audiences"
        ],
        "x-docs-ids": [
          "delete-audience-contact"
        ],
        "parameters": [
          {
            "name": "audience_id",
            "in": "path",
            "required": true,
            "description": "The audience id. Audiences are segments, so a segment id works here.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "contact_id",
            "in": "path",
            "required": true,
            "description": "The contact id or the contact's email address.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "contact": {
                      "type": "string"
                    },
                    "deleted": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "object": "contact",
                  "contact": "4f3c2a1e-8b6d-4e2f-9a7c-1d5e3b8f6a20",
                  "deleted": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/segments": {
      "post": {
        "operationId": "createSegment",
        "summary": "Create segment",
        "description": "Create an empty manual segment, or a rule-based segment that fills itself from its rule.\n\n- A manual segment answers `{ object, id, name, type: \"manual\" }`.\n\n- A rule is a group `{ type: \"and\" | \"or\", rules: [...] }` or one test `{ field, operator, value }`. Groups can be nested up to 5 levels deep, and a rule can hold up to 250 tests. These limits only keep one request from stalling the server.\n\n- Fields: `contact.email`, `contact.first_name`, `contact.last_name` (text), `contact.unsubscribed` (true or false), `contact.created_at` (date), `contact.properties.<key>` (a property that exists, in its type), and for an event you send, `events.<name>.last_at` and `events.<name>.first_at` (dates) and `events.<name>.count` (a number, 0 when it never happened). An event name may contain dots: `events.user.logged_in.last_at` reads the event `user.logged_in`.\n\n- Operators: `eq`, `neq`, `gt`, `gte`, `lt`, `lte`, `in`, `not_in`, `contains`, `not_contains`, `starts_with`, `ends_with`, `exists`, `not_exists`, `is_empty`, `is_not_empty`, and for dates `more_than_days_ago` and `within_last_days` with a whole number of days N as the value (0 to 3650 for `more_than_days_ago`, 1 to 3650 for `within_last_days`). A `boolean` field takes `eq`, `neq`, `exists` and `not_exists`; a `number` field the comparisons, `in`, `not_in`, `exists` and `not_exists`; a `date` field `gt`, `gte`, `lt`, `lte`, the two day operators, `exists` and `not_exists` (no `eq`: a date is a moment, not a day). A text field takes every operator.\n\n- A value is fixed: it cannot read another field. A test that can never match (text compared with `gt`, a date that is not a date) is refused. A missing value matches only `not_exists`, so an event that never happened is not \"more than 30 days ago\"; add `{ field: \"events.<name>.last_at\", operator: \"not_exists\" }` in an `or` group to include those contacts. The rule reads a property's stored value, never its `fallback_value`.\n\n- A rule that is not valid fails with 422 `validation_error` (\"The rule is not valid: ...\") and lists each problem in `errors`.\n\n- A rule-based segment is created on `/segments` only; `POST /audiences` makes manual segments.\n\n- Broadcasts to or excluding a segment that is still `building` wait for it (`hold_reason: \"segment_building\"`) and are sent when it is ready.\n\n- No limit on the number of rule-based segments. Creating, changing and recounting one needs an Admin; any member may preview a rule.",
        "tags": [
          "Segments"
        ],
        "x-docs-ids": [
          "create-segment"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "The segment name, at most 100 characters."
                  },
                  "type": {
                    "type": "string",
                    "description": "send.io extension. `manual` (the default) or `rule`."
                  },
                  "rule": {
                    "type": "object",
                    "description": "send.io extension. Required with `type: \"rule\"` and refused without it. Who the segment holds; see the notes for the format.",
                    "properties": {
                      "type": {
                        "type": "string"
                      },
                      "rules": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "field": {
                              "type": "string"
                            },
                            "operator": {
                              "type": "string"
                            },
                            "value": {
                              "type": [
                                "string",
                                "number"
                              ]
                            }
                          }
                        }
                      }
                    }
                  },
                  "run_automations": {
                    "type": "boolean",
                    "description": "send.io extension, with a rule. Whether the contacts the first build puts in the segment start the automations and webhooks for entering it. Defaults to false: the segment fills silently, and only later joins and leaves start them."
                  }
                },
                "required": [
                  "name"
                ]
              },
              "example": {
                "name": "Dormant pros",
                "type": "rule",
                "rule": {
                  "type": "and",
                  "rules": [
                    {
                      "field": "contact.properties.plan",
                      "operator": "eq",
                      "value": "pro"
                    },
                    {
                      "field": "events.user.logged_in.last_at",
                      "operator": "more_than_days_ago",
                      "value": 30
                    }
                  ]
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sync": {
                      "type": "object",
                      "description": "Rule-based segments only: `status` is `building` until the first full pass has filled the segment, usually within seconds.",
                      "properties": {
                        "status": {
                          "type": "string"
                        },
                        "synced_at": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "format": "date-time"
                        },
                        "next_run_at": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "error": {}
                      }
                    },
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "object": "segment",
                  "id": "d2b7f4e1-6a3c-4e8d-b1f5-9c0a2e4d6b8f",
                  "name": "Dormant pros",
                  "type": "rule",
                  "sync": {
                    "status": "building",
                    "synced_at": null,
                    "next_run_at": "2026-11-18T10:02:09.118302+00:00",
                    "error": null
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "get": {
        "operationId": "listSegments",
        "summary": "List segments",
        "description": "List segments, newest first.",
        "tags": [
          "Segments"
        ],
        "x-docs-ids": [
          "list-segments"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Number of items to return, 1 to 100. When omitted, all items are returned.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "Return items after this id (the next page). Cannot be used with `before`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "description": "Return items before this id (the previous page). Cannot be used with `after`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "send.io extension. Case-insensitive contains match on the segment name. Leading and trailing spaces are trimmed; at most 100 characters (longer is a 422). Combines with `limit`, `after` and `before`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "description": "send.io extension. `manual` or `rule`: only segments of that type. Any other value is a 422.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "description": "send.io extension. `manual` or `rule`."
                          },
                          "rule": {
                            "type": "object",
                            "description": "Rule-based segments only.",
                            "properties": {
                              "type": {
                                "type": "string"
                              },
                              "rules": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "field": {
                                      "type": "string"
                                    },
                                    "operator": {
                                      "type": "string"
                                    },
                                    "value": {
                                      "type": [
                                        "string",
                                        "number"
                                      ]
                                    }
                                  }
                                }
                              }
                            }
                          },
                          "sync": {
                            "type": "object",
                            "description": "Rule-based segments only; as on Retrieve segment.",
                            "properties": {
                              "status": {
                                "type": "string"
                              },
                              "synced_at": {
                                "type": "string",
                                "format": "date-time"
                              },
                              "next_run_at": {
                                "type": "string",
                                "format": "date-time"
                              },
                              "error": {}
                            }
                          },
                          "contacts": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Rule-based segments only. Members as of the last full pass; null before the first. Retrieve segment counts them now."
                          },
                          "subscribed": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Rule-based segments only. Subscribed members as of the last full pass; null before the first."
                          },
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updated_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    },
                    "object": {
                      "type": "string"
                    },
                    "has_more": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "has_more": false,
                  "data": [
                    {
                      "id": "d2b7f4e1-6a3c-4e8d-b1f5-9c0a2e4d6b8f",
                      "name": "Dormant pros",
                      "created_at": "2026-10-07T09:15:22.481203+00:00",
                      "type": "rule",
                      "updated_at": "2026-10-07T09:15:22.481203+00:00",
                      "rule": {
                        "type": "and",
                        "rules": [
                          {
                            "field": "contact.properties.plan",
                            "operator": "eq",
                            "value": "pro"
                          },
                          {
                            "field": "events.user.logged_in.last_at",
                            "operator": "more_than_days_ago",
                            "value": 30
                          }
                        ]
                      },
                      "sync": {
                        "status": "ready",
                        "synced_at": "2026-11-18T10:02:11.204511+00:00",
                        "next_run_at": "2026-11-25T10:02:11.204511+00:00",
                        "error": null
                      },
                      "contacts": 1240,
                      "subscribed": 1198
                    },
                    {
                      "id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
                      "name": "Registered users",
                      "created_at": "2026-10-07T09:15:22.481203+00:00",
                      "type": "manual",
                      "updated_at": "2026-10-07T09:15:22.481203+00:00"
                    },
                    {
                      "id": "c5d0e9a4-2b7f-4c13-9e8a-6f1d2b3c4e5f",
                      "name": "Beta testers",
                      "created_at": "2026-10-05T14:02:10.117845+00:00",
                      "type": "manual",
                      "updated_at": "2026-10-05T14:02:10.117845+00:00"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/segments/{segment_id}": {
      "get": {
        "operationId": "getSegment",
        "summary": "Retrieve segment",
        "description": "Get a segment by id, with its member counts now.\n\n- A manual segment has `type: \"manual\"` and no `rule`, `sync` or `mass_moves`.",
        "tags": [
          "Segments"
        ],
        "x-docs-ids": [
          "get-segment"
        ],
        "parameters": [
          {
            "name": "segment_id",
            "in": "path",
            "required": true,
            "description": "The segment id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "description": "send.io extension. `manual` or `rule`."
                    },
                    "updated_at": {
                      "type": "string",
                      "description": "send.io extension. When the name or rule last changed.",
                      "format": "date-time"
                    },
                    "rule": {
                      "type": "object",
                      "description": "Rule-based segments only. The rule, as it was sent.",
                      "properties": {
                        "type": {
                          "type": "string"
                        },
                        "rules": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "field": {
                                "type": "string"
                              },
                              "operator": {
                                "type": "string"
                              },
                              "value": {
                                "type": [
                                  "string",
                                  "number"
                                ]
                              }
                            }
                          }
                        }
                      }
                    },
                    "sync": {
                      "type": "object",
                      "description": "Rule-based segments only. Whether the stored members match the rule now.",
                      "properties": {
                        "status": {
                          "type": "string",
                          "description": "`building`: the segment is being filled after it was created or its rule changed, and its members do not match the rule yet. `ready`: built. `failed`: the build gave up; `error` says why, and Recount segment tries again."
                        },
                        "synced_at": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "When the last full pass finished. Null before the first one.",
                          "format": "date-time"
                        },
                        "next_run_at": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "When the next full pass is due: now while building, then a weekly check.",
                          "format": "date-time"
                        },
                        "error": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Why the build failed. Null unless `status` is `failed`."
                        }
                      }
                    },
                    "contacts": {
                      "type": "number",
                      "description": "send.io extension. Members now."
                    },
                    "subscribed": {
                      "type": "number",
                      "description": "send.io extension. Members a broadcast reaches now: `subscribed` in this segment and not unsubscribed from all email."
                    },
                    "mass_moves": {
                      "description": "Rule-based segments only. The clock hours in the last 7 days in which the rule moved more than 1,000 contacts and more than 25% of the segment's members in or out at once, newest first; empty when there were none. The team's admins are emailed about each one. Not on List segments.",
                      "items": {
                        "type": "object",
                        "properties": {
                          "hour": {
                            "type": "string",
                            "description": "The start of the clock hour, in UTC."
                          },
                          "entered": {
                            "type": "number",
                            "description": "Contacts the rule moved into the segment in that hour (so far, while the hour is still running)."
                          },
                          "left": {
                            "type": "number",
                            "description": "Contacts the rule moved out of the segment in that hour (so far, while the hour is still running)."
                          }
                        }
                      }
                    },
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "object": "segment",
                  "id": "d2b7f4e1-6a3c-4e8d-b1f5-9c0a2e4d6b8f",
                  "name": "Dormant pros",
                  "created_at": "2026-10-07T09:15:22.481203+00:00",
                  "type": "rule",
                  "updated_at": "2026-10-07T09:15:22.481203+00:00",
                  "rule": {
                    "type": "and",
                    "rules": [
                      {
                        "field": "contact.properties.plan",
                        "operator": "eq",
                        "value": "pro"
                      },
                      {
                        "field": "events.user.logged_in.last_at",
                        "operator": "more_than_days_ago",
                        "value": 30
                      }
                    ]
                  },
                  "sync": {
                    "status": "ready",
                    "synced_at": "2026-11-18T10:02:11.204511+00:00",
                    "next_run_at": "2026-11-25T10:02:11.204511+00:00",
                    "error": null
                  },
                  "contacts": 1240,
                  "subscribed": 1198,
                  "mass_moves": [
                    {
                      "hour": "2026-11-17T14:00:00Z",
                      "entered": 1180,
                      "left": 0
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "patch": {
        "operationId": "updateSegment",
        "summary": "Update segment",
        "description": "Rename a segment, or change the rule of a rule-based segment.\n\n- send.io extension.\n\n- A manual segment answers `{ object, id }`.\n\n- Use Preview segment rule with `segment_id` first to see how many contacts would join and leave.\n\n- The rule of a segment is changed on `/segments` only; through `/audiences` it is a 422.",
        "tags": [
          "Segments"
        ],
        "x-docs-ids": [
          "update-segment"
        ],
        "parameters": [
          {
            "name": "segment_id",
            "in": "path",
            "required": true,
            "description": "The segment id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "The new name. Required unless `rule` is sent."
                  },
                  "rule": {
                    "type": "object",
                    "description": "send.io extension, rule-based segments only. The new rule, in the format of Create segment. The segment builds again: contacts that no longer match leave and new matches join. A rule equal to the current one changes nothing. On a manual segment it is a 422: the type of a segment cannot be changed.",
                    "properties": {
                      "type": {
                        "type": "string"
                      },
                      "rules": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "field": {
                              "type": "string"
                            },
                            "operator": {
                              "type": "string"
                            },
                            "value": {
                              "type": [
                                "string",
                                "number"
                              ]
                            }
                          }
                        }
                      }
                    }
                  },
                  "run_automations": {
                    "type": "boolean",
                    "description": "send.io extension, with `rule`. Whether the contacts the rebuild moves start the automations and webhooks for entering and leaving. Defaults to false."
                  }
                }
              },
              "example": {
                "rule": {
                  "type": "and",
                  "rules": [
                    {
                      "field": "contact.properties.plan",
                      "operator": "eq",
                      "value": "pro"
                    },
                    {
                      "field": "events.user.logged_in.last_at",
                      "operator": "more_than_days_ago",
                      "value": 30
                    }
                  ]
                },
                "run_automations": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "description": "Rule-based segments only."
                    },
                    "sync": {
                      "type": "object",
                      "description": "Rule-based segments only; `building` after a changed rule.",
                      "properties": {
                        "status": {
                          "type": "string"
                        },
                        "synced_at": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "format": "date-time"
                        },
                        "next_run_at": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "error": {}
                      }
                    },
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "object": "segment",
                  "id": "d2b7f4e1-6a3c-4e8d-b1f5-9c0a2e4d6b8f",
                  "type": "rule",
                  "sync": {
                    "status": "building",
                    "synced_at": null,
                    "next_run_at": "2026-11-18T10:02:09.118302+00:00",
                    "error": null
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "delete": {
        "operationId": "deleteSegment",
        "summary": "Delete segment",
        "description": "Delete a segment. Its contacts are kept; only their membership is removed.\n\n- A segment that a pending broadcast or a live automation uses is refused with 409 `resource_in_use`.\n\n- Deleting a rule-based segment starts no automation and sends no `contact.segment_left`.",
        "tags": [
          "Segments"
        ],
        "x-docs-ids": [
          "delete-segment"
        ],
        "parameters": [
          {
            "name": "segment_id",
            "in": "path",
            "required": true,
            "description": "The segment id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "deleted": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "object": "segment",
                  "id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
                  "deleted": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/segments/preview": {
      "post": {
        "operationId": "previewSegmentRule",
        "summary": "Preview segment rule",
        "description": "send.io extension. Count who a rule matches now, without saving anything. With `segment_id`, also how many contacts would join and leave that segment if it had this rule.\n\n- Any workspace member may call it. One preview runs at a time per workspace; a second one that waits more than 2 seconds gets 429 `rate_limit_exceeded`.\n\n- A rule that is not valid fails with 422, as on Create segment.",
        "tags": [
          "Segments"
        ],
        "x-docs-ids": [
          "preview-segment-rule"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "rule": {
                    "type": "object",
                    "description": "The rule, in the format of Create segment.",
                    "properties": {
                      "type": {
                        "type": "string"
                      },
                      "rules": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "field": {
                              "type": "string"
                            },
                            "operator": {
                              "type": "string"
                            },
                            "value": {
                              "type": [
                                "string",
                                "number"
                              ]
                            }
                          }
                        }
                      }
                    }
                  },
                  "segment_id": {
                    "type": "string",
                    "description": "A segment to compare with: adds `entering` and `leaving`."
                  }
                },
                "required": [
                  "rule"
                ]
              },
              "example": {
                "rule": {
                  "type": "and",
                  "rules": [
                    {
                      "field": "contact.properties.plan",
                      "operator": "eq",
                      "value": "pro"
                    },
                    {
                      "field": "events.user.logged_in.last_at",
                      "operator": "more_than_days_ago",
                      "value": 30
                    }
                  ]
                },
                "segment_id": "d2b7f4e1-6a3c-4e8d-b1f5-9c0a2e4d6b8f"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "complete": {
                      "type": "boolean",
                      "description": "Whether every contact was read. False when the 5-second budget ran out: the counts are then estimates scaled from the contacts read."
                    },
                    "scanned": {
                      "type": "number",
                      "description": "Contacts read."
                    },
                    "total": {
                      "type": "number",
                      "description": "Contacts in the workspace."
                    },
                    "matches": {
                      "type": "number",
                      "description": "Contacts the rule matches."
                    },
                    "entering": {
                      "type": "number",
                      "description": "With `segment_id` only. Contacts the rule matches that are not members."
                    },
                    "leaving": {
                      "type": "number",
                      "description": "With `segment_id` only. Members the rule does not match."
                    },
                    "tracked_since": {
                      "type": "object",
                      "description": "Per event the rule reads (name in lower case): when send.io's record of it starts, or null when unknown. Older history can be loaded with Import event history.",
                      "properties": {
                        "user.logged_in": {
                          "type": "string"
                        }
                      }
                    },
                    "no_record": {
                      "type": "object",
                      "description": "Per event the rule reads (name in lower case): contacts with no record of it.",
                      "properties": {
                        "user.logged_in": {
                          "type": "number"
                        }
                      }
                    },
                    "object": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "object": "segment_preview",
                  "complete": true,
                  "scanned": 50000,
                  "total": 50000,
                  "matches": 1240,
                  "entering": 40,
                  "leaving": 12,
                  "tracked_since": {
                    "user.logged_in": "2026-08-18T00:00:00Z"
                  },
                  "no_record": {
                    "user.logged_in": 8200
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/segments/{segment_id}/recount": {
      "post": {
        "operationId": "recountSegment",
        "summary": "Recount segment",
        "description": "send.io extension. Check every contact against the rule of a rule-based segment now, and move the ones that changed. Contacts that join or leave start their automations and webhooks, as a change would. Normally not needed: membership already follows each change.\n\n- The recount runs in the background; Retrieve segment shows the new counts when it is done.\n\n- A segment that is `building` is refused with 409 `conflict`. A `failed` build is tried again instead (silently, unless it was started with `run_automations`).\n\n- A manual segment is refused with 422 \"This segment is manual: it has no rule to count.\"",
        "tags": [
          "Segments"
        ],
        "x-docs-ids": [
          "recount-segment"
        ],
        "parameters": [
          {
            "name": "segment_id",
            "in": "path",
            "required": true,
            "description": "The segment id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {}
            }
          }
        },
        "responses": {
          "202": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "sync": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string"
                        },
                        "synced_at": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "next_run_at": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "error": {}
                      }
                    }
                  }
                },
                "example": {
                  "object": "segment",
                  "id": "d2b7f4e1-6a3c-4e8d-b1f5-9c0a2e4d6b8f",
                  "type": "rule",
                  "sync": {
                    "status": "ready",
                    "synced_at": "2026-11-18T10:02:11.204511+00:00",
                    "next_run_at": "2026-11-25T10:02:11.204511+00:00",
                    "error": null
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/segments/{segment_id}/contacts": {
      "get": {
        "operationId": "listSegmentContacts",
        "summary": "List segment contacts",
        "description": "List the contacts in a segment, newest first.\n\n- send.io extension. `GET /contacts?segment_id=` returns the same list and also takes the other contact filters.\n\n- send.io extension: each contact's `status` in this segment and `status_changed_at`, and the `status` filter (`subscribed`, `unsubscribed`, `cleaned` or `pending`).",
        "tags": [
          "Segments"
        ],
        "x-docs-ids": [
          "list-segment-contacts"
        ],
        "parameters": [
          {
            "name": "segment_id",
            "in": "path",
            "required": true,
            "description": "The segment id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Number of items to return, 1 to 100. When omitted, all items are returned.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "Return items after this id (the next page). Cannot be used with `before`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "description": "Return items before this id (the previous page). Cannot be used with `after`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "email": {
                            "type": "string"
                          },
                          "first_name": {
                            "type": "string"
                          },
                          "last_name": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "unsubscribed": {
                            "type": "boolean"
                          },
                          "status": {
                            "type": "string"
                          },
                          "status_changed_at": {
                            "type": [
                              "null",
                              "string"
                            ],
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "has_more": false,
                  "data": [
                    {
                      "id": "4f3c2a1e-8b6d-4e2f-9a7c-1d5e3b8f6a20",
                      "email": "steve.wozniak@acme.com",
                      "first_name": "Steve",
                      "last_name": "Wozniak",
                      "created_at": "2026-10-07T09:15:22.481203+00:00",
                      "unsubscribed": false,
                      "status": "subscribed",
                      "status_changed_at": null
                    },
                    {
                      "id": "a81b6c2d-3e4f-4a5b-8c7d-9e0f1a2b3c4d",
                      "email": "ada.lovelace@acme.com",
                      "first_name": "Ada",
                      "last_name": null,
                      "created_at": "2026-10-05T14:02:10.117845+00:00",
                      "unsubscribed": true,
                      "status": "unsubscribed",
                      "status_changed_at": "2026-10-06T08:12:40.203114+00:00"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/segments/{segment_id}/contacts/{contact_id}": {
      "patch": {
        "operationId": "updateSegmentContact",
        "summary": "Update segment contact status",
        "description": "send.io extension. Set a contact's subscription to one segment only, like a list member status: `subscribed`, `unsubscribed`, `cleaned` or `pending`. Broadcasts skip members that are not `subscribed` in the segments they target. A contact not in a manual segment is added with that status.\n\n- The contact-wide `unsubscribed` flag is unchanged: an unsubscribed contact gets no broadcast whatever its segment status.\n\n- In a rule-based segment, a member's status can be set as in a manual one, but a contact the rule does not match is never added. For such a contact, `unsubscribed` and `cleaned` are kept for the day it joins, and the answer has `member: false` and `added: false`; `subscribed` and `pending` are refused with 422 `validation_error` \"This segment is rule-based: its members are decided by its rule.\" A member that leaves keeps a status other than `subscribed` the same way, so a contact that unsubscribed from the segment is still unsubscribed when it joins again.\n\n- Webhooks: `contact.updated` on any change, and `contact.list_unsubscribed` when the status becomes `unsubscribed` (the contact, plus `unsubscribed_segment_ids`, `source` and, from a broadcast's unsubscribe link, `broadcast_id`).\n\n- Create contact accepts a status per segment too: `segments: [{ id, status }]`.",
        "tags": [
          "Segments"
        ],
        "x-docs-ids": [
          "update-segment-contact"
        ],
        "parameters": [
          {
            "name": "segment_id",
            "in": "path",
            "required": true,
            "description": "The segment id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "contact_id",
            "in": "path",
            "required": true,
            "description": "The contact id or the contact's email address.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "description": "`subscribed`, `unsubscribed`, `cleaned` or `pending`."
                  }
                },
                "required": [
                  "status"
                ]
              },
              "example": {
                "status": "unsubscribed"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "added": {
                      "type": "boolean",
                      "description": "Whether the contact was added to the segment by this call."
                    },
                    "member": {
                      "type": "boolean",
                      "description": "Whether the contact is a member. False only for a rule-based segment the contact is not in (see the notes)."
                    },
                    "created_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "When the contact joined the segment. Null when `member` is false.",
                      "format": "date-time"
                    },
                    "object": {
                      "type": "string"
                    },
                    "segment_id": {
                      "type": "string"
                    },
                    "contact_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "status_changed_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "object": "segment_contact",
                  "segment_id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
                  "contact_id": "4f3c2a1e-8b6d-4e2f-9a7c-1d5e3b8f6a20",
                  "status": "unsubscribed",
                  "status_changed_at": "2026-10-07T09:20:11.004512+00:00",
                  "created_at": "2026-10-07T09:15:22.481203+00:00",
                  "added": false,
                  "member": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/topics": {
      "post": {
        "operationId": "createTopic",
        "summary": "Create topic",
        "description": "Create a topic.",
        "tags": [
          "Topics"
        ],
        "x-docs-ids": [
          "create-topic"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "The topic name. At most 50 characters."
                  },
                  "default_subscription": {
                    "type": "string",
                    "description": "`opt_in` or `opt_out`: the subscription of contacts who have made no choice. Cannot be changed later."
                  },
                  "description": {
                    "type": "string",
                    "description": "Shown to contacts on the preferences page. At most 200 characters."
                  },
                  "visibility": {
                    "type": "string",
                    "description": "`public` (shown on the preferences page) or `private`. Defaults to `private`."
                  }
                },
                "required": [
                  "name",
                  "default_subscription"
                ]
              },
              "example": {
                "name": "Product updates",
                "default_subscription": "opt_in",
                "description": "New features and changes, about once a month.",
                "visibility": "public"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "object": "topic",
                  "id": "b6d24b8e-af0b-4c3c-be0c-359bbd97381e"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "get": {
        "operationId": "listTopics",
        "summary": "List topics",
        "description": "List topics, newest first.",
        "tags": [
          "Topics"
        ],
        "x-docs-ids": [
          "list-topics"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Number of items to return, 1 to 100. Defaults to 20.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "Return items after this id (the next page). Cannot be used with `before`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "description": "Return items before this id (the previous page). Cannot be used with `after`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "send.io extension. Case-insensitive contains match on the topic name or description. Leading and trailing spaces are trimmed; at most 100 characters (longer is a 422). Combines with `limit`, `after` and `before`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "object": {
                            "type": "string"
                          },
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "description": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "default_subscription": {
                            "type": "string"
                          },
                          "visibility": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "has_more": false,
                  "data": [
                    {
                      "object": "topic",
                      "id": "b6d24b8e-af0b-4c3c-be0c-359bbd97381e",
                      "name": "Product updates",
                      "description": "New features and changes, about once a month.",
                      "default_subscription": "opt_in",
                      "visibility": "public",
                      "created_at": "2026-10-07T09:15:22.481203+00:00"
                    },
                    {
                      "object": "topic",
                      "id": "e2a9c7f1-5d3b-4a8e-b6c4-0f7d1e2a3b9c",
                      "name": "Events",
                      "description": null,
                      "default_subscription": "opt_out",
                      "visibility": "private",
                      "created_at": "2026-10-05T14:02:10.117845+00:00"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/topics/{topic_id}": {
      "get": {
        "operationId": "getTopic",
        "summary": "Retrieve topic",
        "description": "Get a topic by id.",
        "tags": [
          "Topics"
        ],
        "x-docs-ids": [
          "get-topic"
        ],
        "parameters": [
          {
            "name": "topic_id",
            "in": "path",
            "required": true,
            "description": "The topic id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "default_subscription": {
                      "type": "string"
                    },
                    "visibility": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "object": "topic",
                  "id": "b6d24b8e-af0b-4c3c-be0c-359bbd97381e",
                  "name": "Product updates",
                  "description": "New features and changes, about once a month.",
                  "default_subscription": "opt_in",
                  "visibility": "public",
                  "created_at": "2026-10-07T09:15:22.481203+00:00"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "patch": {
        "operationId": "updateTopic",
        "summary": "Update topic",
        "description": "Change a topic's name, description or visibility. Only the fields you send change.\n\n- `default_subscription` cannot be changed; sending it fails with 422.\n\n- A `topic.updated` webhook is sent only when a value actually changes. A request that changes nothing (the same values again, or an empty body) still answers 200 with the topic id, but sends no webhook.",
        "tags": [
          "Topics"
        ],
        "x-docs-ids": [
          "update-topic"
        ],
        "parameters": [
          {
            "name": "topic_id",
            "in": "path",
            "required": true,
            "description": "The topic id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "The topic name. At most 50 characters; cannot be empty."
                  },
                  "description": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "At most 200 characters. Send null or an empty string to clear it."
                  },
                  "visibility": {
                    "type": "string",
                    "description": "`public` or `private`."
                  }
                }
              },
              "example": {
                "name": "Product news",
                "visibility": "private"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "object": "topic",
                  "id": "b6d24b8e-af0b-4c3c-be0c-359bbd97381e"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "delete": {
        "operationId": "deleteTopic",
        "summary": "Delete topic",
        "description": "Delete a topic.",
        "tags": [
          "Topics"
        ],
        "x-docs-ids": [
          "delete-topic"
        ],
        "parameters": [
          {
            "name": "topic_id",
            "in": "path",
            "required": true,
            "description": "The topic id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "deleted": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "object": "topic",
                  "id": "b6d24b8e-af0b-4c3c-be0c-359bbd97381e",
                  "deleted": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/contact-properties": {
      "post": {
        "operationId": "createContactProperty",
        "summary": "Create contact property",
        "description": "Define a custom contact property.\n\n- A second property with the same key fails with 409.\n\n- `boolean` and `date` are send.io extensions (Resend has `string` and `number`). Their values are checked on every write: a contact's value for a `boolean` property is stored as true or false, and for a `date` property as an RFC 3339 time in UTC. See Create contact for the accepted forms.\n\n- In a CSV import, a cell for a `boolean` property must be true or false (any case) and a cell for a `date` property a day (2026-01-31) or a time (2026-01-31T09:30:00Z); a row with another value is not imported and reports the reason.",
        "tags": [
          "Contact properties"
        ],
        "x-docs-ids": [
          "create-contact-property"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "key": {
                    "type": "string",
                    "description": "Letters, digits and underscores, at most 50 characters. Unique within your team. Cannot be changed later."
                  },
                  "type": {
                    "type": "string",
                    "description": "`string`, `number`, `boolean` or `date`. Cannot be changed later. Any other value fails with 422 \"type must be string, number, boolean or date.\""
                  },
                  "fallback_value": {
                    "type": [
                      "string",
                      "number",
                      "boolean",
                      "null"
                    ],
                    "description": "Used in broadcasts when a contact has no value. Must match `type`: text for `string`, a number for `number`, true or false (or the text \"true\" or \"false\") for `boolean`, and for `date` an RFC 3339 time or a day such as 2026-01-31, stored as RFC 3339 in UTC. Anything else fails with 422 \"fallback_value must be a <type>.\""
                  }
                },
                "required": [
                  "key",
                  "type"
                ]
              },
              "example": {
                "key": "company",
                "type": "string",
                "fallback_value": "your company"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "object": "contact_property",
                  "id": "1c7e5a3b-9d2f-4b6a-8e0c-3f5a7b9d1e2c"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "get": {
        "operationId": "listContactProperties",
        "summary": "List contact properties",
        "description": "List contact properties, newest first.\n\n- A request whose `User-Agent` starts with `resend-` (Resend's own SDKs, which only know `string` and `number`) is shown `boolean` and `date` properties as `type: \"string\"`, and boolean values as the text `\"true\"` or `\"false\"`. Every other client, send.io's SDKs included, gets the real types.",
        "tags": [
          "Contact properties"
        ],
        "x-docs-ids": [
          "list-contact-properties"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Number of items to return, 1 to 100. Defaults to 20.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "Return items after this id (the next page). Cannot be used with `before`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "description": "Return items before this id (the previous page). Cannot be used with `after`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "send.io extension. Case-insensitive contains match on the property key. Leading and trailing spaces are trimmed; at most 100 characters (longer is a 422). Combines with `limit`, `after` and `before`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "description": "`string`, `number`, `boolean` or `date`."
                          },
                          "fallback_value": {
                            "type": [
                              "string",
                              "number",
                              "boolean",
                              "null"
                            ],
                            "description": "The fallback, in the property's type. Null when there is none."
                          },
                          "object": {
                            "type": "string"
                          },
                          "id": {
                            "type": "string"
                          },
                          "key": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    },
                    "object": {
                      "type": "string"
                    },
                    "has_more": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "has_more": false,
                  "data": [
                    {
                      "object": "contact_property",
                      "id": "1c7e5a3b-9d2f-4b6a-8e0c-3f5a7b9d1e2c",
                      "key": "company",
                      "type": "string",
                      "fallback_value": "your company",
                      "created_at": "2026-10-07T09:15:22.481203+00:00"
                    },
                    {
                      "object": "contact_property",
                      "id": "9b2d4f6a-8c0e-4a1b-b3d5-7f9a1c3e5b7d",
                      "key": "seats",
                      "type": "number",
                      "fallback_value": null,
                      "created_at": "2026-10-05T14:02:10.117845+00:00"
                    },
                    {
                      "object": "contact_property",
                      "id": "c4e6a8b0-2d4f-4b6c-8e0a-1c3e5a7b9d1f",
                      "key": "vip",
                      "type": "boolean",
                      "fallback_value": false,
                      "created_at": "2026-10-05T14:02:10.117845+00:00"
                    },
                    {
                      "object": "contact_property",
                      "id": "e8a0c2d4-6f8b-4d0e-a2c4-5e7a9c1b3d5f",
                      "key": "renews_at",
                      "type": "date",
                      "fallback_value": null,
                      "created_at": "2026-10-05T14:02:10.117845+00:00"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/contact-properties/{contact_property_id}": {
      "get": {
        "operationId": "getContactProperty",
        "summary": "Retrieve contact property",
        "description": "Get a contact property by id.\n\n- A request whose `User-Agent` starts with `resend-` (Resend's own SDKs, which only know `string` and `number`) is shown `boolean` and `date` properties as `type: \"string\"`, and boolean values as the text `\"true\"` or `\"false\"`. Every other client, send.io's SDKs included, gets the real types.",
        "tags": [
          "Contact properties"
        ],
        "x-docs-ids": [
          "get-contact-property"
        ],
        "parameters": [
          {
            "name": "contact_property_id",
            "in": "path",
            "required": true,
            "description": "The contact property id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "description": "`string`, `number`, `boolean` or `date`."
                    },
                    "fallback_value": {
                      "type": [
                        "string",
                        "number",
                        "boolean",
                        "null"
                      ],
                      "description": "The fallback, in the property's type; a date fallback is an RFC 3339 time in UTC. Null when there is none."
                    },
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "key": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "object": "contact_property",
                  "id": "1c7e5a3b-9d2f-4b6a-8e0c-3f5a7b9d1e2c",
                  "key": "company",
                  "type": "string",
                  "fallback_value": "your company",
                  "created_at": "2026-10-07T09:15:22.481203+00:00"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "patch": {
        "operationId": "updateContactProperty",
        "summary": "Update contact property",
        "description": "Change a property's fallback value.\n\n- `key` and `type` cannot be changed; sending either fails with 422.",
        "tags": [
          "Contact properties"
        ],
        "x-docs-ids": [
          "update-contact-property"
        ],
        "parameters": [
          {
            "name": "contact_property_id",
            "in": "path",
            "required": true,
            "description": "The contact property id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "fallback_value": {
                    "type": [
                      "string",
                      "number",
                      "boolean",
                      "null"
                    ],
                    "description": "The new fallback. Must match the property's type, as on Create contact property. Null or omitted clears it."
                  }
                }
              },
              "example": {
                "fallback_value": "your team"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "object": "contact_property",
                  "id": "1c7e5a3b-9d2f-4b6a-8e0c-3f5a7b9d1e2c"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "delete": {
        "operationId": "deleteContactProperty",
        "summary": "Delete contact property",
        "description": "Delete a property. Its value is removed from every contact.",
        "tags": [
          "Contact properties"
        ],
        "x-docs-ids": [
          "delete-contact-property"
        ],
        "parameters": [
          {
            "name": "contact_property_id",
            "in": "path",
            "required": true,
            "description": "The contact property id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "deleted": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "object": "contact_property",
                  "id": "1c7e5a3b-9d2f-4b6a-8e0c-3f5a7b9d1e2c",
                  "deleted": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/broadcasts": {
      "post": {
        "operationId": "createBroadcast",
        "summary": "Create broadcast",
        "description": "Create a draft broadcast. Every field may be left out: a draft is saved as it is and completed later. Set `send: true` to send it right away or at `scheduled_at`; that needs `from`, `subject`, an `html` or `text` body and recipients.\n\n- Without `send: true` nothing is required (send.io extension: a draft can be saved before it is complete). With `send: true`, a missing `from`, `subject`, body or recipients is a 422 and no broadcast is created.\n\n- Each create and each later update of a draft or scheduled broadcast saves a version (see List broadcast versions).\n\n- send.io extension: `tracking` (boolean, default true). Opens and clicks are counted only when the sender domain's tracking subdomain is active. Broadcasts follow this field, not the domain's open and click tracking settings.\n\n- Merge tags: {{{contact.first_name}}}, {{{contact.last_name}}}, {{{contact.email}}}, {{{contact.<property key>}}} with an optional |fallback, and {{{unsubscribe_url}}} (also {{{RESEND_UNSUBSCRIBE_URL}}}). A bare {{{<property key>}}} that names one of your contact properties is that property too, so a template variable with a property's key is filled per contact.\n\n- Without `text`, a text part is generated from `html` with every link address kept. Updating `html` alone regenerates a generated text part; a `text` you wrote is kept. The sent text part always carries the unsubscribe link when the html has one.\n\n- `subject` can be at most 998 characters.\n\n- Unsubscribed contacts, and contacts not subscribed to `topic_id` when one is set, are skipped.\n\n- send.io extension: the audience is the union of `segment_ids` (or every contact with `audience: \"all\"`) minus members of `exclude_segment_ids`, one email per contact. A contact is sent the broadcast when its status is `subscribed` in at least one targeted segment (see Update segment contact status); with `audience: \"all\"` only the contact-wide unsubscribe and the topic apply.",
        "tags": [
          "Broadcasts"
        ],
        "x-docs-ids": [
          "create-broadcast"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "segment_id": {
                    "type": "string",
                    "description": "The segment to send to (the single-segment form of `segment_ids`). `audience_id` is accepted as an alias. One of `segment_id`, `segment_ids` or `audience: \"all\"` is required to send the broadcast (with `send: true`, on create); a draft can be saved without recipients."
                  },
                  "audience_id": {
                    "type": "string",
                    "description": "Older name for `segment_id`."
                  },
                  "segment_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "send.io extension. Several segments to send to: a contact in more than one gets one email. Combined with `segment_id` when both are sent. Replaces the broadcast's segments on update."
                  },
                  "exclude_segment_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "send.io extension. Members of these segments are never sent the broadcast, whatever their status in them. Send an empty array or null to remove the exclusions."
                  },
                  "audience": {
                    "type": "string",
                    "description": "send.io extension. `segments` (the default: the subscribed members of the segments) or `all` (every contact of the team, minus exclusions). `all` cannot be combined with `segment_id` or `segment_ids`; setting segments later switches back to `segments`."
                  },
                  "unsubscribe_scope": {
                    "type": "string",
                    "description": "send.io extension. What the broadcast's unsubscribe link and one-click List-Unsubscribe do: `all` (the default: the contact is unsubscribed from everything, or opted out of `topic_id` when one is set) or `list` (the contact's status becomes `unsubscribed` in the broadcast's segments only, and `contact.list_unsubscribed` is sent). With `list`, the preference page also offers \"Unsubscribe from everything\"."
                  },
                  "from": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Sender address, e.g. \"Acme <news@acme.com>\". Required to send the broadcast, and its domain must be verified by then. A draft can be saved without it; an empty string clears it."
                  },
                  "subject": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Subject line. Cannot contain line breaks. Merge tags such as {{{contact.first_name|there}}} are filled in per contact. Required to send the broadcast; a draft can be saved without it."
                  },
                  "reply_to": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "One or more reply-to addresses."
                  },
                  "html": {
                    "type": "string",
                    "description": "HTML body. Supports contact merge tags and {{{unsubscribe_url}}}."
                  },
                  "template_engine": {
                    "type": "string",
                    "description": "send.io extension. How the subject, HTML and text are filled in for each contact: `simple` (the default: contact merge tags such as {{{contact.first_name|there}}} and {{{unsubscribe_url}}}) or `handlebars` (Handlebars with the contact as data: `contact.first_name`, `contact.<property>`, `unsubscribe_url`, plus `if`, `each` and the other helpers templates support). Handlebars content that does not parse is refused with a 422 naming the part."
                  },
                  "template_id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "send.io extension. Make the broadcast from a published template (id or alias): its HTML, text, design and template engine become the broadcast's content, and its subject, preview text, From and Reply-To fill those the request and the broadcast leave empty. The content is a copy of the exact version (`template_version_id`): later publishes do not change the broadcast."
                  },
                  "template_version_id": {
                    "type": "string",
                    "description": "send.io extension. The published version of the template to copy (a version that was published, even if another one is live now). Default: the template's published version."
                  },
                  "text": {
                    "type": "string",
                    "description": "Plain text body. When omitted on create and `html` is set, a text version is generated from the HTML. Send an empty string to have no text part."
                  },
                  "name": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Internal name, shown only to you."
                  },
                  "preview_text": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Preview text shown by mail clients after the subject."
                  },
                  "topic_id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Send only to contacts subscribed to this topic. Send null to remove the topic."
                  },
                  "tracking": {
                    "type": "boolean",
                    "description": "send.io extension. Count opens and clicks when the sender domain's tracking subdomain is active. Defaults to true."
                  },
                  "send_time_optimization": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "description": "send.io extension. `{\"enabled\": true, \"window_hours\": 24}` sends each contact's copy shortly before the hour that contact usually opens email, learned from their past opens and clicks. The scheduled time becomes the earliest send time, and every copy goes out within `window_hours` (6, 12 or 24) of it. Contacts with too little history get it at the scheduled time, or at the hour your audience opens most; one contact in ten always gets it at the scheduled time, so the broadcast's stats can compare. While it waits between rounds the broadcast stays `queued` with `hold_reason` `send_time_wait` and `hold_until` set to the next round. Defaults to off; null turns it off. Can also be set on `POST /broadcasts/{id}/send`."
                  },
                  "version_name": {
                    "type": "string",
                    "description": "send.io extension. A name for the version this save records (see List broadcast versions). At most 100 characters."
                  },
                  "version_comment": {
                    "type": "string",
                    "description": "send.io extension. A comment for the version this save records. At most 1000 characters."
                  },
                  "send": {
                    "type": "boolean",
                    "description": "Send the broadcast after creating it. Defaults to false (a draft)."
                  },
                  "scheduled_at": {
                    "type": "string",
                    "description": "When to send: an ISO 8601 timestamp or a relative time like \"in 30 minutes\", \"in 2 hours\" or \"in 3 days\". Must be in the future and within 30 days. Requires `send: true`."
                  }
                }
              },
              "example": {
                "name": "October newsletter",
                "segment_id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
                "from": "Acme <news@acme.com>",
                "subject": "What's new at Acme, {{{contact.first_name|there}}}",
                "reply_to": "support@acme.com",
                "preview_text": "Three new features and a webinar invite.",
                "html": "<p>Hi {{{contact.first_name|there}}},</p><p>Here is what's new.</p><p><a href=\"{{{unsubscribe_url}}}\">Unsubscribe</a></p>",
                "topic_id": "b6d24b8e-af0b-4c3c-be0c-359bbd97381e",
                "tracking": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "object": "broadcast",
                  "id": "559ac32e-9ef5-46fb-82a1-b76b840c0f7b"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "get": {
        "operationId": "listBroadcasts",
        "summary": "List broadcasts",
        "description": "List broadcasts, newest first. Content fields are left out; retrieve a broadcast to get them.\n\n- send.io extension: the `status` and `segment_id` filters, and `template_name` on each item.",
        "tags": [
          "Broadcasts"
        ],
        "x-docs-ids": [
          "list-broadcasts"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Number of items to return, 1 to 100. When omitted, all items are returned.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "Return items after this id (the next page). Cannot be used with `before`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "description": "Return items before this id (the previous page). Cannot be used with `after`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Only broadcasts with this status: `draft`, `scheduled`, `queued`, `sent`, `canceled` or `failed`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "segment_id",
            "in": "query",
            "required": false,
            "description": "Only broadcasts sent to this segment (any of their `segment_ids`).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "send.io extension. Case-insensitive contains match on the broadcast name. Leading and trailing spaces are trimmed; at most 100 characters (longer is a 422). Combines with `status`, `segment_id`, `limit`, `after` and `before`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "template_name": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The name of the template the broadcast was made from; null for one with its own content."
                          },
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "audience_id": {
                            "type": "string"
                          },
                          "segment_id": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "scheduled_at": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date-time"
                          },
                          "sent_at": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date-time"
                          }
                        }
                      }
                    },
                    "object": {
                      "type": "string"
                    },
                    "has_more": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "has_more": false,
                  "data": [
                    {
                      "id": "559ac32e-9ef5-46fb-82a1-b76b840c0f7b",
                      "name": "October newsletter",
                      "audience_id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
                      "segment_id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
                      "status": "draft",
                      "created_at": "2026-10-07T09:15:22.481203+00:00",
                      "scheduled_at": null,
                      "sent_at": null
                    },
                    {
                      "id": "8d3f1b7a-6c2e-4a9d-b5f0-2e4c6a8b0d1f",
                      "name": "September newsletter",
                      "audience_id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
                      "segment_id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
                      "status": "sent",
                      "created_at": "2026-10-05T14:02:10.117845+00:00",
                      "scheduled_at": "2026-10-05T15:00:00+00:00",
                      "sent_at": "2026-10-05T15:00:41.55231+00:00"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/broadcasts/{broadcast_id}": {
      "get": {
        "operationId": "getBroadcast",
        "summary": "Retrieve broadcast",
        "description": "Get a broadcast by id, including its content.\n\n- `audience_id` and `segment_id` hold the same value: the first of `segment_ids` (null with `audience: \"all\"`). `design` holds the dashboard editor's document and is null for broadcasts created by API.\n\n- send.io extension: `segment_ids`, `exclude_segment_ids`, `audience` and `unsubscribe_scope`.\n\n- send.io extension: the template link (`template_id`, `template_version_id`, `template_name`, `template_version_number`, `template_version_name`, `template_deleted`) and, for a broadcast made from a template, `unfillable_variables`.\n\n- Template variables in a broadcast: a broadcast fills contact fields per contact. A variable the template declares that is not a contact field is filled with the fallback value the template version gives it; one with no fallback cannot be filled and is listed in `unfillable_variables`.\n\n- send.io extension: `updated_at` and `version_number`, the state an update made from this read expects (see `expected_updated_at` on Update broadcast).\n\n- send.io extension: `warnings` lists each segment or topic the broadcast still names that was deleted since it was chosen, as `{code: \"segment_deleted\", field: \"segment_ids\" | \"exclude_segment_ids\", segment_id, message}` or `{code: \"topic_deleted\", field: \"topic_id\", topic_id, message}`. The broadcast cannot be sent until they are removed.\n\n- send.io extension: `unknown_merge_tags` lists the merge tags in the subject or preview text that are neither a contact field nor a variable of the linked template, as `{part: \"subject\" | \"preview_text\", tag}`. They would be sent as typed, so sending is refused until they are fixed.\n\n- send.io extension: `tracking_status` says whether its opens and clicks can be counted with its From and `tracking` as they are now: `tracked`, `off` (`tracking` is false), or `no_tracking_host` (the sending domain has no active tracking subdomain and the sender is not a free mailbox, so opens and clicks stay at 0); null while it has no valid From. A free mailbox's broadcast is tracked on its pool's shared tracking host.",
        "tags": [
          "Broadcasts"
        ],
        "x-docs-ids": [
          "get-broadcast"
        ],
        "parameters": [
          {
            "name": "broadcast_id",
            "in": "path",
            "required": true,
            "description": "The broadcast id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "template_id": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The template the broadcast was made from; null for a broadcast with its own content."
                    },
                    "template_version_id": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The exact published template version whose content the broadcast copied."
                    },
                    "template_name": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "That template's name."
                    },
                    "template_version_number": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "That version's number."
                    },
                    "template_version_name": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "That version's name, when it has one."
                    },
                    "template_deleted": {
                      "type": "boolean",
                      "description": "True when the template was deleted since. The broadcast keeps its copy and still sends."
                    },
                    "unfillable_variables": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Only on a broadcast made from a template: the template variables its content uses that have no value in a broadcast (not a contact field and no fallback value in the template). While it is not empty, the broadcast cannot be sent or scheduled."
                    },
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "audience_id": {
                      "type": "string"
                    },
                    "segment_id": {
                      "type": "string"
                    },
                    "segment_ids": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "exclude_segment_ids": {
                      "type": "array"
                    },
                    "audience": {
                      "type": "string"
                    },
                    "unsubscribe_scope": {
                      "type": "string"
                    },
                    "from": {
                      "type": "string"
                    },
                    "subject": {
                      "type": "string"
                    },
                    "reply_to": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "preview_text": {
                      "type": "string"
                    },
                    "html": {
                      "type": "string"
                    },
                    "text": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "scheduled_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    },
                    "sent_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    },
                    "topic_id": {
                      "type": "string"
                    },
                    "design": {},
                    "tracking": {
                      "type": "boolean"
                    },
                    "template_engine": {
                      "type": "string"
                    },
                    "send_time_optimization": {
                      "type": "object",
                      "properties": {
                        "enabled": {
                          "type": "boolean"
                        },
                        "window_hours": {
                          "type": "number"
                        }
                      }
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "version_number": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "object": "broadcast",
                  "id": "559ac32e-9ef5-46fb-82a1-b76b840c0f7b",
                  "name": "October newsletter",
                  "audience_id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
                  "segment_id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
                  "segment_ids": [
                    "78261eea-8f8b-4381-83c6-79fa7120f1cf"
                  ],
                  "exclude_segment_ids": [],
                  "audience": "segments",
                  "unsubscribe_scope": "all",
                  "from": "Acme <news@acme.com>",
                  "subject": "What's new at Acme, {{{contact.first_name|there}}}",
                  "reply_to": [
                    "support@acme.com"
                  ],
                  "preview_text": "Three new features and a webinar invite.",
                  "html": "<p>Hi {{{contact.first_name|there}}},</p><p>Here is what's new.</p><p><a href=\"{{{unsubscribe_url}}}\">Unsubscribe</a></p>",
                  "text": "Hi {{{contact.first_name|there}}},\n\nHere is what's new.\n\nUnsubscribe: {{{unsubscribe_url}}}",
                  "status": "draft",
                  "created_at": "2026-10-07T09:15:22.481203+00:00",
                  "scheduled_at": null,
                  "sent_at": null,
                  "topic_id": "b6d24b8e-af0b-4c3c-be0c-359bbd97381e",
                  "design": null,
                  "tracking": true,
                  "template_engine": "simple",
                  "send_time_optimization": {
                    "enabled": false,
                    "window_hours": 24
                  },
                  "updated_at": "2026-10-07T09:15:22.481203+00:00",
                  "version_number": 3,
                  "template_id": null,
                  "template_version_id": null,
                  "template_name": null,
                  "template_version_number": null,
                  "template_version_name": null,
                  "template_deleted": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "patch": {
        "operationId": "updateBroadcast",
        "summary": "Update broadcast",
        "description": "Update a draft or scheduled broadcast. Only the fields you send change, and each update saves a new version. Once a broadcast is sending or sent, only `name` can be changed.\n\n- send.io extension: the response carries the new `updated_at` (send it as `expected_updated_at` on the next update), the `version_number` of the version this save recorded, `warnings` (deleted segments and topic), `unknown_merge_tags`, `from` and `tracking_status`, as on Retrieve broadcast, and `unfillable_variables` for a broadcast made from a template.\n\n- Returns 409 `conflict` when `expected_updated_at` (or `If-Match`) does not match: reload the broadcast and try again. Without either, the update behaves as before.\n\n- A segment or topic deleted since it was chosen is kept and listed in `warnings`, so a draft still saves. A scheduled broadcast must stay sendable: an update that leaves it incomplete, adds a deleted segment or topic, or adds a merge tag that would be sent as typed is refused with 422 and changes nothing. One that only keeps a deleted segment or topic it already named saves. When it falls due, a deleted segment under Send to only reaches nobody, so the rest are sent to; a deleted segment under Except, or a deleted topic, pauses it instead (see Resume broadcast). An id that never was a segment or topic of the team is a 404.\n\n- A broadcast made from a template: sending `html`, `text`, `design` or `template_engine` gives it its own content and detaches it from the template (`template_id` becomes null). `template_id` or `template_version_id` together with those fields is a 422.\n\n- Since November 2026, `template_id` on an update no longer overwrites a subject, preview text, From or Reply-To the broadcast already has: those are filled from the template only where the broadcast has none. Send them explicitly to change them.",
        "tags": [
          "Broadcasts"
        ],
        "x-docs-ids": [
          "update-broadcast"
        ],
        "parameters": [
          {
            "name": "broadcast_id",
            "in": "path",
            "required": true,
            "description": "The broadcast id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "segment_id": {
                    "type": "string",
                    "description": "The segment to send to (the single-segment form of `segment_ids`). `audience_id` is accepted as an alias. One of `segment_id`, `segment_ids` or `audience: \"all\"` is required to send the broadcast."
                  },
                  "audience_id": {
                    "type": "string",
                    "description": "Older name for `segment_id`."
                  },
                  "segment_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "send.io extension. Several segments to send to: a contact in more than one gets one email. Combined with `segment_id` when both are sent. Replaces the broadcast's segments on update."
                  },
                  "exclude_segment_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "send.io extension. Members of these segments are never sent the broadcast, whatever their status in them. Send an empty array or null to remove the exclusions."
                  },
                  "audience": {
                    "type": "string",
                    "description": "send.io extension. `segments` (the default: the subscribed members of the segments) or `all` (every contact of the team, minus exclusions). `all` cannot be combined with `segment_id` or `segment_ids`; setting segments later switches back to `segments`."
                  },
                  "unsubscribe_scope": {
                    "type": "string",
                    "description": "send.io extension. What the broadcast's unsubscribe link and one-click List-Unsubscribe do: `all` (the default: the contact is unsubscribed from everything, or opted out of `topic_id` when one is set) or `list` (the contact's status becomes `unsubscribed` in the broadcast's segments only, and `contact.list_unsubscribed` is sent). With `list`, the preference page also offers \"Unsubscribe from everything\"."
                  },
                  "from": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Sender address, e.g. \"Acme <news@acme.com>\". Required to send the broadcast, and its domain must be verified by then. A draft can be saved without it; an empty string clears it."
                  },
                  "subject": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Subject line. Cannot contain line breaks. Merge tags such as {{{contact.first_name|there}}} are filled in per contact. Required to send the broadcast; a draft can be saved without it."
                  },
                  "reply_to": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "One or more reply-to addresses."
                  },
                  "html": {
                    "type": "string",
                    "description": "HTML body. Supports contact merge tags and {{{unsubscribe_url}}}."
                  },
                  "template_engine": {
                    "type": "string",
                    "description": "send.io extension. How the subject, HTML and text are filled in for each contact: `simple` (the default: contact merge tags such as {{{contact.first_name|there}}} and {{{unsubscribe_url}}}) or `handlebars` (Handlebars with the contact as data: `contact.first_name`, `contact.<property>`, `unsubscribe_url`, plus `if`, `each` and the other helpers templates support). Handlebars content that does not parse is refused with a 422 naming the part."
                  },
                  "template_id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "send.io extension. Make the broadcast from a published template (id or alias): its HTML, text, design and template engine become the broadcast's content, and its subject, preview text, From and Reply-To fill those the request and the broadcast leave empty. The content is a copy of the exact version (`template_version_id`): later publishes do not change the broadcast. `null` detaches the broadcast from its template (the content stays). Cannot be combined with `html`, `text`, `design` or `template_engine` (422)."
                  },
                  "template_version_id": {
                    "type": "string",
                    "description": "send.io extension. The published version of the template to copy (a version that was published, even if another one is live now). Default: the template's published version. Sent alone, it switches the broadcast to another version of its template (422 when the broadcast is not made from a template)."
                  },
                  "text": {
                    "type": "string",
                    "description": "Plain text body. When omitted on create and `html` is set, a text version is generated from the HTML. Send an empty string to have no text part."
                  },
                  "name": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Internal name, shown only to you."
                  },
                  "preview_text": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Preview text shown by mail clients after the subject."
                  },
                  "topic_id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Send only to contacts subscribed to this topic. Send null to remove the topic."
                  },
                  "tracking": {
                    "type": "boolean",
                    "description": "send.io extension. Count opens and clicks when the sender domain's tracking subdomain is active. Defaults to true."
                  },
                  "send_time_optimization": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "description": "send.io extension. `{\"enabled\": true, \"window_hours\": 24}` sends each contact's copy shortly before the hour that contact usually opens email, learned from their past opens and clicks. The scheduled time becomes the earliest send time, and every copy goes out within `window_hours` (6, 12 or 24) of it. Contacts with too little history get it at the scheduled time, or at the hour your audience opens most; one contact in ten always gets it at the scheduled time, so the broadcast's stats can compare. While it waits between rounds the broadcast stays `queued` with `hold_reason` `send_time_wait` and `hold_until` set to the next round. Defaults to off; null turns it off. Can also be set on `POST /broadcasts/{id}/send`."
                  },
                  "version_name": {
                    "type": "string",
                    "description": "send.io extension. A name for the version this save records (see List broadcast versions). At most 100 characters."
                  },
                  "version_comment": {
                    "type": "string",
                    "description": "send.io extension. A comment for the version this save records. At most 1000 characters."
                  },
                  "expected_updated_at": {
                    "type": "string",
                    "description": "send.io extension. The `updated_at` you loaded. When the broadcast changed since (in another tab, by a teammate or through the API), the update is refused with 409 `conflict` instead of overwriting the other change. An `If-Match` header holding the same value works too."
                  }
                }
              },
              "example": {
                "subject": "October at Acme: three new features",
                "tracking": false,
                "expected_updated_at": "2026-10-08T14:58:03.120451+00:00"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "version_number": {
                      "type": "number"
                    },
                    "warnings": {
                      "type": "array"
                    },
                    "unknown_merge_tags": {
                      "type": "array"
                    }
                  }
                },
                "example": {
                  "object": "broadcast",
                  "id": "559ac32e-9ef5-46fb-82a1-b76b840c0f7b",
                  "updated_at": "2026-10-08T15:01:12.402913+00:00",
                  "version_number": 4,
                  "warnings": [],
                  "unknown_merge_tags": []
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "delete": {
        "operationId": "deleteBroadcast",
        "summary": "Delete broadcast",
        "description": "Delete a draft or scheduled broadcast. A scheduled broadcast is deleted before it sends.\n\n- Broadcasts that are sending, sent or canceled cannot be deleted (422).",
        "tags": [
          "Broadcasts"
        ],
        "x-docs-ids": [
          "delete-broadcast"
        ],
        "parameters": [
          {
            "name": "broadcast_id",
            "in": "path",
            "required": true,
            "description": "The broadcast id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "deleted": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "object": "broadcast",
                  "id": "559ac32e-9ef5-46fb-82a1-b76b840c0f7b",
                  "deleted": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/broadcasts/{broadcast_id}/send": {
      "post": {
        "operationId": "sendBroadcast",
        "summary": "Send broadcast",
        "description": "Send a draft broadcast now, or schedule it with `scheduled_at`.\n\n- Send a `scheduled` broadcast again to move it: with a new `scheduled_at` it is rescheduled, with `now: true` it sends now (send.io extension). With neither, a second send is refused with 422, so a double send never queues it twice.\n\n- A broadcast that names a segment or topic deleted since it was chosen (see `warnings` on Retrieve broadcast) is refused with 422 `validation_error` naming it; remove it first. A merge tag in the subject or preview text that would be sent as typed is refused with 422 `unknown_merge_tags`: \"`{{{FIRST_NAM}}}` in the subject is not a contact field or a variable of the template, so it would be sent as typed. Fix the tag or remove it.\"\n\n- Only a `draft` or `scheduled` broadcast can be sent. It must have a `from` address, a `subject`, an `html` or `text` body and recipients (422 naming what is missing), and the `from` domain must be verified, or the call fails with 403.\n\n- A broadcast made from a template whose content uses a variable with no value in a broadcast (see `unfillable_variables` on Retrieve broadcast) is refused, now or scheduled, with 422 `unfillable_variables`: \"`{{{RESET_URL}}}` has no value in a broadcast: give it a fallback value in the template, or use a contact field instead.\" The body lists the keys in `unfillable_variables`.\n\n- It sends the broadcast's current content: the newest saved version.\n\n- A broadcast to or excluding a rule-based segment that is being built waits, with `hold_reason: \"segment_building\"`, and is sent when the segment is ready. If the build fails, the broadcast fails with `failed_reason` `segment_sync_failed`. A contact that changed a second or two before the send may not have joined or left yet.\n\n- The request body is required, even though every field is optional: send `{}` to send now. A request with no body is refused with 422.\n\n- A broadcast created in the dashboard cannot be sent with an API key; send it from the dashboard.",
        "tags": [
          "Broadcasts"
        ],
        "x-docs-ids": [
          "send-broadcast"
        ],
        "parameters": [
          {
            "name": "broadcast_id",
            "in": "path",
            "required": true,
            "description": "The broadcast id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "scheduled_at": {
                    "type": "string",
                    "description": "When to send: an ISO 8601 timestamp or a relative time like \"in 30 minutes\", \"in 2 hours\" or \"in 3 days\". Must be in the future and within 30 days. Omit to send now."
                  },
                  "now": {
                    "type": "boolean",
                    "description": "send.io extension. `true` sends a `scheduled` broadcast now, in one step: when that is refused, the broadcast stays scheduled at its time. Not with `scheduled_at` (422)."
                  }
                }
              },
              "example": {
                "scheduled_at": "in 1 hour"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "id": "559ac32e-9ef5-46fb-82a1-b76b840c0f7b"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/broadcasts/{broadcast_id}/cancel": {
      "post": {
        "operationId": "cancelBroadcast",
        "summary": "Cancel broadcast",
        "description": "Stop a broadcast. A scheduled broadcast goes back to `draft`; a sending (`queued`) broadcast stops and becomes `canceled`.\n\n- send.io extension.\n\n- Emails already handed off before a cancel are still delivered.\n\n- A paused broadcast can be canceled too: nobody after where it paused gets the email.",
        "tags": [
          "Broadcasts"
        ],
        "x-docs-ids": [
          "cancel-broadcast"
        ],
        "parameters": [
          {
            "name": "broadcast_id",
            "in": "path",
            "required": true,
            "description": "The broadcast id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "object": "broadcast",
                  "id": "559ac32e-9ef5-46fb-82a1-b76b840c0f7b"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/broadcasts/{broadcast_id}/pause": {
      "post": {
        "operationId": "pauseBroadcast",
        "summary": "Pause broadcast",
        "description": "Pause a sending (`queued`) broadcast after the batch in flight. It stays `queued` with `paused_at` set and resumes from the next recipient.\n\n- send.io extension. Answers with the whole broadcast.\n\n- Pausing a paused broadcast changes nothing. A broadcast just sent now (or whose scheduled time has come) pauses before its first recipient. A scheduled broadcast still in the future, or one that is not sending, is a 409.\n\n- Up to one batch (1,000 recipients) that was already being handed off still goes out.",
        "tags": [
          "Broadcasts"
        ],
        "x-docs-ids": [
          "pause-broadcast"
        ],
        "parameters": [
          {
            "name": "broadcast_id",
            "in": "path",
            "required": true,
            "description": "The broadcast id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "paused_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "object": "broadcast",
                  "id": "559ac32e-9ef5-46fb-82a1-b76b840c0f7b",
                  "status": "queued",
                  "paused_at": "2026-10-08T15:04:12Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/broadcasts/{broadcast_id}/resume": {
      "post": {
        "operationId": "resumeBroadcast",
        "summary": "Resume broadcast",
        "description": "Resume a paused broadcast from the next recipient. `paused_at` becomes null.\n\n- send.io extension. Answers with the whole broadcast.\n\n- Resuming a broadcast that is sending and not paused changes nothing. A broadcast that is not sending is a 409.\n\n- A segment under Except, or the topic, deleted while a broadcast is due or sending would no longer leave anybody out, so the broadcast is paused where it is (`paused_at` set, nothing more sent). It resumes only once they are out of its audience: pass them in `remove_deleted`, or it is a 422 `audience_deleted` that names them. Contacts it already emailed do not get it again.",
        "tags": [
          "Broadcasts"
        ],
        "x-docs-ids": [
          "resume-broadcast"
        ],
        "parameters": [
          {
            "name": "broadcast_id",
            "in": "path",
            "required": true,
            "description": "The broadcast id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "remove_deleted": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "The deleted segment and topic ids, as the broadcast's `warnings` list them (`segment_id`, `topic_id`), to take out of its audience before it goes on. Only ids that are deleted and named are removed."
                  }
                }
              },
              "example": {
                "remove_deleted": [
                  "78261eea-8f8b-4381-83c6-79fa7120f1cf"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "paused_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "object": "broadcast",
                  "id": "559ac32e-9ef5-46fb-82a1-b76b840c0f7b",
                  "status": "queued",
                  "paused_at": null
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/broadcasts/{broadcast_id}/continue": {
      "post": {
        "operationId": "continueBroadcast",
        "summary": "Continue broadcast",
        "description": "Continue a broadcast that stopped part way: one that was canceled while sending, or failed with `failed_reason` `insufficient_credits` or `send_error`. It is `queued` again and sends only to the contacts of its audience it has not emailed yet, so nobody it reached gets it twice.\n\n- send.io extension. Answers with the whole broadcast.\n\n- The audience is read as it is now: contacts that joined since are included, contacts that left are not.\n\n- Any other status or failure (for example `all_recipients_failed` or `no_audience`) is a 422 `validation_error`: duplicate the broadcast instead. The copy goes to everyone in its audience again.\n\n- Its audience can no longer be edited, so a segment or topic deleted since is handled here: a deleted segment under Send to reaches nobody and is left as it is; a deleted segment under Except, or a deleted topic, is a 422 `audience_deleted` unless `remove_deleted` lists it.\n\n- It must still be sendable, as on Send broadcast (From on a verified domain, subject, body, recipients). With a credits plan and no credits left it is refused with 422 `insufficient_credits` before anything is queued.\n\n- Right after a stop, while the batch that was in flight is still being handed off (up to about a minute), it is refused with 422; try again shortly.\n\n- A broadcast created in the dashboard cannot be continued with an API key.",
        "tags": [
          "Broadcasts"
        ],
        "x-docs-ids": [
          "continue-broadcast"
        ],
        "parameters": [
          {
            "name": "broadcast_id",
            "in": "path",
            "required": true,
            "description": "The broadcast id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "remove_deleted": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "The deleted segment and topic ids, as the broadcast's `warnings` list them, to take out of its audience before it goes on (as on Resume broadcast)."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "failed_reason": {}
                  }
                },
                "example": {
                  "object": "broadcast",
                  "id": "559ac32e-9ef5-46fb-82a1-b76b840c0f7b",
                  "status": "queued",
                  "failed_reason": null
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "402": {
            "$ref": "#/components/responses/E402"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/broadcasts/{broadcast_id}/duplicate": {
      "post": {
        "operationId": "duplicateBroadcast",
        "summary": "Duplicate broadcast",
        "description": "Copy a broadcast into a new draft with the same segment, topic, sender, content and tracking setting. The copy's name ends in \"(copy)\".\n\n- send.io extension. The copy starts its own version history.\n\n- The copy is a new broadcast: it goes to everyone in its audience again, including contacts the original already emailed. To reach only the rest of a broadcast that stopped part way, use Continue broadcast.",
        "tags": [
          "Broadcasts"
        ],
        "x-docs-ids": [
          "duplicate-broadcast"
        ],
        "parameters": [
          {
            "name": "broadcast_id",
            "in": "path",
            "required": true,
            "description": "The broadcast id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "object": "broadcast",
                  "id": "8d3f1b7a-6c2e-4a9d-b5f0-2e4c6a8b0d1f"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/broadcasts/{broadcast_id}/versions": {
      "get": {
        "operationId": "listBroadcastVersions",
        "summary": "List broadcast versions",
        "description": "Every saved version of a broadcast, newest first. Each create, update, duplicate and restore of a draft or scheduled broadcast saves one, with the whole broadcast as saved: content, sender and audience.\n\n- send.io extension. `current` marks the version the broadcast holds now, the one it sends. There is no published version: a broadcast sends its current content when it sends.",
        "tags": [
          "Broadcasts"
        ],
        "x-docs-ids": [
          "list-broadcast-versions"
        ],
        "parameters": [
          {
            "name": "broadcast_id",
            "in": "path",
            "required": true,
            "description": "The broadcast id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Number of versions to return, 1 to 100. Defaults to 20.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "Return the versions older than this version id or version number (the next page). Cannot be used with `before`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "description": "Return the versions newer than this version id or version number (the previous page). Cannot be used with `after`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "object": {
                            "type": "string"
                          },
                          "id": {
                            "type": "string"
                          },
                          "broadcast_id": {
                            "type": "string"
                          },
                          "version_number": {
                            "type": "number"
                          },
                          "name": {
                            "type": "string"
                          },
                          "comment": {},
                          "broadcast_name": {
                            "type": "string"
                          },
                          "subject": {
                            "type": "string"
                          },
                          "restored_from": {},
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "current": {
                            "type": "boolean"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "has_more": false,
                  "data": [
                    {
                      "object": "broadcast_version",
                      "id": "3c9e1f42-7b8a-4d6e-9f0a-1b2c3d4e5f60",
                      "broadcast_id": "559ac32e-9ef5-46fb-82a1-b76b840c0f7b",
                      "version_number": 3,
                      "name": "Final copy",
                      "comment": null,
                      "broadcast_name": "October newsletter",
                      "subject": "What's new at Acme, {{{contact.first_name|there}}}",
                      "restored_from": null,
                      "created_at": "2026-10-07T09:15:22.481203+00:00",
                      "current": true
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/broadcasts/{broadcast_id}/versions/{version}": {
      "get": {
        "operationId": "retrieveBroadcastVersion",
        "summary": "Retrieve broadcast version",
        "description": "One version with its full content, sender and audience.\n\n- send.io extension.",
        "tags": [
          "Broadcasts"
        ],
        "x-docs-ids": [
          "retrieve-broadcast-version"
        ],
        "parameters": [
          {
            "name": "broadcast_id",
            "in": "path",
            "required": true,
            "description": "The broadcast id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "version",
            "in": "path",
            "required": true,
            "description": "The version id or its `version_number`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "broadcast_id": {
                      "type": "string"
                    },
                    "version_number": {
                      "type": "number"
                    },
                    "name": {
                      "type": "string"
                    },
                    "comment": {},
                    "broadcast_name": {
                      "type": "string"
                    },
                    "subject": {
                      "type": "string"
                    },
                    "restored_from": {},
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "current": {
                      "type": "boolean"
                    },
                    "from": {
                      "type": "string"
                    },
                    "reply_to": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "preview_text": {
                      "type": "string"
                    },
                    "html": {
                      "type": "string"
                    },
                    "text": {
                      "type": "string"
                    },
                    "design": {},
                    "template_engine": {
                      "type": "string"
                    },
                    "tracking": {
                      "type": "boolean"
                    },
                    "topic_id": {
                      "type": "string"
                    },
                    "segment_ids": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "exclude_segment_ids": {
                      "type": "array"
                    },
                    "audience": {
                      "type": "string"
                    },
                    "unsubscribe_scope": {
                      "type": "string"
                    },
                    "template_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "template_version_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                },
                "example": {
                  "object": "broadcast_version",
                  "id": "3c9e1f42-7b8a-4d6e-9f0a-1b2c3d4e5f60",
                  "broadcast_id": "559ac32e-9ef5-46fb-82a1-b76b840c0f7b",
                  "version_number": 3,
                  "name": "Final copy",
                  "comment": null,
                  "broadcast_name": "October newsletter",
                  "subject": "What's new at Acme, {{{contact.first_name|there}}}",
                  "restored_from": null,
                  "created_at": "2026-10-07T09:15:22.481203+00:00",
                  "current": true,
                  "from": "Acme <news@acme.com>",
                  "reply_to": [
                    "support@acme.com"
                  ],
                  "preview_text": "Three new features and a webinar invite.",
                  "html": "<p>Hi {{{contact.first_name|there}}},</p><p>Here is what's new.</p><p><a href=\"{{{unsubscribe_url}}}\">Unsubscribe</a></p>",
                  "text": "Hi {{{contact.first_name|there}}},\n\nHere is what's new.\n\nUnsubscribe: {{{unsubscribe_url}}}",
                  "design": null,
                  "template_engine": "simple",
                  "tracking": true,
                  "topic_id": "b6d24b8e-af0b-4c3c-be0c-359bbd97381e",
                  "segment_ids": [
                    "78261eea-8f8b-4381-83c6-79fa7120f1cf"
                  ],
                  "exclude_segment_ids": [],
                  "audience": "segments",
                  "unsubscribe_scope": "all",
                  "template_id": null,
                  "template_version_id": null
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "patch": {
        "operationId": "updateBroadcastVersion",
        "summary": "Update broadcast version",
        "description": "Rename a version or change its comment. A version's content cannot change: update the broadcast to save a new version.\n\n- send.io extension. Any other field returns 422.",
        "tags": [
          "Broadcasts"
        ],
        "x-docs-ids": [
          "update-broadcast-version"
        ],
        "parameters": [
          {
            "name": "broadcast_id",
            "in": "path",
            "required": true,
            "description": "The broadcast id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "version",
            "in": "path",
            "required": true,
            "description": "The version id or its `version_number`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Version name. At most 100 characters."
                  },
                  "comment": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Version comment. At most 1000 characters."
                  }
                }
              },
              "example": {
                "name": "Final copy",
                "comment": "Approved by marketing."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "broadcast_id": {
                      "type": "string"
                    },
                    "version_number": {
                      "type": "number"
                    },
                    "name": {
                      "type": "string"
                    },
                    "comment": {},
                    "broadcast_name": {
                      "type": "string"
                    },
                    "subject": {
                      "type": "string"
                    },
                    "restored_from": {},
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "current": {
                      "type": "boolean"
                    },
                    "from": {
                      "type": "string"
                    },
                    "reply_to": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "preview_text": {
                      "type": "string"
                    },
                    "html": {
                      "type": "string"
                    },
                    "text": {
                      "type": "string"
                    },
                    "design": {},
                    "template_engine": {
                      "type": "string"
                    },
                    "tracking": {
                      "type": "boolean"
                    },
                    "topic_id": {
                      "type": "string"
                    },
                    "segment_ids": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "exclude_segment_ids": {
                      "type": "array"
                    },
                    "audience": {
                      "type": "string"
                    },
                    "unsubscribe_scope": {
                      "type": "string"
                    },
                    "template_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "template_version_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                },
                "example": {
                  "object": "broadcast_version",
                  "id": "3c9e1f42-7b8a-4d6e-9f0a-1b2c3d4e5f60",
                  "broadcast_id": "559ac32e-9ef5-46fb-82a1-b76b840c0f7b",
                  "version_number": 3,
                  "name": "Final copy",
                  "comment": null,
                  "broadcast_name": "October newsletter",
                  "subject": "What's new at Acme, {{{contact.first_name|there}}}",
                  "restored_from": null,
                  "created_at": "2026-10-07T09:15:22.481203+00:00",
                  "current": true,
                  "from": "Acme <news@acme.com>",
                  "reply_to": [
                    "support@acme.com"
                  ],
                  "preview_text": "Three new features and a webinar invite.",
                  "html": "<p>Hi {{{contact.first_name|there}}},</p><p>Here is what's new.</p><p><a href=\"{{{unsubscribe_url}}}\">Unsubscribe</a></p>",
                  "text": "Hi {{{contact.first_name|there}}},\n\nHere is what's new.\n\nUnsubscribe: {{{unsubscribe_url}}}",
                  "design": null,
                  "template_engine": "simple",
                  "tracking": true,
                  "topic_id": "b6d24b8e-af0b-4c3c-be0c-359bbd97381e",
                  "segment_ids": [
                    "78261eea-8f8b-4381-83c6-79fa7120f1cf"
                  ],
                  "exclude_segment_ids": [],
                  "audience": "segments",
                  "unsubscribe_scope": "all",
                  "template_id": null,
                  "template_version_id": null
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/broadcasts/{broadcast_id}/versions/{version}/restore": {
      "post": {
        "operationId": "restoreBroadcastVersion",
        "summary": "Restore broadcast version",
        "description": "Copy a saved version (content, sender and audience) back into a draft or scheduled broadcast. The result is saved as a new version, so the history only grows. Nothing is sent: a scheduled broadcast keeps its time.\n\n- send.io extension. A broadcast that is sending, sent or canceled cannot be restored (422).\n\n- Segments and a topic deleted since the version was saved are left out.",
        "tags": [
          "Broadcasts"
        ],
        "x-docs-ids": [
          "restore-broadcast-version"
        ],
        "parameters": [
          {
            "name": "broadcast_id",
            "in": "path",
            "required": true,
            "description": "The broadcast id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "version",
            "in": "path",
            "required": true,
            "description": "The version id or its `version_number`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "version_name": {
                    "type": "string",
                    "description": "A name for the new version."
                  },
                  "version_comment": {
                    "type": "string",
                    "description": "A comment for the new version."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "broadcast_id": {
                      "type": "string"
                    },
                    "version_number": {
                      "type": "number"
                    },
                    "name": {
                      "type": "string"
                    },
                    "comment": {},
                    "broadcast_name": {
                      "type": "string"
                    },
                    "subject": {
                      "type": "string"
                    },
                    "restored_from": {
                      "type": "number"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "current": {
                      "type": "boolean"
                    },
                    "from": {
                      "type": "string"
                    },
                    "reply_to": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "preview_text": {
                      "type": "string"
                    },
                    "html": {
                      "type": "string"
                    },
                    "text": {
                      "type": "string"
                    },
                    "design": {},
                    "template_engine": {
                      "type": "string"
                    },
                    "tracking": {
                      "type": "boolean"
                    },
                    "topic_id": {
                      "type": "string"
                    },
                    "segment_ids": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "exclude_segment_ids": {
                      "type": "array"
                    },
                    "audience": {
                      "type": "string"
                    },
                    "unsubscribe_scope": {
                      "type": "string"
                    },
                    "template_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "template_version_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                },
                "example": {
                  "object": "broadcast_version",
                  "id": "3c9e1f42-7b8a-4d6e-9f0a-1b2c3d4e5f60",
                  "broadcast_id": "559ac32e-9ef5-46fb-82a1-b76b840c0f7b",
                  "version_number": 4,
                  "name": "Final copy",
                  "comment": null,
                  "broadcast_name": "October newsletter",
                  "subject": "What's new at Acme, {{{contact.first_name|there}}}",
                  "restored_from": 2,
                  "created_at": "2026-10-07T09:15:22.481203+00:00",
                  "current": true,
                  "from": "Acme <news@acme.com>",
                  "reply_to": [
                    "support@acme.com"
                  ],
                  "preview_text": "Three new features and a webinar invite.",
                  "html": "<p>Hi {{{contact.first_name|there}}},</p><p>Here is what's new.</p><p><a href=\"{{{unsubscribe_url}}}\">Unsubscribe</a></p>",
                  "text": "Hi {{{contact.first_name|there}}},\n\nHere is what's new.\n\nUnsubscribe: {{{unsubscribe_url}}}",
                  "design": null,
                  "template_engine": "simple",
                  "tracking": true,
                  "topic_id": "b6d24b8e-af0b-4c3c-be0c-359bbd97381e",
                  "segment_ids": [
                    "78261eea-8f8b-4381-83c6-79fa7120f1cf"
                  ],
                  "exclude_segment_ids": [],
                  "audience": "segments",
                  "unsubscribe_scope": "all",
                  "template_id": null,
                  "template_version_id": null
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/broadcasts/estimate": {
      "post": {
        "operationId": "estimateBroadcast",
        "summary": "Estimate recipients",
        "description": "How many contacts an audience reaches right now, before you create or send the broadcast, and how many it skips because their address is marked invalid.\n\n- send.io extension. Unsubscribed contacts are not counted. Suppressed addresses are skipped when the broadcast sends, so the number sent can be a little lower.\n\n- Contacts whose address is marked invalid (it cannot receive mail) are never sent to and are counted in `skipped.invalid`.\n\n- With no segment and no `audience: \"all\"` the estimate is 0.\n\n- A segment or topic deleted since it was chosen is not an error: it is listed in `warnings` (as on Retrieve broadcast). A deleted segment has no members, and a deleted topic is left out of the count. An id that never was a segment or topic of the team is a 404.",
        "tags": [
          "Broadcasts"
        ],
        "x-docs-ids": [
          "estimate-broadcast"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "segment_id": {
                    "type": "string",
                    "description": "One segment to send to."
                  },
                  "segment_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Several segments: a contact in more than one counts once."
                  },
                  "exclude_segment_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Members of these segments are not counted."
                  },
                  "audience": {
                    "type": "string",
                    "description": "`all` counts every contact (minus exclusions); `segments` (the default) the segments' subscribed members."
                  },
                  "topic_id": {
                    "type": "string",
                    "description": "Leave out contacts who are not subscribed to this topic."
                  }
                }
              },
              "example": {
                "segment_ids": [
                  "78261eea-8f8b-4381-83c6-79fa7120f1cf"
                ],
                "exclude_segment_ids": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "recipients": {
                      "type": "number"
                    },
                    "skipped": {
                      "type": "object",
                      "properties": {
                        "invalid": {
                          "type": "number"
                        }
                      }
                    },
                    "warnings": {
                      "type": "array"
                    }
                  }
                },
                "example": {
                  "object": "broadcast_estimate",
                  "recipients": 1240,
                  "skipped": {
                    "invalid": 18
                  },
                  "warnings": []
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/broadcasts/{broadcast_id}/test": {
      "post": {
        "operationId": "testBroadcast",
        "summary": "Send test broadcast",
        "description": "Send a test of a broadcast to up to 5 addresses. Each test is personalized with sample values (Ada Lovelace, ada@example.com), or with the contact you choose with `contact_id`, and its subject starts with `[Test]`.\n\n- send.io extension. Tests do not count as sends and do not change the broadcast.\n\n- The broadcast needs a `from` address, a `subject` and an `html` or `text` body (422 naming what is missing).\n\n- A test is not refused for `unfillable_variables`, so you can see the email without their values.",
        "tags": [
          "Broadcasts"
        ],
        "x-docs-ids": [
          "test-broadcast"
        ],
        "parameters": [
          {
            "name": "broadcast_id",
            "in": "path",
            "required": true,
            "description": "The broadcast id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "to": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "1 to 5 addresses to send the test to."
                  },
                  "contact_id": {
                    "type": "string",
                    "description": "A contact of the broadcast's audience (its id or email address) to personalize the test with. A contact outside the audience is a 404."
                  }
                },
                "required": [
                  "to"
                ]
              },
              "example": {
                "to": [
                  "you@example.com"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "sent": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "object": "broadcast_test",
                  "sent": 1
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/broadcasts/{broadcast_id}/stats": {
      "get": {
        "operationId": "broadcastStats",
        "summary": "Retrieve broadcast stats",
        "description": "The numbers of a broadcast: how many it was sent and delivered to, opens, clicks, bounces, complaints and unsubscribes, with rates and sending progress.\n\n- send.io extension. Rates are fractions: delivery over sent, opens, clicks and unsubscribes over delivered (unique), bounces over sent.\n\n- Numbers are cached for up to 60 seconds (5 seconds while the broadcast is scheduled or sending).",
        "tags": [
          "Broadcasts"
        ],
        "x-docs-ids": [
          "broadcast-stats"
        ],
        "parameters": [
          {
            "name": "broadcast_id",
            "in": "path",
            "required": true,
            "description": "The broadcast id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "recipients": {
                      "type": "number"
                    },
                    "sent": {
                      "type": "number"
                    },
                    "delivered": {
                      "type": "number"
                    },
                    "bounced": {
                      "type": "number"
                    },
                    "complained": {
                      "type": "number"
                    },
                    "suppressed": {
                      "type": "number"
                    },
                    "failed": {
                      "type": "number"
                    },
                    "opened": {
                      "type": "number"
                    },
                    "unique_opened": {
                      "type": "number"
                    },
                    "clicked": {
                      "type": "number"
                    },
                    "unique_clicked": {
                      "type": "number"
                    },
                    "unsubscribed": {
                      "type": "number"
                    },
                    "skipped": {
                      "type": "object",
                      "properties": {
                        "invalid": {
                          "type": "number"
                        }
                      }
                    },
                    "delivery_rate": {
                      "type": "number"
                    },
                    "open_rate": {
                      "type": "number"
                    },
                    "click_rate": {
                      "type": "number"
                    },
                    "bounce_rate": {
                      "type": "number"
                    },
                    "unsubscribe_rate": {
                      "type": "number"
                    },
                    "progress": {
                      "type": "object",
                      "properties": {
                        "queued": {
                          "type": "number"
                        },
                        "total": {
                          "type": "number"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "broadcast_stats",
                  "status": "sent",
                  "recipients": 1240,
                  "sent": 1240,
                  "delivered": 1225,
                  "bounced": 9,
                  "complained": 1,
                  "suppressed": 6,
                  "failed": 0,
                  "opened": 812,
                  "unique_opened": 604,
                  "clicked": 211,
                  "unique_clicked": 158,
                  "unsubscribed": 4,
                  "skipped": {
                    "invalid": 18
                  },
                  "delivery_rate": 0.9879,
                  "open_rate": 0.4931,
                  "click_rate": 0.129,
                  "bounce_rate": 0.0073,
                  "unsubscribe_rate": 0.0033,
                  "progress": {
                    "queued": 1240,
                    "total": 1240
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/broadcasts/{broadcast_id}/recipients": {
      "get": {
        "operationId": "listBroadcastRecipients",
        "summary": "List broadcast recipients",
        "description": "The recipients of a broadcast, all of them or for one event: who it was sent or delivered to, who opened or clicked, bounced, complained, unsubscribed, or was suppressed. Each row has its latest `status`.\n\n- `id` is a pagination cursor, not an entity id. `count` is returned for `opened` and `clicked`, `clicked_links` for `clicked`, `bounce_type` for `bounced`.\n\n- `contact_id` is null when the recipient is not, or no longer, a contact.\n\n- `status` (send.io extension) is the recipient's latest status, strongest first: `unsubscribed`, `complained`, `bounced`, `suppressed`, `failed`, `clicked`, `opened`, `delivered`, `delivery_delayed`, `sent` or `queued`. With `type=all` or `suppressed`, a suppressed row also has `suppression_reason`: `bounce`, `complaint` or `manual` (the origin of the suppression on the address), or null once that suppression was removed.",
        "tags": [
          "Broadcasts"
        ],
        "x-docs-ids": [
          "list-broadcast-recipients"
        ],
        "parameters": [
          {
            "name": "broadcast_id",
            "in": "path",
            "required": true,
            "description": "The broadcast id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": true,
            "description": "`all`, `sent`, `delivered`, `opened`, `clicked`, `bounced`, `complained`, `unsubscribed` or `suppressed`. `all` (send.io extension) lists every recipient, suppressed and failed ones included.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "email",
            "in": "query",
            "required": false,
            "description": "Only recipients whose address contains this text.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "bounce_type",
            "in": "query",
            "required": false,
            "description": "`permanent`, `transient` or `undetermined`. Only with `type=bounced`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Number of recipients to return, 1 to 100. Defaults to 20.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "Return the recipients after this `id` (the next page). Cannot be used with `before`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "description": "Return the recipients just before this `id` (the previous page). Cannot be used with `after`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "contact_id": {
                            "type": "string"
                          },
                          "email": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "count": {
                            "type": "number"
                          },
                          "clicked_links": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "url": {
                                  "type": "string"
                                },
                                "clicks": {
                                  "type": "number"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "has_more": true,
                  "data": [
                    {
                      "id": "4ef9a417-02e9-4d39-ad75-9611e0fcc33c",
                      "contact_id": "4f3c2a1e-8b6d-4e2f-9a7c-1d5e3b8f6a20",
                      "email": "steve.wozniak@gmail.com",
                      "status": "clicked",
                      "count": 3,
                      "clicked_links": [
                        {
                          "url": "https://example.com/pricing",
                          "clicks": 2
                        }
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/broadcasts/{broadcast_id}/clicked-links": {
      "get": {
        "operationId": "listBroadcastClickedLinks",
        "summary": "List broadcast clicked links",
        "description": "The links clicked in a broadcast, most clicked first, with total clicks and the number of recipients who clicked.\n\n- `id` is a pagination cursor, not an entity id. `clicks` counts repeat clicks; `unique_clicks` counts recipients.",
        "tags": [
          "Broadcasts"
        ],
        "x-docs-ids": [
          "list-broadcast-clicked-links"
        ],
        "parameters": [
          {
            "name": "broadcast_id",
            "in": "path",
            "required": true,
            "description": "The broadcast id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Number of links to return, 1 to 100. Defaults to 20.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "Return the links after this `id` (the next page). Cannot be used with `before`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "description": "Return the links just before this `id` (the previous page). Cannot be used with `after`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string"
                          },
                          "clicks": {
                            "type": "number"
                          },
                          "unique_clicks": {
                            "type": "number"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "has_more": false,
                  "data": [
                    {
                      "id": "9c1d4e7a2b6f8035",
                      "url": "https://example.com/pricing",
                      "clicks": 42,
                      "unique_clicks": 30
                    },
                    {
                      "id": "51a0c3e9d27b4f68",
                      "url": "https://example.com/docs",
                      "clicks": 17,
                      "unique_clicks": 15
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/unsubscribe-page": {
      "get": {
        "operationId": "getUnsubscribePage",
        "summary": "Retrieve unsubscribe page",
        "description": "Get your unsubscribe page settings. Fields you have not set show their defaults.\n\n- send.io extension.",
        "tags": [
          "Unsubscribe page"
        ],
        "x-docs-ids": [
          "get-unsubscribe-page"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "logo_url": {},
                    "background_color": {
                      "type": "string"
                    },
                    "text_color": {
                      "type": "string"
                    },
                    "accent_color": {
                      "type": "string"
                    },
                    "show_footer": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "object": "unsubscribe_page",
                  "title": "Email preferences",
                  "description": "Choose which emails you want to receive.",
                  "logo_url": null,
                  "background_color": "#f6f6f7",
                  "text_color": "#111111",
                  "accent_color": "#4f46e5",
                  "show_footer": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "patch": {
        "operationId": "updateUnsubscribePage",
        "summary": "Update unsubscribe page",
        "description": "Change your unsubscribe page settings. Only the fields you send change; null or an empty string resets a field to its default.\n\n- send.io extension.",
        "tags": [
          "Unsubscribe page"
        ],
        "x-docs-ids": [
          "update-unsubscribe-page"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Page heading. At most 100 characters."
                  },
                  "description": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Text under the heading. At most 300 characters."
                  },
                  "logo_url": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Logo image. Must be an https URL."
                  },
                  "background_color": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Page background, as #rrggbb."
                  },
                  "text_color": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Text color, as #rrggbb."
                  },
                  "accent_color": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Button and link color, as #rrggbb."
                  },
                  "show_footer": {
                    "type": "boolean",
                    "description": "Show the page footer."
                  }
                }
              },
              "example": {
                "title": "Acme email preferences",
                "logo_url": "https://acme.com/logo.png",
                "accent_color": "#0f766e",
                "show_footer": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "logo_url": {
                      "type": "string"
                    },
                    "background_color": {
                      "type": "string"
                    },
                    "text_color": {
                      "type": "string"
                    },
                    "accent_color": {
                      "type": "string"
                    },
                    "show_footer": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "object": "unsubscribe_page",
                  "title": "Acme email preferences",
                  "description": "Choose which emails you want to receive.",
                  "logo_url": "https://acme.com/logo.png",
                  "background_color": "#f6f6f7",
                  "text_color": "#111111",
                  "accent_color": "#0f766e",
                  "show_footer": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/transactional": {
      "post": {
        "operationId": "createTransactionalEmail",
        "summary": "Create transactional email",
        "description": "Save a transactional email on a published template. Returns it, with its `tx_...` id to send it by.\n\n- Errors: 404 for an unknown template; 422 when the template has no published version (\"Template X has no published version. Publish it first.\"), when it is a workflow email, or when a field is missing or invalid; 403 when the From domain is not a verified sending domain of your team.\n\n- With a `handlebars` template the subject and preview text must parse as Handlebars (the 422 names the part, line and column). Variables the template does not declare are allowed: a send fills them from its `variables`.\n\n- `html`, `text`, `react`, `design`, `template`, `template_engine` and `variables` are refused: the content comes from the template.\n\n- Admins only (members may list, read and send a test). API keys with `sending_access` cannot use this endpoint; they can send a transactional email by id. Supports the `Idempotency-Key` header.",
        "tags": [
          "Transactional emails"
        ],
        "x-docs-ids": [
          "create-transactional-email"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Makes a retry safe: the same key and body within 24 hours returns the first response instead of doing the work again. A key still in use by a request that has not finished, or reused with a different body, answers 409.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Your name for it, 1 to 255 characters. Shown only to you."
                  },
                  "template_id": {
                    "type": "string",
                    "description": "The template (id or alias) whose published version is its content. The template must be published and not a workflow email. Sends always use the template's current published version."
                  },
                  "from": {
                    "type": "string",
                    "description": "Sender, `Name <user@domain>` or an address, on a verified sending domain of your team (403 otherwise). `onboarding@send.io` is also accepted, to try the feature before you have a domain; sends from it only reach test addresses."
                  },
                  "subject": {
                    "type": "string",
                    "description": "Subject line, without line breaks. May use the template's variables (`{{CODE}}`), filled from each send's `variables`."
                  },
                  "preview_text": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Inbox preview text. Empty or null means none (the template's own preview text is not used)."
                  },
                  "reply_to": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Reply-To address or addresses, at most 50. Empty or null means none."
                  },
                  "track_opens": {
                    "type": "boolean",
                    "description": "Count opens of its sends (when the domain's tracking subdomain is active). Default false: one-time codes and verification links are usually sent untracked. A send's own `track_opens` overrides it."
                  },
                  "track_clicks": {
                    "type": "boolean",
                    "description": "Rewrite links to count clicks (when the domain's tracking subdomain is active). Default false. A send's own `track_clicks` overrides it."
                  }
                },
                "required": [
                  "name",
                  "template_id",
                  "from",
                  "subject"
                ]
              },
              "example": {
                "name": "Sign-in code",
                "template_id": "signin-code",
                "from": "Acme Security <security@acme.com>",
                "subject": "Your code is {{CODE}}",
                "preview_text": "It expires in 10 minutes.",
                "reply_to": "support@acme.com"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "template_id": {
                      "type": "string"
                    },
                    "template_name": {
                      "type": "string"
                    },
                    "template_alias": {
                      "type": "string"
                    },
                    "template_deleted": {
                      "type": "boolean"
                    },
                    "published_version_id": {
                      "type": "string"
                    },
                    "published_version_number": {
                      "type": "number"
                    },
                    "from": {
                      "type": "string"
                    },
                    "subject": {
                      "type": "string"
                    },
                    "preview_text": {
                      "type": "string"
                    },
                    "reply_to": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "track_opens": {
                      "type": "boolean"
                    },
                    "track_clicks": {
                      "type": "boolean"
                    },
                    "created_via": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "object": "transactional_email",
                  "id": "tx_2hX9Yq1bVv0kq3W4m8sZJt1aB7c",
                  "name": "Sign-in code",
                  "template_id": "34a080c9-b17d-4187-ad80-5af20266e535",
                  "template_name": "Sign-in code",
                  "template_alias": "signin-code",
                  "template_deleted": false,
                  "published_version_id": "6a1f4c2e-8b3d-4e5f-9a7b-0c1d2e3f4a5b",
                  "published_version_number": 3,
                  "from": "Acme Security <security@acme.com>",
                  "subject": "Your code is {{CODE}}",
                  "preview_text": "It expires in 10 minutes.",
                  "reply_to": [
                    "support@acme.com"
                  ],
                  "track_opens": false,
                  "track_clicks": false,
                  "created_via": "api",
                  "created_at": "2026-10-07T09:12:44.123456+00:00",
                  "updated_at": "2026-10-07T09:12:44.123456+00:00"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "get": {
        "operationId": "listTransactionalEmails",
        "summary": "List transactional emails",
        "description": "List the team's transactional emails, newest first.",
        "tags": [
          "Transactional emails"
        ],
        "x-docs-ids": [
          "list-transactional-emails"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Number of items to return, 1 to 100. Defaults to 20.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "Return items after this id (`tx_...`, the next page). Cannot be used with `before`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "description": "Return items before this id (the previous page). Cannot be used with `after`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Case-insensitive contains match on the name and subject.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "template_id",
            "in": "query",
            "required": false,
            "description": "Only the transactional emails of this template (id or alias).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "object": {
                            "type": "string"
                          },
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "template_id": {
                            "type": "string"
                          },
                          "template_name": {
                            "type": "string"
                          },
                          "template_alias": {
                            "type": "string"
                          },
                          "template_deleted": {
                            "type": "boolean"
                          },
                          "published_version_id": {
                            "type": "string"
                          },
                          "published_version_number": {
                            "type": "number"
                          },
                          "from": {
                            "type": "string"
                          },
                          "subject": {
                            "type": "string"
                          },
                          "preview_text": {
                            "type": "string"
                          },
                          "reply_to": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "track_opens": {
                            "type": "boolean"
                          },
                          "track_clicks": {
                            "type": "boolean"
                          },
                          "created_via": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updated_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "has_more": false,
                  "data": [
                    {
                      "object": "transactional_email",
                      "id": "tx_2hX9Yq1bVv0kq3W4m8sZJt1aB7c",
                      "name": "Sign-in code",
                      "template_id": "34a080c9-b17d-4187-ad80-5af20266e535",
                      "template_name": "Sign-in code",
                      "template_alias": "signin-code",
                      "template_deleted": false,
                      "published_version_id": "6a1f4c2e-8b3d-4e5f-9a7b-0c1d2e3f4a5b",
                      "published_version_number": 3,
                      "from": "Acme Security <security@acme.com>",
                      "subject": "Your code is {{CODE}}",
                      "preview_text": "It expires in 10 minutes.",
                      "reply_to": [
                        "support@acme.com"
                      ],
                      "track_opens": false,
                      "track_clicks": false,
                      "created_via": "api",
                      "created_at": "2026-10-07T09:12:44.123456+00:00",
                      "updated_at": "2026-10-07T09:12:44.123456+00:00"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/transactional/{id}": {
      "get": {
        "operationId": "retrieveTransactionalEmail",
        "summary": "Retrieve transactional email",
        "description": "Get one transactional email, with the variables of the template version its sends use now.",
        "tags": [
          "Transactional emails"
        ],
        "x-docs-ids": [
          "retrieve-transactional-email"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The transactional email id (`tx_...`).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "preview_text": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Null when it has none."
                    },
                    "published_version_id": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The template version sends use now; null when the template was unpublished or deleted."
                    },
                    "published_version_number": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "That version's number."
                    },
                    "template_deleted": {
                      "type": "boolean",
                      "description": "True when its template was deleted: sends then fail with 422 until you choose another template."
                    },
                    "variables": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "key": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "fallback_value": {}
                        }
                      },
                      "description": "The variables of the published version (`key`, `type`, `fallback_value`): what a send's `variables` fills. `[]` when there is no published version."
                    },
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "template_id": {
                      "type": "string"
                    },
                    "template_name": {
                      "type": "string"
                    },
                    "template_alias": {
                      "type": "string"
                    },
                    "from": {
                      "type": "string"
                    },
                    "subject": {
                      "type": "string"
                    },
                    "reply_to": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "track_opens": {
                      "type": "boolean"
                    },
                    "track_clicks": {
                      "type": "boolean"
                    },
                    "created_via": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "object": "transactional_email",
                  "id": "tx_2hX9Yq1bVv0kq3W4m8sZJt1aB7c",
                  "name": "Sign-in code",
                  "template_id": "34a080c9-b17d-4187-ad80-5af20266e535",
                  "template_name": "Sign-in code",
                  "template_alias": "signin-code",
                  "template_deleted": false,
                  "published_version_id": "6a1f4c2e-8b3d-4e5f-9a7b-0c1d2e3f4a5b",
                  "published_version_number": 3,
                  "from": "Acme Security <security@acme.com>",
                  "subject": "Your code is {{CODE}}",
                  "preview_text": "It expires in 10 minutes.",
                  "reply_to": [
                    "support@acme.com"
                  ],
                  "track_opens": false,
                  "track_clicks": false,
                  "created_via": "api",
                  "created_at": "2026-10-07T09:12:44.123456+00:00",
                  "updated_at": "2026-10-07T09:12:44.123456+00:00",
                  "variables": [
                    {
                      "key": "CODE",
                      "type": "string",
                      "fallback_value": null
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "patch": {
        "operationId": "updateTransactionalEmail",
        "summary": "Update transactional email",
        "description": "Change a transactional email. Only the fields you send change. Sends use the change within 10 seconds.\n\n- Changing `template_id` checks the new template as on create. The same validation and permissions as Create transactional email apply; supports the `Idempotency-Key` header.\n\n- Returns 409 `conflict` when `expected_updated_at` does not match: reload it and try again.",
        "tags": [
          "Transactional emails"
        ],
        "x-docs-ids": [
          "update-transactional-email"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The transactional email id (`tx_...`).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Makes a retry safe: the same key and body within 24 hours returns the first response instead of doing the work again. A key still in use by a request that has not finished, or reused with a different body, answers 409.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Your name for it, 1 to 255 characters. Shown only to you."
                  },
                  "template_id": {
                    "type": "string",
                    "description": "The template (id or alias) whose published version is its content. The template must be published and not a workflow email. Sends always use the template's current published version."
                  },
                  "from": {
                    "type": "string",
                    "description": "Sender, `Name <user@domain>` or an address, on a verified sending domain of your team (403 otherwise). `onboarding@send.io` is also accepted, to try the feature before you have a domain; sends from it only reach test addresses."
                  },
                  "subject": {
                    "type": "string",
                    "description": "Subject line, without line breaks. May use the template's variables (`{{CODE}}`), filled from each send's `variables`."
                  },
                  "preview_text": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Inbox preview text. Empty or null means none (the template's own preview text is not used)."
                  },
                  "reply_to": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Reply-To address or addresses, at most 50. Empty or null means none."
                  },
                  "track_opens": {
                    "type": "boolean",
                    "description": "Count opens of its sends (when the domain's tracking subdomain is active). Default false: one-time codes and verification links are usually sent untracked. A send's own `track_opens` overrides it."
                  },
                  "track_clicks": {
                    "type": "boolean",
                    "description": "Rewrite links to count clicks (when the domain's tracking subdomain is active). Default false. A send's own `track_clicks` overrides it."
                  },
                  "expected_updated_at": {
                    "type": "string",
                    "description": "The `updated_at` you loaded. When the transactional email changed since, the update is refused with 409 `conflict` instead of overwriting the other change."
                  }
                }
              },
              "example": {
                "subject": "{{CODE}} is your Acme code",
                "expected_updated_at": "2026-10-07T09:12:44.123456+00:00"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "template_id": {
                      "type": "string"
                    },
                    "template_name": {
                      "type": "string"
                    },
                    "template_alias": {
                      "type": "string"
                    },
                    "template_deleted": {
                      "type": "boolean"
                    },
                    "published_version_id": {
                      "type": "string"
                    },
                    "published_version_number": {
                      "type": "number"
                    },
                    "from": {
                      "type": "string"
                    },
                    "subject": {
                      "type": "string"
                    },
                    "preview_text": {
                      "type": "string"
                    },
                    "reply_to": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "track_opens": {
                      "type": "boolean"
                    },
                    "track_clicks": {
                      "type": "boolean"
                    },
                    "created_via": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "object": "transactional_email",
                  "id": "tx_2hX9Yq1bVv0kq3W4m8sZJt1aB7c",
                  "name": "Sign-in code",
                  "template_id": "34a080c9-b17d-4187-ad80-5af20266e535",
                  "template_name": "Sign-in code",
                  "template_alias": "signin-code",
                  "template_deleted": false,
                  "published_version_id": "6a1f4c2e-8b3d-4e5f-9a7b-0c1d2e3f4a5b",
                  "published_version_number": 3,
                  "from": "Acme Security <security@acme.com>",
                  "subject": "Your code is {{CODE}}",
                  "preview_text": "It expires in 10 minutes.",
                  "reply_to": [
                    "support@acme.com"
                  ],
                  "track_opens": false,
                  "track_clicks": false,
                  "created_via": "api",
                  "created_at": "2026-10-07T09:12:44.123456+00:00",
                  "updated_at": "2026-10-07T09:12:44.123456+00:00"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "delete": {
        "operationId": "deleteTransactionalEmail",
        "summary": "Delete transactional email",
        "description": "Delete a transactional email. Sends of it fail with 404 from then on (within 10 seconds); the emails it sent and its stats stay.\n\n- Admins only. While a transactional email uses a template, the template cannot be unpublished or deleted (409 `template_in_use`).",
        "tags": [
          "Transactional emails"
        ],
        "x-docs-ids": [
          "delete-transactional-email"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The transactional email id (`tx_...`).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "deleted": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "object": "transactional_email",
                  "id": "tx_2hX9Yq1bVv0kq3W4m8sZJt1aB7c",
                  "deleted": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/transactional/{id}/test": {
      "post": {
        "operationId": "testTransactionalEmail",
        "summary": "Send test transactional email",
        "description": "Send the transactional email now to 1 to 5 addresses, as a send would make it, with \"[Test] \" before the subject.\n\n- Members may send a test. Test sends are real emails but are not counted in any stats.",
        "tags": [
          "Transactional emails"
        ],
        "x-docs-ids": [
          "test-transactional-email"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The transactional email id (`tx_...`).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "to": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "1 to 5 recipient addresses."
                  },
                  "variables": {
                    "type": "object",
                    "description": "Values for the template's variables.",
                    "properties": {
                      "CODE": {
                        "type": "string"
                      }
                    }
                  }
                },
                "required": [
                  "to"
                ]
              },
              "example": {
                "to": [
                  "ada@acme.com"
                ],
                "variables": {
                  "CODE": "123456"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "id": "49a3999c-0ce1-4ea6-ab68-afcd6dc2e794"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/transactional/{id}/stats": {
      "get": {
        "operationId": "transactionalEmailStats",
        "summary": "Transactional email stats",
        "description": "Delivery and engagement of a transactional email's sends in a period: totals and rates, a series per day (or hour), the split by template version and the most clicked links. The same numbers as Template stats.\n\n- A deleted transactional email stays readable. Its sends also count in their template's stats. Answers are cached for 30 seconds.\n\n- Returns 422 for a period over 90 days and 404 for an unknown transactional email or version.",
        "tags": [
          "Transactional emails"
        ],
        "x-docs-ids": [
          "transactional-email-stats"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The transactional email id (`tx_...`).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "Start of the period: a date or an ISO 8601 timestamp, in `timezone`. Default: 7 days before `to`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "End of the period. Default: now. The period is at most 90 days.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "timezone",
            "in": "query",
            "required": false,
            "description": "IANA time zone for the dates and the series. Default `UTC`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "version",
            "in": "query",
            "required": false,
            "description": "Only this template version: an id of any template it used, or a `version_number` of its current template.",
            "schema": {
              "type": [
                "string",
                "number"
              ]
            }
          },
          {
            "name": "granularity",
            "in": "query",
            "required": false,
            "description": "`daily` (default) or `hourly`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "transactional_id": {
                      "type": "string"
                    },
                    "template_id": {
                      "type": "string"
                    },
                    "range": {
                      "type": "object",
                      "properties": {
                        "from": {
                          "type": "string"
                        },
                        "to": {
                          "type": "string"
                        },
                        "timezone": {
                          "type": "string"
                        },
                        "granularity": {
                          "type": "string"
                        }
                      }
                    },
                    "version": {},
                    "live_version": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "version_number": {
                          "type": "number"
                        },
                        "name": {},
                        "published_at": {
                          "type": "string",
                          "format": "date-time"
                        }
                      }
                    },
                    "totals": {
                      "type": "object",
                      "properties": {
                        "sent": {
                          "type": "number"
                        },
                        "delivered": {
                          "type": "number"
                        },
                        "opened_unique": {
                          "type": "number"
                        },
                        "clicked_unique": {
                          "type": "number"
                        },
                        "bounced": {
                          "type": "number"
                        },
                        "bounced_hard": {
                          "type": "number"
                        },
                        "complaints": {
                          "type": "number"
                        },
                        "delivery_rate": {
                          "type": "number"
                        },
                        "open_rate": {
                          "type": "number"
                        },
                        "click_rate": {
                          "type": "number"
                        },
                        "bounce_rate": {
                          "type": "number"
                        },
                        "hard_bounce_rate": {
                          "type": "number"
                        },
                        "complaint_rate": {
                          "type": "number"
                        }
                      }
                    },
                    "daily": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "date": {
                            "type": "string"
                          },
                          "sent": {
                            "type": "number"
                          },
                          "delivered": {
                            "type": "number"
                          },
                          "opened": {
                            "type": "number"
                          },
                          "clicked": {
                            "type": "number"
                          }
                        }
                      }
                    },
                    "per_version": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "version_id": {
                            "type": "string"
                          },
                          "version_number": {
                            "type": "number"
                          },
                          "name": {},
                          "published_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "deleted": {
                            "type": "boolean"
                          },
                          "template_id": {
                            "type": "string"
                          },
                          "template_name": {
                            "type": "string"
                          },
                          "live": {
                            "type": "boolean"
                          },
                          "sent": {
                            "type": "number"
                          },
                          "delivered": {
                            "type": "number"
                          },
                          "opened_unique": {
                            "type": "number"
                          },
                          "clicked_unique": {
                            "type": "number"
                          },
                          "open_rate": {
                            "type": "number"
                          },
                          "click_rate": {
                            "type": "number"
                          }
                        }
                      }
                    },
                    "top_links": {
                      "type": "array"
                    }
                  }
                },
                "example": {
                  "object": "transactional_email_stats",
                  "transactional_id": "tx_2hX9Yq1bVv0kq3W4m8sZJt1aB7c",
                  "template_id": "34a080c9-b17d-4187-ad80-5af20266e535",
                  "range": {
                    "from": "2026-11-05T14:00:00Z",
                    "to": "2026-11-12T14:00:00Z",
                    "timezone": "UTC",
                    "granularity": "daily"
                  },
                  "version": null,
                  "live_version": {
                    "id": "6a1f4c2e-8b3d-4e5f-9a7b-0c1d2e3f4a5b",
                    "version_number": 3,
                    "name": null,
                    "published_at": "2026-11-09T14:20:00Z"
                  },
                  "totals": {
                    "sent": 4210,
                    "delivered": 4188,
                    "opened_unique": 0,
                    "clicked_unique": 0,
                    "bounced": 22,
                    "bounced_hard": 9,
                    "complaints": 0,
                    "delivery_rate": 0.995,
                    "open_rate": 0,
                    "click_rate": 0,
                    "bounce_rate": 0.005,
                    "hard_bounce_rate": 0.002,
                    "complaint_rate": 0
                  },
                  "daily": [
                    {
                      "date": "2026-11-12",
                      "sent": 640,
                      "delivered": 637,
                      "opened": 0,
                      "clicked": 0
                    }
                  ],
                  "per_version": [
                    {
                      "version_id": "6a1f4c2e-8b3d-4e5f-9a7b-0c1d2e3f4a5b",
                      "version_number": 3,
                      "name": null,
                      "published_at": "2026-11-09T14:20:00Z",
                      "deleted": false,
                      "template_id": "34a080c9-b17d-4187-ad80-5af20266e535",
                      "template_name": "Sign-in code",
                      "live": true,
                      "sent": 4210,
                      "delivered": 4188,
                      "opened_unique": 0,
                      "clicked_unique": 0,
                      "open_rate": 0,
                      "click_rate": 0
                    }
                  ],
                  "top_links": []
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/automations": {
      "post": {
        "operationId": "createAutomation",
        "summary": "Create an automation",
        "description": "Creates an automation. Send a full graph to build it in one call, or only a name and fill in the graph later.\n\n- A graph sent through the API is validated, as in Resend. Errors return 422 with the list of `issues`.\n\n- A team can have at most 500 automations and 50 enabled at once. A graph can have at most 100 steps and 200 connections.\n\n- Delays and wait timeouts are 1 minute to 90 days. A wait with no timeout gives up after 30 days. A wait until a date from the event is capped at 90 days too; a missing date fails the run with the reason in the step error.\n\n- Condition rules: `field` is a path such as event.plan, event.user.plan, event.items.0 (a list position, from 0), contact.first_name, contact.<property> or contact.properties.<property>, wait_events.<event>.<field>, email.opened, run.id. Operators: eq, neq, in, not_in (a list), contains, not_contains, starts_with, ends_with, gt, gte, lt, lte, exists, not_exists, is_empty, is_not_empty, and the relative-date more_than_days_ago and within_last_days (below). eq, neq, in and not_in match case exactly; contains, starts_with and ends_with ignore case. Text is compared in one Unicode form (an accented letter typed either way matches). Numbers and numeric text compare as numbers (\"3\" eq 3), true matches \"true\". gt, gte, lt and lte compare numbers or dates and refuse any other value. A field that is missing never matches (except not_exists).\n\n- Steps with contact_delete, webhook or app_action need an admin to enable, and so does a trigger that is a connected app's.\n\n- Segment triggers: `contact_added_to_segment` starts when a contact enters the segment `segment_id` (added by hand, or moved in by the rule of a rule-based segment); `contact_removed_from_segment` when it leaves. An `add_to_segment` or `remove_from_segment` step on a rule-based segment cannot be published (issue `segment_rule_based`): the rule decides who is in it.\n\n- send.io extension: the rule operators `more_than_days_ago` and `within_last_days` compare a date field with the time the rule is evaluated. Their `value` is a whole number of days N, as a JSON number (not text, a fraction or {var}): 0 to 3650 for `more_than_days_ago`, 1 to 3650 for `within_last_days`. `more_than_days_ago` is true when the date is N days ago or earlier; `within_last_days` when it is less than N days ago and not in the future. A day is 24 hours, a date without a zone is read as UTC, and a field that is missing or not a date never matches. Example: {type: rule, field: \"contact.properties.renews_at\", operator: \"within_last_days\", value: 30}.",
        "tags": [
          "Automations"
        ],
        "x-docs-ids": [
          "create-automation"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "1 to 120 characters."
                  },
                  "status": {
                    "type": "string",
                    "description": "enabled or disabled. Default disabled. enabled validates the graph and starts it at once."
                  },
                  "steps": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string",
                          "description": "Unique key of the step, used by connections."
                        },
                        "type": {
                          "type": "string",
                          "description": "One of trigger, send_email, delay, wait_for_event, condition, branch, contact_update, contact_delete, add_to_segment, remove_from_segment, webhook (an HTTP request to your own URL), app_action (an action in an app the workspace connected), exit. (notify and experiment are reserved and refused for now.)"
                        },
                        "config": {
                          "type": "object",
                          "description": "Step settings. trigger: {event_name}, or a contact trigger: {kind: \"contact_created\", source?: any | api | import | event | form}, {kind: \"contact_added_to_segment\", segment_id}, {kind: \"contact_removed_from_segment\", segment_id}, {kind: \"contact_updated\", property} where property is first_name, last_name, unsubscribed or the key of a contact property you created, or {kind: \"topic_subscribed\", topic_id}; each takes an optional filter. send_email: {template: {id, variables}, from?, subject?}, where subject replaces the template's subject and takes the same variables ({{NAME}}) and contact merge tags, plus run fields such as {{event.plan}}. delay: {duration: \"3 days\"} or {until: {var}, offset?} (a date more than 90 days away waits 90 days; the step output then has capped: true and requested_until). wait_for_event: {event_name, timeout?, filter_rule?}. condition: a rule {type: rule, field, operator, value} or {type: and | or, rules}; operator is one of eq, neq, gt, gte, lt, lte, contains, not_contains, starts_with, ends_with, in, not_in, exists, not_exists, is_empty, is_not_empty, more_than_days_ago, within_last_days; the field paths and how each operator compares are in the notes of Create an automation. branch: {branches: [{id, rule}]}. contact_update: {properties?, first_name?, last_name?, unsubscribed?}. add_to_segment / remove_from_segment: {segment_id} of a manual segment. webhook: {url, method?, headers?: [{name, value, secret?}], body_type?: json | form | text | none, body?, continue_on_failure?, timeout_seconds?}; see [HTTP request step](/docs/http-request-step). app_action: {app: {connection_id, app, action, input?, label?}, continue_on_failure?}, where connection_id is the workspace's connection of that app and input holds the action's fields; see [App actions](/docs/app-actions).",
                          "properties": {
                            "event_name": {
                              "type": "string"
                            },
                            "template": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "variables": {
                                  "type": "object",
                                  "properties": {
                                    "first_name": {
                                      "type": "object",
                                      "properties": {
                                        "var": {
                                          "type": "string"
                                        }
                                      }
                                    }
                                  }
                                }
                              }
                            },
                            "duration": {
                              "type": "string"
                            },
                            "type": {
                              "type": "string"
                            },
                            "field": {
                              "type": "string"
                            },
                            "operator": {
                              "type": "string"
                            },
                            "value": {
                              "type": "string"
                            },
                            "properties": {
                              "type": "object",
                              "properties": {
                                "plan": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      },
                      "required": [
                        "key",
                        "type"
                      ]
                    },
                    "description": "The automation steps. Each is {key, type, config}. Keys use a-z, 0-9 and underscore (1 to 64 characters). Send together with `connections`."
                  },
                  "connections": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "description": "default (the default), condition_met, condition_not_met, event_received, timeout, branch. Which types a step may start depends on its type."
                        },
                        "from": {
                          "type": "string"
                        },
                        "to": {
                          "type": "string"
                        }
                      }
                    },
                    "description": "The links between steps: {from, to, type, branch_id?, variant_id?}. Send together with `steps`."
                  },
                  "type": {
                    "type": "string",
                    "description": "send.io extension. transactional (the default) or marketing. A marketing automation needs a `topic_id`."
                  },
                  "topic_id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "send.io extension. The topic contacts can unsubscribe from. Required for marketing."
                  },
                  "settings": {
                    "type": "object",
                    "description": "send.io extension. Merged into the current settings: reentry (once | every_time, default once), allow_parallel_runs (default false), exit_on_reply (default true for marketing), timezone (IANA, default UTC; the send window and wait-until dates without a zone are read in it), send_window {enabled, days, start, end} (when enabled, an email step outside the days and hours waits and sends when the window next opens; runs already waiting follow a changed window), verify_on_entry, description (max 500 characters)."
                  }
                },
                "required": [
                  "name"
                ]
              },
              "example": {
                "name": "Welcome series",
                "status": "enabled",
                "steps": [
                  {
                    "key": "start",
                    "type": "trigger",
                    "config": {
                      "event_name": "user.created"
                    }
                  },
                  {
                    "key": "welcome",
                    "type": "send_email",
                    "config": {
                      "template": {
                        "id": "34a080c9-b17d-4187-ad80-5af20266e535",
                        "variables": {
                          "first_name": {
                            "var": "event.first_name"
                          }
                        }
                      }
                    }
                  },
                  {
                    "key": "wait_3d",
                    "type": "delay",
                    "config": {
                      "duration": "3 days"
                    }
                  },
                  {
                    "key": "is_pro",
                    "type": "condition",
                    "config": {
                      "type": "rule",
                      "field": "event.plan",
                      "operator": "eq",
                      "value": "pro"
                    }
                  },
                  {
                    "key": "tag_pro",
                    "type": "contact_update",
                    "config": {
                      "properties": {
                        "plan": "pro"
                      }
                    }
                  }
                ],
                "connections": [
                  {
                    "from": "start",
                    "to": "welcome",
                    "type": "default"
                  },
                  {
                    "from": "welcome",
                    "to": "wait_3d",
                    "type": "default"
                  },
                  {
                    "from": "wait_3d",
                    "to": "is_pro",
                    "type": "default"
                  },
                  {
                    "from": "is_pro",
                    "to": "tag_pro",
                    "type": "condition_met"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "object": "automation",
                  "id": "5b0f6f2e-3c1d-4a8e-9f7b-2d6c8e1a4b90"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "get": {
        "operationId": "listAutomations",
        "summary": "List automations",
        "description": "Lists the team's automations, newest first.\n\n- `state` is send.io's full state (enabled, paused or disabled). `status` stays Resend-compatible: paused shows as disabled.\n\n- `trigger`, `active_runs`, `runs_total` and `emails_7d` are send.io extensions. `active_runs` counts runs in progress; `runs_total` counts all runs except test runs, up to 10,000 (the exact number for a period is in the automation's metrics).",
        "tags": [
          "Automations"
        ],
        "x-docs-ids": [
          "list-automations"
        ],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "enabled or disabled.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "1 to 100. Default 20.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "Return items after this automation ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "description": "Return items before this automation ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updated_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "state": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "version": {
                            "type": "number"
                          },
                          "has_unpublished_changes": {
                            "type": "boolean"
                          },
                          "paused_reason": {},
                          "trigger": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "type": {
                                "type": "string"
                              },
                              "config": {
                                "type": "object",
                                "properties": {
                                  "event_name": {
                                    "type": "string"
                                  }
                                }
                              }
                            }
                          },
                          "active_runs": {
                            "type": "number"
                          },
                          "runs_total": {
                            "type": "number"
                          },
                          "emails_7d": {
                            "type": "number"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "has_more": false,
                  "data": [
                    {
                      "id": "5b0f6f2e-3c1d-4a8e-9f7b-2d6c8e1a4b90",
                      "name": "Welcome series",
                      "status": "enabled",
                      "created_at": "2026-10-07T09:12:44.123456+00:00",
                      "updated_at": "2026-10-07T09:12:44.123456+00:00",
                      "state": "enabled",
                      "type": "transactional",
                      "version": 1,
                      "has_unpublished_changes": false,
                      "paused_reason": null,
                      "trigger": {
                        "key": "start",
                        "type": "trigger",
                        "config": {
                          "event_name": "user.created"
                        }
                      },
                      "active_runs": 42,
                      "runs_total": 1280,
                      "emails_7d": 318
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/automations/{id}": {
      "get": {
        "operationId": "getAutomation",
        "summary": "Retrieve an automation",
        "description": "Returns an automation with its graph. While it is enabled or paused you get the live version; otherwise the draft.",
        "tags": [
          "Automations"
        ],
        "x-docs-ids": [
          "get-automation"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The automation ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "steps": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "key": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "config": {
                            "type": "object",
                            "properties": {
                              "event_name": {
                                "type": "string"
                              },
                              "template": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "variables": {
                                    "type": "object",
                                    "properties": {
                                      "first_name": {
                                        "type": "object",
                                        "properties": {
                                          "var": {
                                            "type": "string"
                                          }
                                        }
                                      }
                                    }
                                  }
                                }
                              },
                              "duration": {
                                "type": "string"
                              },
                              "type": {
                                "type": "string"
                              },
                              "field": {
                                "type": "string"
                              },
                              "operator": {
                                "type": "string"
                              },
                              "value": {
                                "type": "string"
                              },
                              "properties": {
                                "type": "object",
                                "properties": {
                                  "plan": {
                                    "type": "string"
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    "connections": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "from": {
                            "type": "string"
                          },
                          "to": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "state": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "topic_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "settings": {
                      "type": "object",
                      "properties": {
                        "reentry": {
                          "type": "string"
                        },
                        "allow_parallel_runs": {
                          "type": "boolean"
                        },
                        "exit_on_reply": {
                          "type": "boolean"
                        },
                        "timezone": {
                          "type": "string"
                        },
                        "send_window": {
                          "type": "object",
                          "properties": {
                            "enabled": {
                              "type": "boolean"
                            },
                            "days": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "start": {
                              "type": "string"
                            },
                            "end": {
                              "type": "string"
                            }
                          }
                        },
                        "verify_on_entry": {
                          "type": "boolean"
                        }
                      }
                    },
                    "layout": {},
                    "version": {
                      "type": "number"
                    },
                    "has_unpublished_changes": {
                      "type": "boolean"
                    },
                    "paused_reason": {}
                  }
                },
                "example": {
                  "object": "automation",
                  "id": "5b0f6f2e-3c1d-4a8e-9f7b-2d6c8e1a4b90",
                  "name": "Welcome series",
                  "status": "enabled",
                  "created_at": "2026-10-07T09:12:44.123456+00:00",
                  "updated_at": "2026-10-07T09:12:44.123456+00:00",
                  "steps": [
                    {
                      "key": "start",
                      "type": "trigger",
                      "config": {
                        "event_name": "user.created"
                      }
                    },
                    {
                      "key": "welcome",
                      "type": "send_email",
                      "config": {
                        "template": {
                          "id": "34a080c9-b17d-4187-ad80-5af20266e535",
                          "variables": {
                            "first_name": {
                              "var": "event.first_name"
                            }
                          }
                        }
                      }
                    },
                    {
                      "key": "wait_3d",
                      "type": "delay",
                      "config": {
                        "duration": "3 days"
                      }
                    },
                    {
                      "key": "is_pro",
                      "type": "condition",
                      "config": {
                        "type": "rule",
                        "field": "event.plan",
                        "operator": "eq",
                        "value": "pro"
                      }
                    },
                    {
                      "key": "tag_pro",
                      "type": "contact_update",
                      "config": {
                        "properties": {
                          "plan": "pro"
                        }
                      }
                    }
                  ],
                  "connections": [
                    {
                      "from": "start",
                      "to": "welcome",
                      "type": "default"
                    },
                    {
                      "from": "welcome",
                      "to": "wait_3d",
                      "type": "default"
                    },
                    {
                      "from": "wait_3d",
                      "to": "is_pro",
                      "type": "default"
                    },
                    {
                      "from": "is_pro",
                      "to": "tag_pro",
                      "type": "condition_met"
                    }
                  ],
                  "state": "enabled",
                  "type": "transactional",
                  "topic_id": null,
                  "settings": {
                    "reentry": "once",
                    "allow_parallel_runs": false,
                    "exit_on_reply": false,
                    "timezone": "UTC",
                    "send_window": {
                      "enabled": false,
                      "days": [
                        "mon",
                        "tue",
                        "wed",
                        "thu",
                        "fri"
                      ],
                      "start": "09:00",
                      "end": "18:00"
                    },
                    "verify_on_entry": false
                  },
                  "layout": null,
                  "version": 1,
                  "has_unpublished_changes": false,
                  "paused_reason": null
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "patch": {
        "operationId": "updateAutomation",
        "summary": "Update an automation",
        "description": "Changes the name, settings or graph, or turns the automation on or off with `status`. Only the fields you send change.\n\n- As in Resend, the graph of an enabled or paused automation is locked. Disable it first, or duplicate it and edit the copy.",
        "tags": [
          "Automations"
        ],
        "x-docs-ids": [
          "update-automation"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The automation ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "1 to 120 characters."
                  },
                  "status": {
                    "type": "string",
                    "description": "enabled starts it; disabled stops new runs (runs in progress finish)."
                  },
                  "steps": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string",
                          "description": "Unique key of the step, used by connections."
                        },
                        "type": {
                          "type": "string",
                          "description": "One of trigger, send_email, delay, wait_for_event, condition, branch, contact_update, contact_delete, add_to_segment, remove_from_segment, webhook (an HTTP request to your own URL), app_action (an action in an app the workspace connected), exit. (notify and experiment are reserved and refused for now.)"
                        },
                        "config": {
                          "type": "object",
                          "description": "Step settings. trigger: {event_name}, or a contact trigger: {kind: \"contact_created\", source?: any | api | import | event | form}, {kind: \"contact_added_to_segment\", segment_id}, {kind: \"contact_removed_from_segment\", segment_id}, {kind: \"contact_updated\", property} where property is first_name, last_name, unsubscribed or the key of a contact property you created, or {kind: \"topic_subscribed\", topic_id}; each takes an optional filter. send_email: {template: {id, variables}, from?, subject?}, where subject replaces the template's subject and takes the same variables ({{NAME}}) and contact merge tags, plus run fields such as {{event.plan}}. delay: {duration: \"3 days\"} or {until: {var}, offset?} (a date more than 90 days away waits 90 days; the step output then has capped: true and requested_until). wait_for_event: {event_name, timeout?, filter_rule?}. condition: a rule {type: rule, field, operator, value} or {type: and | or, rules}; operator is one of eq, neq, gt, gte, lt, lte, contains, not_contains, starts_with, ends_with, in, not_in, exists, not_exists, is_empty, is_not_empty, more_than_days_ago, within_last_days; the field paths and how each operator compares are in the notes of Create an automation. branch: {branches: [{id, rule}]}. contact_update: {properties?, first_name?, last_name?, unsubscribed?}. add_to_segment / remove_from_segment: {segment_id} of a manual segment. webhook: {url, method?, headers?: [{name, value, secret?}], body_type?: json | form | text | none, body?, continue_on_failure?, timeout_seconds?}; see [HTTP request step](/docs/http-request-step). app_action: {app: {connection_id, app, action, input?, label?}, continue_on_failure?}, where connection_id is the workspace's connection of that app and input holds the action's fields; see [App actions](/docs/app-actions)."
                        }
                      },
                      "required": [
                        "key",
                        "type"
                      ]
                    },
                    "description": "The automation steps. Each is {key, type, config}. Keys use a-z, 0-9 and underscore (1 to 64 characters). Send together with `connections`."
                  },
                  "connections": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "description": "default (the default), condition_met, condition_not_met, event_received, timeout, branch. Which types a step may start depends on its type."
                        }
                      }
                    },
                    "description": "The links between steps: {from, to, type, branch_id?, variant_id?}. Send together with `steps`."
                  },
                  "type": {
                    "type": "string",
                    "description": "send.io extension. transactional or marketing. Cannot change after first enable."
                  },
                  "topic_id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "send.io extension. null clears it."
                  },
                  "settings": {
                    "type": "object",
                    "description": "send.io extension. Merged into the current settings: reentry (once | every_time, default once), allow_parallel_runs (default false), exit_on_reply (default true for marketing), timezone (IANA, default UTC; the send window and wait-until dates without a zone are read in it), send_window {enabled, days, start, end} (when enabled, an email step outside the days and hours waits and sends when the window next opens; runs already waiting follow a changed window), verify_on_entry, description (max 500 characters)."
                  },
                  "if_updated_at": {
                    "type": "string",
                    "description": "Optional. The `updated_at` you last read. If someone changed it since, you get 409 instead of overwriting. The If-Unmodified-Since header works too."
                  }
                }
              },
              "example": {
                "name": "Welcome series v2",
                "status": "disabled"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "object": "automation",
                  "id": "5b0f6f2e-3c1d-4a8e-9f7b-2d6c8e1a4b90"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "delete": {
        "operationId": "deleteAutomation",
        "summary": "Delete an automation",
        "description": "Deletes a stopped automation. Runs still in progress (Stop new runs lets them finish) are cancelled: none of their remaining steps run.\n\n- Stop the automation first: deleting an enabled or paused one returns 422.\n\n- Cancelled runs end with `end_reason` `automation_deleted` and send `automation.run.cancelled`. `cancelled_runs` (how many) is a send.io extension.",
        "tags": [
          "Automations"
        ],
        "x-docs-ids": [
          "delete-automation"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The automation ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "deleted": {
                      "type": "boolean"
                    },
                    "cancelled_runs": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "object": "automation",
                  "id": "5b0f6f2e-3c1d-4a8e-9f7b-2d6c8e1a4b90",
                  "deleted": true,
                  "cancelled_runs": 3
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/automations/{id}/duplicate": {
      "post": {
        "operationId": "duplicateAutomation",
        "summary": "Duplicate an automation",
        "description": "Copies the automation's latest graph, type, topic and settings into a new disabled automation named \"<name> (copy)\".",
        "tags": [
          "Automations"
        ],
        "x-docs-ids": [
          "duplicate-automation"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The automation ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "object": "automation",
                  "id": "0c7e1d5a-2b9f-4e3a-8d6c-1f4b7a9e2c3d"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/automations/{id}/stop": {
      "post": {
        "operationId": "stopAutomation",
        "summary": "Stop an automation",
        "description": "Disables the automation so no new runs start. Runs in progress finish on their version, unless you pass `cancel_running`.\n\n- `cancel_running` and `cancelled_runs` are send.io extensions to Resend's stop.",
        "tags": [
          "Automations"
        ],
        "x-docs-ids": [
          "stop-automation"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The automation ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cancel_running",
            "in": "query",
            "required": false,
            "description": "true also cancels every run in progress. Can be sent in the body instead.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "cancel_running": {
                    "type": "boolean",
                    "description": "Same as the query parameter. Default false."
                  }
                }
              },
              "example": {
                "cancel_running": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "cancelled_runs": {
                      "type": "number"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "object": "automation",
                  "id": "5b0f6f2e-3c1d-4a8e-9f7b-2d6c8e1a4b90",
                  "status": "disabled",
                  "cancelled_runs": 12,
                  "updated_at": "2026-10-07T09:15:22.481203+00:00"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/automations/{id}/enable": {
      "post": {
        "operationId": "enableAutomation",
        "summary": "Enable an automation",
        "description": "Validates the draft, saves it as a new version if it changed, and turns the automation on. Returns the full automation.\n\n- send.io extension. In Resend, use PATCH with status enabled (also supported here).\n\n- A draft with validation errors returns 422 with the `issues`.",
        "tags": [
          "Automations"
        ],
        "x-docs-ids": [
          "enable-automation"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The automation ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "if_updated_at": {
                    "type": "string",
                    "description": "Optional. Refuse with 409 if the automation changed since."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "steps": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "key": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "config": {
                            "type": "object",
                            "properties": {
                              "event_name": {
                                "type": "string"
                              },
                              "template": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "variables": {
                                    "type": "object",
                                    "properties": {
                                      "first_name": {
                                        "type": "object",
                                        "properties": {
                                          "var": {
                                            "type": "string"
                                          }
                                        }
                                      }
                                    }
                                  }
                                }
                              },
                              "duration": {
                                "type": "string"
                              },
                              "type": {
                                "type": "string"
                              },
                              "field": {
                                "type": "string"
                              },
                              "operator": {
                                "type": "string"
                              },
                              "value": {
                                "type": "string"
                              },
                              "properties": {
                                "type": "object",
                                "properties": {
                                  "plan": {
                                    "type": "string"
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    "connections": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "from": {
                            "type": "string"
                          },
                          "to": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "state": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "topic_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "settings": {
                      "type": "object",
                      "properties": {
                        "reentry": {
                          "type": "string"
                        },
                        "allow_parallel_runs": {
                          "type": "boolean"
                        },
                        "exit_on_reply": {
                          "type": "boolean"
                        },
                        "timezone": {
                          "type": "string"
                        },
                        "send_window": {
                          "type": "object",
                          "properties": {
                            "enabled": {
                              "type": "boolean"
                            },
                            "days": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "start": {
                              "type": "string"
                            },
                            "end": {
                              "type": "string"
                            }
                          }
                        },
                        "verify_on_entry": {
                          "type": "boolean"
                        }
                      }
                    },
                    "layout": {},
                    "version": {
                      "type": "number"
                    },
                    "has_unpublished_changes": {
                      "type": "boolean"
                    },
                    "paused_reason": {}
                  }
                },
                "example": {
                  "object": "automation",
                  "id": "5b0f6f2e-3c1d-4a8e-9f7b-2d6c8e1a4b90",
                  "name": "Welcome series",
                  "status": "enabled",
                  "created_at": "2026-10-07T09:12:44.123456+00:00",
                  "updated_at": "2026-10-07T09:12:44.123456+00:00",
                  "steps": [
                    {
                      "key": "start",
                      "type": "trigger",
                      "config": {
                        "event_name": "user.created"
                      }
                    },
                    {
                      "key": "welcome",
                      "type": "send_email",
                      "config": {
                        "template": {
                          "id": "34a080c9-b17d-4187-ad80-5af20266e535",
                          "variables": {
                            "first_name": {
                              "var": "event.first_name"
                            }
                          }
                        }
                      }
                    },
                    {
                      "key": "wait_3d",
                      "type": "delay",
                      "config": {
                        "duration": "3 days"
                      }
                    },
                    {
                      "key": "is_pro",
                      "type": "condition",
                      "config": {
                        "type": "rule",
                        "field": "event.plan",
                        "operator": "eq",
                        "value": "pro"
                      }
                    },
                    {
                      "key": "tag_pro",
                      "type": "contact_update",
                      "config": {
                        "properties": {
                          "plan": "pro"
                        }
                      }
                    }
                  ],
                  "connections": [
                    {
                      "from": "start",
                      "to": "welcome",
                      "type": "default"
                    },
                    {
                      "from": "welcome",
                      "to": "wait_3d",
                      "type": "default"
                    },
                    {
                      "from": "wait_3d",
                      "to": "is_pro",
                      "type": "default"
                    },
                    {
                      "from": "is_pro",
                      "to": "tag_pro",
                      "type": "condition_met"
                    }
                  ],
                  "state": "enabled",
                  "type": "transactional",
                  "topic_id": null,
                  "settings": {
                    "reentry": "once",
                    "allow_parallel_runs": false,
                    "exit_on_reply": false,
                    "timezone": "UTC",
                    "send_window": {
                      "enabled": false,
                      "days": [
                        "mon",
                        "tue",
                        "wed",
                        "thu",
                        "fri"
                      ],
                      "start": "09:00",
                      "end": "18:00"
                    },
                    "verify_on_entry": false
                  },
                  "layout": null,
                  "version": 1,
                  "has_unpublished_changes": false,
                  "paused_reason": null
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/automations/{id}/pause": {
      "post": {
        "operationId": "pauseAutomation",
        "summary": "Pause an automation",
        "description": "Pauses an enabled automation. New entrants are skipped and runs in progress hold where they are until you resume.\n\n- send.io extension. Only an enabled automation can be paused.",
        "tags": [
          "Automations"
        ],
        "x-docs-ids": [
          "pause-automation"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The automation ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "steps": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "key": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "config": {
                            "type": "object",
                            "properties": {
                              "event_name": {
                                "type": "string"
                              },
                              "template": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "variables": {
                                    "type": "object",
                                    "properties": {
                                      "first_name": {
                                        "type": "object",
                                        "properties": {
                                          "var": {
                                            "type": "string"
                                          }
                                        }
                                      }
                                    }
                                  }
                                }
                              },
                              "duration": {
                                "type": "string"
                              },
                              "type": {
                                "type": "string"
                              },
                              "field": {
                                "type": "string"
                              },
                              "operator": {
                                "type": "string"
                              },
                              "value": {
                                "type": "string"
                              },
                              "properties": {
                                "type": "object",
                                "properties": {
                                  "plan": {
                                    "type": "string"
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    "connections": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "from": {
                            "type": "string"
                          },
                          "to": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "state": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "topic_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "settings": {
                      "type": "object",
                      "properties": {
                        "reentry": {
                          "type": "string"
                        },
                        "allow_parallel_runs": {
                          "type": "boolean"
                        },
                        "exit_on_reply": {
                          "type": "boolean"
                        },
                        "timezone": {
                          "type": "string"
                        },
                        "send_window": {
                          "type": "object",
                          "properties": {
                            "enabled": {
                              "type": "boolean"
                            },
                            "days": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "start": {
                              "type": "string"
                            },
                            "end": {
                              "type": "string"
                            }
                          }
                        },
                        "verify_on_entry": {
                          "type": "boolean"
                        }
                      }
                    },
                    "layout": {},
                    "version": {
                      "type": "number"
                    },
                    "has_unpublished_changes": {
                      "type": "boolean"
                    },
                    "paused_reason": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "object": "automation",
                  "id": "5b0f6f2e-3c1d-4a8e-9f7b-2d6c8e1a4b90",
                  "name": "Welcome series",
                  "status": "disabled",
                  "created_at": "2026-10-07T09:12:44.123456+00:00",
                  "updated_at": "2026-10-07T09:12:44.123456+00:00",
                  "steps": [
                    {
                      "key": "start",
                      "type": "trigger",
                      "config": {
                        "event_name": "user.created"
                      }
                    },
                    {
                      "key": "welcome",
                      "type": "send_email",
                      "config": {
                        "template": {
                          "id": "34a080c9-b17d-4187-ad80-5af20266e535",
                          "variables": {
                            "first_name": {
                              "var": "event.first_name"
                            }
                          }
                        }
                      }
                    },
                    {
                      "key": "wait_3d",
                      "type": "delay",
                      "config": {
                        "duration": "3 days"
                      }
                    },
                    {
                      "key": "is_pro",
                      "type": "condition",
                      "config": {
                        "type": "rule",
                        "field": "event.plan",
                        "operator": "eq",
                        "value": "pro"
                      }
                    },
                    {
                      "key": "tag_pro",
                      "type": "contact_update",
                      "config": {
                        "properties": {
                          "plan": "pro"
                        }
                      }
                    }
                  ],
                  "connections": [
                    {
                      "from": "start",
                      "to": "welcome",
                      "type": "default"
                    },
                    {
                      "from": "welcome",
                      "to": "wait_3d",
                      "type": "default"
                    },
                    {
                      "from": "wait_3d",
                      "to": "is_pro",
                      "type": "default"
                    },
                    {
                      "from": "is_pro",
                      "to": "tag_pro",
                      "type": "condition_met"
                    }
                  ],
                  "state": "paused",
                  "type": "transactional",
                  "topic_id": null,
                  "settings": {
                    "reentry": "once",
                    "allow_parallel_runs": false,
                    "exit_on_reply": false,
                    "timezone": "UTC",
                    "send_window": {
                      "enabled": false,
                      "days": [
                        "mon",
                        "tue",
                        "wed",
                        "thu",
                        "fri"
                      ],
                      "start": "09:00",
                      "end": "18:00"
                    },
                    "verify_on_entry": false
                  },
                  "layout": null,
                  "version": 1,
                  "has_unpublished_changes": false,
                  "paused_reason": "paused"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/automations/{id}/resume": {
      "post": {
        "operationId": "resumeAutomation",
        "summary": "Resume an automation",
        "description": "Turns a paused automation back on. Held runs continue from where they stopped.\n\n- send.io extension. Returns 422 if the automation is not paused.",
        "tags": [
          "Automations"
        ],
        "x-docs-ids": [
          "resume-automation"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The automation ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "steps": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "key": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "config": {
                            "type": "object",
                            "properties": {
                              "event_name": {
                                "type": "string"
                              },
                              "template": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "variables": {
                                    "type": "object",
                                    "properties": {
                                      "first_name": {
                                        "type": "object",
                                        "properties": {
                                          "var": {
                                            "type": "string"
                                          }
                                        }
                                      }
                                    }
                                  }
                                }
                              },
                              "duration": {
                                "type": "string"
                              },
                              "type": {
                                "type": "string"
                              },
                              "field": {
                                "type": "string"
                              },
                              "operator": {
                                "type": "string"
                              },
                              "value": {
                                "type": "string"
                              },
                              "properties": {
                                "type": "object",
                                "properties": {
                                  "plan": {
                                    "type": "string"
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    "connections": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "from": {
                            "type": "string"
                          },
                          "to": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "state": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "topic_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "settings": {
                      "type": "object",
                      "properties": {
                        "reentry": {
                          "type": "string"
                        },
                        "allow_parallel_runs": {
                          "type": "boolean"
                        },
                        "exit_on_reply": {
                          "type": "boolean"
                        },
                        "timezone": {
                          "type": "string"
                        },
                        "send_window": {
                          "type": "object",
                          "properties": {
                            "enabled": {
                              "type": "boolean"
                            },
                            "days": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "start": {
                              "type": "string"
                            },
                            "end": {
                              "type": "string"
                            }
                          }
                        },
                        "verify_on_entry": {
                          "type": "boolean"
                        }
                      }
                    },
                    "layout": {},
                    "version": {
                      "type": "number"
                    },
                    "has_unpublished_changes": {
                      "type": "boolean"
                    },
                    "paused_reason": {}
                  }
                },
                "example": {
                  "object": "automation",
                  "id": "5b0f6f2e-3c1d-4a8e-9f7b-2d6c8e1a4b90",
                  "name": "Welcome series",
                  "status": "enabled",
                  "created_at": "2026-10-07T09:12:44.123456+00:00",
                  "updated_at": "2026-10-07T09:12:44.123456+00:00",
                  "steps": [
                    {
                      "key": "start",
                      "type": "trigger",
                      "config": {
                        "event_name": "user.created"
                      }
                    },
                    {
                      "key": "welcome",
                      "type": "send_email",
                      "config": {
                        "template": {
                          "id": "34a080c9-b17d-4187-ad80-5af20266e535",
                          "variables": {
                            "first_name": {
                              "var": "event.first_name"
                            }
                          }
                        }
                      }
                    },
                    {
                      "key": "wait_3d",
                      "type": "delay",
                      "config": {
                        "duration": "3 days"
                      }
                    },
                    {
                      "key": "is_pro",
                      "type": "condition",
                      "config": {
                        "type": "rule",
                        "field": "event.plan",
                        "operator": "eq",
                        "value": "pro"
                      }
                    },
                    {
                      "key": "tag_pro",
                      "type": "contact_update",
                      "config": {
                        "properties": {
                          "plan": "pro"
                        }
                      }
                    }
                  ],
                  "connections": [
                    {
                      "from": "start",
                      "to": "welcome",
                      "type": "default"
                    },
                    {
                      "from": "welcome",
                      "to": "wait_3d",
                      "type": "default"
                    },
                    {
                      "from": "wait_3d",
                      "to": "is_pro",
                      "type": "default"
                    },
                    {
                      "from": "is_pro",
                      "to": "tag_pro",
                      "type": "condition_met"
                    }
                  ],
                  "state": "enabled",
                  "type": "transactional",
                  "topic_id": null,
                  "settings": {
                    "reentry": "once",
                    "allow_parallel_runs": false,
                    "exit_on_reply": false,
                    "timezone": "UTC",
                    "send_window": {
                      "enabled": false,
                      "days": [
                        "mon",
                        "tue",
                        "wed",
                        "thu",
                        "fri"
                      ],
                      "start": "09:00",
                      "end": "18:00"
                    },
                    "verify_on_entry": false
                  },
                  "layout": null,
                  "version": 1,
                  "has_unpublished_changes": false,
                  "paused_reason": null
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/automations/{id}/draft": {
      "get": {
        "operationId": "getAutomationDraft",
        "summary": "Retrieve the draft",
        "description": "Returns the editable draft graph and its current validation issues. The draft becomes a version when you enable the automation.\n\n- send.io extension.",
        "tags": [
          "Automations"
        ],
        "x-docs-ids": [
          "get-automation-draft"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The automation ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "automation_id": {
                      "type": "string"
                    },
                    "steps": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "key": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "config": {
                            "type": "object",
                            "properties": {
                              "event_name": {
                                "type": "string"
                              },
                              "template": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "variables": {
                                    "type": "object",
                                    "properties": {
                                      "first_name": {
                                        "type": "object",
                                        "properties": {
                                          "var": {
                                            "type": "string"
                                          }
                                        }
                                      }
                                    }
                                  }
                                }
                              },
                              "duration": {
                                "type": "string"
                              },
                              "type": {
                                "type": "string"
                              },
                              "field": {
                                "type": "string"
                              },
                              "operator": {
                                "type": "string"
                              },
                              "value": {
                                "type": "string"
                              },
                              "properties": {
                                "type": "object",
                                "properties": {
                                  "plan": {
                                    "type": "string"
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    "connections": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "from": {
                            "type": "string"
                          },
                          "to": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "layout": {},
                    "has_unpublished_changes": {
                      "type": "boolean"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "issues": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "severity": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          },
                          "step_key": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "automation_draft",
                  "automation_id": "5b0f6f2e-3c1d-4a8e-9f7b-2d6c8e1a4b90",
                  "steps": [
                    {
                      "key": "start",
                      "type": "trigger",
                      "config": {
                        "event_name": "user.created"
                      }
                    },
                    {
                      "key": "welcome",
                      "type": "send_email",
                      "config": {
                        "template": {
                          "id": "34a080c9-b17d-4187-ad80-5af20266e535",
                          "variables": {
                            "first_name": {
                              "var": "event.first_name"
                            }
                          }
                        }
                      }
                    },
                    {
                      "key": "wait_3d",
                      "type": "delay",
                      "config": {
                        "duration": "3 days"
                      }
                    },
                    {
                      "key": "is_pro",
                      "type": "condition",
                      "config": {
                        "type": "rule",
                        "field": "event.plan",
                        "operator": "eq",
                        "value": "pro"
                      }
                    },
                    {
                      "key": "tag_pro",
                      "type": "contact_update",
                      "config": {
                        "properties": {
                          "plan": "pro"
                        }
                      }
                    }
                  ],
                  "connections": [
                    {
                      "from": "start",
                      "to": "welcome",
                      "type": "default"
                    },
                    {
                      "from": "welcome",
                      "to": "wait_3d",
                      "type": "default"
                    },
                    {
                      "from": "wait_3d",
                      "to": "is_pro",
                      "type": "default"
                    },
                    {
                      "from": "is_pro",
                      "to": "tag_pro",
                      "type": "condition_met"
                    }
                  ],
                  "layout": null,
                  "has_unpublished_changes": true,
                  "updated_at": "2026-10-07T09:12:44.123456+00:00",
                  "issues": [
                    {
                      "code": "wait_missing_timeout",
                      "severity": "warning",
                      "message": "No timeout set: the wait gives up after 30 days.",
                      "step_key": "wait_upgrade"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "put": {
        "operationId": "updateAutomationDraft",
        "summary": "Save the draft",
        "description": "Replaces the draft graph (and optionally name, type, topic and settings). Unlike PATCH, an incomplete graph is saved and its problems come back as `issues`.\n\n- send.io extension. The graph of a live (enabled or paused) automation cannot be changed: stop or duplicate it.",
        "tags": [
          "Automations"
        ],
        "x-docs-ids": [
          "update-automation-draft"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The automation ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "steps": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string",
                          "description": "Unique key of the step, used by connections."
                        },
                        "type": {
                          "type": "string",
                          "description": "One of trigger, send_email, delay, wait_for_event, condition, branch, contact_update, contact_delete, add_to_segment, remove_from_segment, webhook (an HTTP request to your own URL), app_action (an action in an app the workspace connected), exit. (notify and experiment are reserved and refused for now.)"
                        },
                        "config": {
                          "type": "object",
                          "description": "Step settings. trigger: {event_name}, or a contact trigger: {kind: \"contact_created\", source?: any | api | import | event | form}, {kind: \"contact_added_to_segment\", segment_id}, {kind: \"contact_removed_from_segment\", segment_id}, {kind: \"contact_updated\", property} where property is first_name, last_name, unsubscribed or the key of a contact property you created, or {kind: \"topic_subscribed\", topic_id}; each takes an optional filter. send_email: {template: {id, variables}, from?, subject?}, where subject replaces the template's subject and takes the same variables ({{NAME}}) and contact merge tags, plus run fields such as {{event.plan}}. delay: {duration: \"3 days\"} or {until: {var}, offset?} (a date more than 90 days away waits 90 days; the step output then has capped: true and requested_until). wait_for_event: {event_name, timeout?, filter_rule?}. condition: a rule {type: rule, field, operator, value} or {type: and | or, rules}; operator is one of eq, neq, gt, gte, lt, lte, contains, not_contains, starts_with, ends_with, in, not_in, exists, not_exists, is_empty, is_not_empty, more_than_days_ago, within_last_days; the field paths and how each operator compares are in the notes of Create an automation. branch: {branches: [{id, rule}]}. contact_update: {properties?, first_name?, last_name?, unsubscribed?}. add_to_segment / remove_from_segment: {segment_id} of a manual segment. webhook: {url, method?, headers?: [{name, value, secret?}], body_type?: json | form | text | none, body?, continue_on_failure?, timeout_seconds?}; see [HTTP request step](/docs/http-request-step). app_action: {app: {connection_id, app, action, input?, label?}, continue_on_failure?}, where connection_id is the workspace's connection of that app and input holds the action's fields; see [App actions](/docs/app-actions).",
                          "properties": {
                            "event_name": {
                              "type": "string"
                            },
                            "template": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "variables": {
                                  "type": "object",
                                  "properties": {
                                    "first_name": {
                                      "type": "object",
                                      "properties": {
                                        "var": {
                                          "type": "string"
                                        }
                                      }
                                    }
                                  }
                                }
                              }
                            },
                            "duration": {
                              "type": "string"
                            },
                            "type": {
                              "type": "string"
                            },
                            "field": {
                              "type": "string"
                            },
                            "operator": {
                              "type": "string"
                            },
                            "value": {
                              "type": "string"
                            },
                            "properties": {
                              "type": "object",
                              "properties": {
                                "plan": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      },
                      "required": [
                        "key",
                        "type"
                      ]
                    },
                    "description": "The automation steps. Each is {key, type, config}. Keys use a-z, 0-9 and underscore (1 to 64 characters). Send together with `connections`."
                  },
                  "connections": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "description": "default (the default), condition_met, condition_not_met, event_received, timeout, branch. Which types a step may start depends on its type."
                        },
                        "from": {
                          "type": "string"
                        },
                        "to": {
                          "type": "string"
                        }
                      }
                    },
                    "description": "The links between steps: {from, to, type, branch_id?, variant_id?}. Send together with `steps`."
                  },
                  "layout": {
                    "type": "object",
                    "description": "Optional editor positions per step key. Saved with the draft."
                  },
                  "name": {
                    "type": "string",
                    "description": "1 to 120 characters."
                  },
                  "type": {
                    "type": "string",
                    "description": "transactional or marketing."
                  },
                  "topic_id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "The topic for marketing automations."
                  },
                  "settings": {
                    "type": "object",
                    "description": "send.io extension. Merged into the current settings: reentry (once | every_time, default once), allow_parallel_runs (default false), exit_on_reply (default true for marketing), timezone (IANA, default UTC; the send window and wait-until dates without a zone are read in it), send_window {enabled, days, start, end} (when enabled, an email step outside the days and hours waits and sends when the window next opens; runs already waiting follow a changed window), verify_on_entry, description (max 500 characters)."
                  },
                  "if_updated_at": {
                    "type": "string",
                    "description": "Optional. Refuse with 409 if the automation changed since."
                  }
                }
              },
              "example": {
                "steps": [
                  {
                    "key": "start",
                    "type": "trigger",
                    "config": {
                      "event_name": "user.created"
                    }
                  },
                  {
                    "key": "welcome",
                    "type": "send_email",
                    "config": {
                      "template": {
                        "id": "34a080c9-b17d-4187-ad80-5af20266e535",
                        "variables": {
                          "first_name": {
                            "var": "event.first_name"
                          }
                        }
                      }
                    }
                  },
                  {
                    "key": "wait_3d",
                    "type": "delay",
                    "config": {
                      "duration": "3 days"
                    }
                  },
                  {
                    "key": "is_pro",
                    "type": "condition",
                    "config": {
                      "type": "rule",
                      "field": "event.plan",
                      "operator": "eq",
                      "value": "pro"
                    }
                  },
                  {
                    "key": "tag_pro",
                    "type": "contact_update",
                    "config": {
                      "properties": {
                        "plan": "pro"
                      }
                    }
                  }
                ],
                "connections": [
                  {
                    "from": "start",
                    "to": "welcome",
                    "type": "default"
                  },
                  {
                    "from": "welcome",
                    "to": "wait_3d",
                    "type": "default"
                  },
                  {
                    "from": "wait_3d",
                    "to": "is_pro",
                    "type": "default"
                  },
                  {
                    "from": "is_pro",
                    "to": "tag_pro",
                    "type": "condition_met"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "automation_id": {
                      "type": "string"
                    },
                    "has_unpublished_changes": {
                      "type": "boolean"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "issues": {
                      "type": "array"
                    }
                  }
                },
                "example": {
                  "object": "automation_draft",
                  "automation_id": "5b0f6f2e-3c1d-4a8e-9f7b-2d6c8e1a4b90",
                  "has_unpublished_changes": true,
                  "updated_at": "2026-10-07T09:12:44.123456+00:00",
                  "issues": []
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/automations/{id}/validate": {
      "post": {
        "operationId": "validateAutomation",
        "summary": "Validate an automation",
        "description": "Checks the draft, or a graph you send, without saving anything. Errors block enabling; warnings do not.\n\n- send.io extension. Each issue has code, severity, message and, when it is about one step, step_key.",
        "tags": [
          "Automations"
        ],
        "x-docs-ids": [
          "validate-automation"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The automation ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "steps": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "config": {
                          "type": "object",
                          "properties": {
                            "event_name": {
                              "type": "string"
                            },
                            "template": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "variables": {
                                  "type": "object",
                                  "properties": {
                                    "first_name": {
                                      "type": "object",
                                      "properties": {
                                        "var": {
                                          "type": "string"
                                        }
                                      }
                                    }
                                  }
                                }
                              }
                            },
                            "duration": {
                              "type": "string"
                            },
                            "type": {
                              "type": "string"
                            },
                            "field": {
                              "type": "string"
                            },
                            "operator": {
                              "type": "string"
                            },
                            "value": {
                              "type": "string"
                            },
                            "properties": {
                              "type": "object",
                              "properties": {
                                "plan": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    "description": "Optional graph to check instead of the saved draft. Send with `connections`."
                  },
                  "connections": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "from": {
                          "type": "string"
                        },
                        "to": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        }
                      }
                    },
                    "description": "Optional, with `steps`."
                  }
                }
              },
              "example": {
                "steps": [
                  {
                    "key": "start",
                    "type": "trigger",
                    "config": {
                      "event_name": "user.created"
                    }
                  },
                  {
                    "key": "welcome",
                    "type": "send_email",
                    "config": {
                      "template": {
                        "id": "34a080c9-b17d-4187-ad80-5af20266e535",
                        "variables": {
                          "first_name": {
                            "var": "event.first_name"
                          }
                        }
                      }
                    }
                  },
                  {
                    "key": "wait_3d",
                    "type": "delay",
                    "config": {
                      "duration": "3 days"
                    }
                  },
                  {
                    "key": "is_pro",
                    "type": "condition",
                    "config": {
                      "type": "rule",
                      "field": "event.plan",
                      "operator": "eq",
                      "value": "pro"
                    }
                  },
                  {
                    "key": "tag_pro",
                    "type": "contact_update",
                    "config": {
                      "properties": {
                        "plan": "pro"
                      }
                    }
                  }
                ],
                "connections": [
                  {
                    "from": "start",
                    "to": "welcome",
                    "type": "default"
                  },
                  {
                    "from": "welcome",
                    "to": "wait_3d",
                    "type": "default"
                  },
                  {
                    "from": "wait_3d",
                    "to": "is_pro",
                    "type": "default"
                  },
                  {
                    "from": "is_pro",
                    "to": "tag_pro",
                    "type": "condition_met"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "valid": {
                      "type": "boolean"
                    },
                    "errors": {
                      "type": "array"
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "severity": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "automation_validation",
                  "valid": true,
                  "errors": [],
                  "warnings": [
                    {
                      "code": "no_test_since_edit",
                      "severity": "warning",
                      "message": "Test the automation before enabling it: changes were made since the last test."
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/automations/{id}/test": {
      "post": {
        "operationId": "testAutomation",
        "summary": "Test an automation",
        "description": "Runs the draft for one contact. A dry run sends and changes nothing and shows the path taken. A live run really runs, but its emails go only to `to`, and it is marked as a test.\n\n- send.io extension.\n\n- A live test returns {object: \"automation_test\", mode: \"live\", run_id, version, to}. In a live test, delays are shortened to 10 seconds.\n\n- A live test validates the draft and saves it as a new version first if it changed.\n\n- `entry` says whether a real event would start a run now, and why not (for example automation_disabled or reentry_not_allowed).",
        "tags": [
          "Automations"
        ],
        "x-docs-ids": [
          "test-automation"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The automation ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "mode": {
                    "type": "string",
                    "description": "dry_run (the default) or live."
                  },
                  "payload": {
                    "type": "object",
                    "description": "The event payload to test with (for event triggers).",
                    "properties": {
                      "first_name": {
                        "type": "string"
                      },
                      "plan": {
                        "type": "string"
                      }
                    }
                  },
                  "contact_id": {
                    "type": "string",
                    "description": "Test as this existing contact."
                  },
                  "email": {
                    "type": "string",
                    "description": "Test as the contact with this email. A dry run uses a sample contact if none exists; a live run creates it."
                  },
                  "to": {
                    "type": "string",
                    "description": "Live only: the address that receives the test emails. Required with an API key."
                  },
                  "wait_outcome": {
                    "type": "string",
                    "description": "Dry run only. timeout (the default) or event_received: which path wait steps follow."
                  },
                  "first_name": {
                    "type": "string",
                    "description": "Dry run sample contact: first name."
                  },
                  "last_name": {
                    "type": "string",
                    "description": "Dry run sample contact: last name."
                  },
                  "properties": {
                    "type": "object",
                    "description": "Dry run sample contact: custom properties."
                  }
                }
              },
              "example": {
                "mode": "dry_run",
                "email": "jane@acme.com",
                "payload": {
                  "first_name": "Jane",
                  "plan": "pro"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "mode": {
                      "type": "string"
                    },
                    "path": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "steps": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "key": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "output": {
                            "type": "object",
                            "properties": {
                              "event": {
                                "type": "object",
                                "properties": {
                                  "event_name": {
                                    "type": "string"
                                  },
                                  "payload": {
                                    "type": "object",
                                    "properties": {
                                      "first_name": {
                                        "type": "string"
                                      },
                                      "plan": {
                                        "type": "string"
                                      }
                                    }
                                  }
                                }
                              },
                              "to": {
                                "type": "string"
                              },
                              "from": {
                                "type": "string"
                              },
                              "subject": {
                                "type": "string"
                              },
                              "html": {
                                "type": "string"
                              },
                              "template_id": {
                                "type": "string"
                              },
                              "variables": {
                                "type": "object",
                                "properties": {
                                  "first_name": {
                                    "type": "string"
                                  }
                                }
                              },
                              "would_wait": {
                                "type": "string"
                              },
                              "elapsed": {
                                "type": "string"
                              },
                              "result": {
                                "type": "boolean"
                              },
                              "evaluated": {
                                "type": "array"
                              },
                              "would_update": {
                                "type": "object",
                                "properties": {
                                  "properties": {
                                    "type": "object",
                                    "properties": {
                                      "plan": {
                                        "type": "string"
                                      }
                                    }
                                  }
                                }
                              }
                            }
                          },
                          "next": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "issues": {
                      "type": "array"
                    },
                    "entry": {
                      "type": "object",
                      "properties": {
                        "would_start": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "automation_test",
                  "mode": "dry_run",
                  "path": [
                    "start",
                    "welcome",
                    "wait_3d",
                    "is_pro",
                    "tag_pro"
                  ],
                  "steps": [
                    {
                      "key": "start",
                      "type": "trigger",
                      "status": "completed",
                      "output": {
                        "event": {
                          "event_name": "user.created",
                          "payload": {
                            "first_name": "Jane",
                            "plan": "pro"
                          }
                        }
                      },
                      "next": "default"
                    },
                    {
                      "key": "welcome",
                      "type": "send_email",
                      "status": "completed",
                      "output": {
                        "to": "jane@acme.com",
                        "from": "Acme <hello@acme.com>",
                        "subject": "Welcome to Acme, Jane",
                        "html": "<p>Hi Jane, welcome aboard.</p>",
                        "template_id": "34a080c9-b17d-4187-ad80-5af20266e535",
                        "variables": {
                          "first_name": "Jane"
                        }
                      },
                      "next": "default"
                    },
                    {
                      "key": "wait_3d",
                      "type": "delay",
                      "status": "completed",
                      "output": {
                        "would_wait": "3 days",
                        "elapsed": "3 days"
                      },
                      "next": "default"
                    },
                    {
                      "key": "is_pro",
                      "type": "condition",
                      "status": "completed",
                      "output": {
                        "result": true,
                        "evaluated": []
                      },
                      "next": "condition_met"
                    },
                    {
                      "key": "tag_pro",
                      "type": "contact_update",
                      "status": "completed",
                      "output": {
                        "would_update": {
                          "properties": {
                            "plan": "pro"
                          }
                        }
                      },
                      "next": "default"
                    }
                  ],
                  "issues": [],
                  "entry": {
                    "would_start": true
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/automations/http/import": {
      "post": {
        "operationId": "importAutomationHttpStep",
        "summary": "Import an HTTP request",
        "description": "Turns a cURL command, or an HTTP Request node copied from n8n, into the config of an HTTP request (webhook) step. It only reads what you paste: it never calls the URL or runs anything.\n\n- send.io extension. Review the config before you save it: swap fixed values for tokens such as {{contact.email}}.\n\n- cURL: -X, -H, -d / --data / --data-raw / --data-binary, --data-urlencode, --json, -u (becomes a secret Basic Authorization header), -G and --url are read. -A, -k and -L are dropped with a warning. -F (multipart), -T, @file data, cookie files, http:// URLs and a second URL are refused with 422.\n\n- n8n: HTTP Request nodes version 1 to 4.x. `={{ $json.field }}` expressions become {{event.field}} with a warning to check them; other expressions are kept as text with a warning. Credentials are not part of an n8n copy, so add your auth header.\n\n- Headers that look like keys or tokens (Authorization, *key*, *token*, *secret*) come back marked secret.",
        "tags": [
          "Automations"
        ],
        "x-docs-ids": [
          "import-automation-http-step"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "curl": {
                    "type": "string",
                    "description": "A curl command, as copied from API docs or a browser's \"Copy as cURL\". Line breaks with a backslash are fine. Send this or `n8n`."
                  },
                  "n8n": {
                    "type": [
                      "object",
                      "string"
                    ],
                    "description": "What n8n puts on the clipboard when you copy a node ({nodes, connections}), or one node object, as JSON or a string. Send this or `curl`."
                  },
                  "node": {
                    "type": "string",
                    "description": "With `n8n`: the name of the HTTP Request node to use when the paste holds more than one."
                  }
                }
              },
              "example": {
                "curl": "curl https://api.hubapi.com/crm/v3/objects/contacts \\\n  -H 'Authorization: Bearer pat-na1-xxxx' \\\n  -H 'Content-Type: application/json' \\\n  -d '{\"properties\":{\"email\":\"jane@acme.com\"}}'"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "config": {
                      "type": "object",
                      "properties": {
                        "url": {
                          "type": "string"
                        },
                        "method": {
                          "type": "string"
                        },
                        "headers": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "name": {
                                "type": "string"
                              },
                              "value": {
                                "type": "string"
                              },
                              "secret": {
                                "type": "boolean"
                              }
                            }
                          }
                        },
                        "body_type": {
                          "type": "string"
                        },
                        "body": {
                          "type": "object",
                          "properties": {
                            "properties": {
                              "type": "object",
                              "properties": {
                                "email": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        },
                        "continue_on_failure": {
                          "type": "boolean"
                        },
                        "timeout_seconds": {
                          "type": "number"
                        }
                      }
                    },
                    "warnings": {
                      "type": "array"
                    }
                  }
                },
                "example": {
                  "object": "automation_http_import",
                  "config": {
                    "url": "https://api.hubapi.com/crm/v3/objects/contacts",
                    "method": "POST",
                    "headers": [
                      {
                        "name": "Authorization",
                        "value": "Bearer pat-na1-xxxx",
                        "secret": true
                      },
                      {
                        "name": "Content-Type",
                        "value": "application/json"
                      }
                    ],
                    "body_type": "json",
                    "body": {
                      "properties": {
                        "email": "jane@acme.com"
                      }
                    },
                    "continue_on_failure": false,
                    "timeout_seconds": 10
                  },
                  "warnings": []
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/automations/http/test": {
      "post": {
        "operationId": "testHttpStep",
        "summary": "Send a test HTTP request",
        "description": "Sends one real request with an HTTP request step's config, filled in for a contact and a sample event, and returns what came back. It uses the same client, signature and limits as a running automation.\n\n- send.io extension. Needs an admin. At most 10 tests a minute per team.\n\n- Secret header values are masked in `request.headers`. A config read back from the API has empty secret values: send `automation_id` and `step_key` and the server fills them with the values saved on that automation's step.\n\n- `ok` is false and `error` says why when the call failed; `status_code` is 0 on network errors and timeouts.",
        "tags": [
          "Automations"
        ],
        "x-docs-ids": [
          "test-http-step"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "config": {
                    "type": "object",
                    "description": "The step config to test (see the webhook step).",
                    "properties": {
                      "url": {
                        "type": "string"
                      },
                      "method": {
                        "type": "string"
                      },
                      "headers": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "name": {
                              "type": "string"
                            },
                            "value": {
                              "type": "string"
                            },
                            "secret": {
                              "type": "boolean"
                            },
                            "has_value": {
                              "type": "boolean"
                            }
                          }
                        }
                      },
                      "body_type": {
                        "type": "string"
                      },
                      "body": {
                        "type": "object",
                        "properties": {
                          "properties": {
                            "type": "object",
                            "properties": {
                              "email": {
                                "type": "string"
                              },
                              "plan": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      },
                      "continue_on_failure": {
                        "type": "boolean"
                      },
                      "timeout_seconds": {
                        "type": "number"
                      }
                    }
                  },
                  "contact_id": {
                    "type": "string",
                    "description": "Fill {{contact.*}} from this contact."
                  },
                  "email": {
                    "type": "string",
                    "description": "Fill {{contact.*}} from the contact with this email (or a sample one)."
                  },
                  "event": {
                    "type": "object",
                    "description": "A sample event payload for {{event.*}}.",
                    "properties": {
                      "plan": {
                        "type": "string"
                      }
                    }
                  },
                  "automation_id": {
                    "type": "string",
                    "description": "Automation whose saved secret header values fill empty secret headers."
                  },
                  "step_key": {
                    "type": "string",
                    "description": "With `automation_id`: the key of the HTTP request step whose saved values to use."
                  }
                },
                "required": [
                  "config"
                ]
              },
              "example": {
                "automation_id": "5b0f6f2e-3c1d-4a8e-9f7b-2d6c8e1a4b90",
                "step_key": "http_1",
                "config": {
                  "url": "https://api.hubapi.com/crm/v3/objects/contacts",
                  "method": "POST",
                  "headers": [
                    {
                      "name": "Authorization",
                      "value": "",
                      "secret": true,
                      "has_value": true
                    },
                    {
                      "name": "Content-Type",
                      "value": "application/json"
                    }
                  ],
                  "body_type": "json",
                  "body": {
                    "properties": {
                      "email": "{{contact.email}}",
                      "plan": "{{event.plan}}"
                    }
                  },
                  "continue_on_failure": false,
                  "timeout_seconds": 10
                },
                "email": "jane@acme.com",
                "event": {
                  "plan": "pro"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "status_code": {
                      "type": "number"
                    },
                    "duration_ms": {
                      "type": "number"
                    },
                    "response_excerpt": {
                      "type": "string"
                    },
                    "ok": {
                      "type": "boolean"
                    },
                    "request": {
                      "type": "object",
                      "properties": {
                        "method": {
                          "type": "string"
                        },
                        "url": {
                          "type": "string"
                        },
                        "headers": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "name": {
                                "type": "string"
                              },
                              "value": {
                                "type": "string"
                              }
                            }
                          }
                        },
                        "body": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "automation_http_test",
                  "status_code": 201,
                  "duration_ms": 182,
                  "response_excerpt": "{\"id\":\"512\",\"properties\":{\"email\":\"jane@acme.com\"}}",
                  "ok": true,
                  "request": {
                    "method": "POST",
                    "url": "https://api.hubapi.com/crm/v3/objects/contacts",
                    "headers": [
                      {
                        "name": "Authorization",
                        "value": "********"
                      },
                      {
                        "name": "Content-Type",
                        "value": "application/json"
                      }
                    ],
                    "body": "{\"properties\":{\"email\":\"jane@acme.com\"}}"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/automations/signing-secret": {
      "get": {
        "operationId": "getAutomationSigningSecret",
        "summary": "Retrieve the signing secret",
        "description": "Returns the secret that signs every HTTP request step of the team, so your endpoint can check a request really came from your send.io automations.\n\n- send.io extension. Needs an admin. See [Verify the signature](/docs/http-request-step#verify) for the check.\n\n- The secret is created the first time it is read, so the first call returns a new secret rather than an error.",
        "tags": [
          "Automations"
        ],
        "x-docs-ids": [
          "get-automation-signing-secret"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "secret": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "object": "automation_signing_secret",
                  "secret": "whsec_MfKQ9r8GKYqrTwjUPD8ILPZIo2LaLaSw",
                  "created_at": "2026-10-07T09:12:44.123456+00:00"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/automations/signing-secret/rotate": {
      "post": {
        "operationId": "rotateAutomationSigningSecret",
        "summary": "Rotate the signing secret",
        "description": "Replaces the team's HTTP request signing secret with a new one and returns it.\n\n- send.io extension. Needs an admin. Update your endpoint with the new secret.",
        "tags": [
          "Automations"
        ],
        "x-docs-ids": [
          "rotate-automation-signing-secret"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "secret": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "object": "automation_signing_secret",
                  "secret": "whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD",
                  "created_at": "2026-10-07T09:12:44.123456+00:00"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/automations/{id}/versions": {
      "get": {
        "operationId": "listAutomationVersions",
        "summary": "List versions",
        "description": "Lists the versions saved each time the automation was enabled with a changed graph, newest first.\n\n- send.io extension. Not paginated. `published_by` is null when an API key published it.",
        "tags": [
          "Automations"
        ],
        "x-docs-ids": [
          "list-automation-versions"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The automation ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "version": {
                            "type": "number"
                          },
                          "published_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "published_by": {},
                          "current": {
                            "type": "boolean"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "data": [
                    {
                      "version": 2,
                      "published_at": "2026-10-07T09:12:44.123456+00:00",
                      "published_by": null,
                      "current": true
                    },
                    {
                      "version": 1,
                      "published_at": "2026-09-30T14:02:10.5512+00:00",
                      "published_by": null,
                      "current": false
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/automations/{id}/versions/{n}": {
      "get": {
        "operationId": "getAutomationVersion",
        "summary": "Retrieve a version",
        "description": "Returns one saved version: its graph, settings, type and topic.\n\n- send.io extension. Versions never change; runs always follow the version they started on.",
        "tags": [
          "Automations"
        ],
        "x-docs-ids": [
          "get-automation-version"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The automation ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "n",
            "in": "path",
            "required": true,
            "description": "The version number.",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "automation_id": {
                      "type": "string"
                    },
                    "version": {
                      "type": "number"
                    },
                    "steps": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "key": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "config": {
                            "type": "object",
                            "properties": {
                              "event_name": {
                                "type": "string"
                              },
                              "template": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "variables": {
                                    "type": "object",
                                    "properties": {
                                      "first_name": {
                                        "type": "object",
                                        "properties": {
                                          "var": {
                                            "type": "string"
                                          }
                                        }
                                      }
                                    }
                                  }
                                }
                              },
                              "duration": {
                                "type": "string"
                              },
                              "type": {
                                "type": "string"
                              },
                              "field": {
                                "type": "string"
                              },
                              "operator": {
                                "type": "string"
                              },
                              "value": {
                                "type": "string"
                              },
                              "properties": {
                                "type": "object",
                                "properties": {
                                  "plan": {
                                    "type": "string"
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    "connections": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "from": {
                            "type": "string"
                          },
                          "to": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "layout": {},
                    "settings": {
                      "type": "object",
                      "properties": {
                        "reentry": {
                          "type": "string"
                        },
                        "allow_parallel_runs": {
                          "type": "boolean"
                        },
                        "exit_on_reply": {
                          "type": "boolean"
                        },
                        "timezone": {
                          "type": "string"
                        },
                        "send_window": {
                          "type": "object",
                          "properties": {
                            "enabled": {
                              "type": "boolean"
                            },
                            "days": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "start": {
                              "type": "string"
                            },
                            "end": {
                              "type": "string"
                            }
                          }
                        },
                        "verify_on_entry": {
                          "type": "boolean"
                        }
                      }
                    },
                    "type": {
                      "type": "string"
                    },
                    "topic_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "published_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "object": "automation_version",
                  "automation_id": "5b0f6f2e-3c1d-4a8e-9f7b-2d6c8e1a4b90",
                  "version": 1,
                  "steps": [
                    {
                      "key": "start",
                      "type": "trigger",
                      "config": {
                        "event_name": "user.created"
                      }
                    },
                    {
                      "key": "welcome",
                      "type": "send_email",
                      "config": {
                        "template": {
                          "id": "34a080c9-b17d-4187-ad80-5af20266e535",
                          "variables": {
                            "first_name": {
                              "var": "event.first_name"
                            }
                          }
                        }
                      }
                    },
                    {
                      "key": "wait_3d",
                      "type": "delay",
                      "config": {
                        "duration": "3 days"
                      }
                    },
                    {
                      "key": "is_pro",
                      "type": "condition",
                      "config": {
                        "type": "rule",
                        "field": "event.plan",
                        "operator": "eq",
                        "value": "pro"
                      }
                    },
                    {
                      "key": "tag_pro",
                      "type": "contact_update",
                      "config": {
                        "properties": {
                          "plan": "pro"
                        }
                      }
                    }
                  ],
                  "connections": [
                    {
                      "from": "start",
                      "to": "welcome",
                      "type": "default"
                    },
                    {
                      "from": "welcome",
                      "to": "wait_3d",
                      "type": "default"
                    },
                    {
                      "from": "wait_3d",
                      "to": "is_pro",
                      "type": "default"
                    },
                    {
                      "from": "is_pro",
                      "to": "tag_pro",
                      "type": "condition_met"
                    }
                  ],
                  "layout": null,
                  "settings": {
                    "reentry": "once",
                    "allow_parallel_runs": false,
                    "exit_on_reply": false,
                    "timezone": "UTC",
                    "send_window": {
                      "enabled": false,
                      "days": [
                        "mon",
                        "tue",
                        "wed",
                        "thu",
                        "fri"
                      ],
                      "start": "09:00",
                      "end": "18:00"
                    },
                    "verify_on_entry": false
                  },
                  "type": "transactional",
                  "topic_id": null,
                  "published_at": "2026-10-07T09:12:44.123456+00:00"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/automations/{id}/runs": {
      "get": {
        "operationId": "listAutomationRuns",
        "summary": "List runs",
        "description": "Lists the automation's runs (one per contact entry), newest first. Test runs are left out by default.\n\n- send.io extensions: `current_step_type` is the type of the step the run is at. `error` is set on a failed run: {step, code, message}. `holds` lists the times a paused automation held the run: {reason, step, started_at, ended_at}, the one still holding last with ended_at null. The step it held at does not count that time as its own.",
        "tags": [
          "Automations"
        ],
        "x-docs-ids": [
          "list-automation-runs"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The automation ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Filter by status: running, completed, failed, cancelled or skipped. Comma-separate several.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "email",
            "in": "query",
            "required": false,
            "description": "send.io extension. Contact email contains this text.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "send.io extension. Created at or after this time (ISO 8601).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "send.io extension. Created before this time (ISO 8601).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "test",
            "in": "query",
            "required": false,
            "description": "send.io extension. Default excludes test runs; include adds them; only returns only them.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "1 to 100. Default 20.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "Return items after this run ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "description": "Return items before this run ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "started_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "completed_at": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date-time"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "version": {
                            "type": "number"
                          },
                          "contact_id": {
                            "type": "string"
                          },
                          "email": {
                            "type": "string"
                          },
                          "end_reason": {},
                          "current_step": {
                            "type": "string"
                          },
                          "current_step_type": {
                            "type": "string"
                          },
                          "hold_reason": {},
                          "waiting": {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string"
                              },
                              "until": {
                                "type": "string"
                              }
                            }
                          },
                          "is_test": {
                            "type": "boolean"
                          },
                          "trigger": {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string"
                              },
                              "ref": {
                                "type": "string"
                              }
                            }
                          },
                          "holds": {
                            "type": "array"
                          },
                          "error": {}
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "has_more": false,
                  "data": [
                    {
                      "id": "9d2e4c1a-7b3f-4e6d-8a5c-1f0b2e3d4c5a",
                      "status": "running",
                      "started_at": "2026-10-07T09:12:44.123456+00:00",
                      "completed_at": null,
                      "created_at": "2026-10-07T09:12:44.123456+00:00",
                      "version": 1,
                      "contact_id": "e4c1b2a3-5d6f-4a7b-8c9d-0e1f2a3b4c5d",
                      "email": "jane@acme.com",
                      "end_reason": null,
                      "current_step": "wait_3d",
                      "current_step_type": "delay",
                      "hold_reason": null,
                      "waiting": {
                        "kind": "delay",
                        "until": "2026-10-07T09:12:44.123456+00:00"
                      },
                      "is_test": false,
                      "trigger": {
                        "type": "event",
                        "ref": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f"
                      },
                      "holds": [],
                      "error": null
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/automations/{id}/runs/{run_id}": {
      "get": {
        "operationId": "getAutomationRun",
        "summary": "Retrieve a run",
        "description": "Returns one run with every step it went through, including outputs and errors.",
        "tags": [
          "Automations"
        ],
        "x-docs-ids": [
          "get-automation-run"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The automation ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "run_id",
            "in": "path",
            "required": true,
            "description": "The run ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "automation_id": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "started_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "completed_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "version": {
                      "type": "number"
                    },
                    "contact_id": {
                      "type": "string"
                    },
                    "email": {
                      "type": "string"
                    },
                    "end_reason": {},
                    "current_step": {
                      "type": "string"
                    },
                    "current_step_type": {
                      "type": "string"
                    },
                    "hold_reason": {},
                    "waiting": {},
                    "is_test": {
                      "type": "boolean"
                    },
                    "trigger": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string"
                        },
                        "ref": {
                          "type": "string"
                        }
                      }
                    },
                    "holds": {
                      "type": "array"
                    },
                    "error": {},
                    "steps": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "key": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "started_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "completed_at": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date-time"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "output": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "properties": {
                              "event": {
                                "type": "object",
                                "properties": {
                                  "event_name": {
                                    "type": "string"
                                  },
                                  "payload": {
                                    "type": "object",
                                    "properties": {
                                      "first_name": {
                                        "type": "string"
                                      },
                                      "plan": {
                                        "type": "string"
                                      }
                                    }
                                  }
                                }
                              },
                              "email_id": {
                                "type": "string"
                              }
                            }
                          },
                          "error": {},
                          "next": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "attempts": {
                            "type": "number"
                          },
                          "scheduled_for": {
                            "type": [
                              "null",
                              "string"
                            ]
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "automation_run",
                  "automation_id": "5b0f6f2e-3c1d-4a8e-9f7b-2d6c8e1a4b90",
                  "id": "9d2e4c1a-7b3f-4e6d-8a5c-1f0b2e3d4c5a",
                  "status": "running",
                  "started_at": "2026-10-07T09:12:44.123456+00:00",
                  "completed_at": null,
                  "created_at": "2026-10-07T09:12:44.123456+00:00",
                  "version": 1,
                  "contact_id": "e4c1b2a3-5d6f-4a7b-8c9d-0e1f2a3b4c5d",
                  "email": "jane@acme.com",
                  "end_reason": null,
                  "current_step": "wait_3d",
                  "current_step_type": "delay",
                  "hold_reason": null,
                  "waiting": null,
                  "is_test": false,
                  "trigger": {
                    "type": "event",
                    "ref": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f"
                  },
                  "holds": [],
                  "error": null,
                  "steps": [
                    {
                      "key": "start",
                      "type": "trigger",
                      "status": "completed",
                      "started_at": "2026-10-07T09:12:44.123456+00:00",
                      "completed_at": "2026-10-07T09:12:44.123456+00:00",
                      "created_at": "2026-10-07T09:12:44.123456+00:00",
                      "output": {
                        "event": {
                          "event_name": "user.created",
                          "payload": {
                            "first_name": "Jane",
                            "plan": "pro"
                          }
                        }
                      },
                      "error": null,
                      "next": "default",
                      "attempts": 1,
                      "scheduled_for": null
                    },
                    {
                      "key": "welcome",
                      "type": "send_email",
                      "status": "completed",
                      "started_at": "2026-10-07T09:12:44.123456+00:00",
                      "completed_at": "2026-10-07T09:12:44.123456+00:00",
                      "created_at": "2026-10-07T09:12:44.123456+00:00",
                      "output": {
                        "email_id": "49a3999c-0ce1-4ea6-ab68-afcd6dc2e794"
                      },
                      "error": null,
                      "next": "default",
                      "attempts": 1,
                      "scheduled_for": null
                    },
                    {
                      "key": "wait_3d",
                      "type": "delay",
                      "status": "waiting",
                      "started_at": "2026-10-07T09:12:44.123456+00:00",
                      "completed_at": null,
                      "created_at": "2026-10-07T09:12:44.123456+00:00",
                      "output": null,
                      "error": null,
                      "next": null,
                      "attempts": 1,
                      "scheduled_for": "2026-10-10T09:12:44.123456+00:00"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/automations/{id}/runs/{run_id}/cancel": {
      "post": {
        "operationId": "cancelAutomationRun",
        "summary": "Cancel a run",
        "description": "Ends one run in progress. Its pending steps are skipped. Returns the run.\n\n- send.io extension. Returns 422 if the run already ended.",
        "tags": [
          "Automations"
        ],
        "x-docs-ids": [
          "cancel-automation-run"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The automation ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "run_id",
            "in": "path",
            "required": true,
            "description": "The run ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "automation_id": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "started_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "completed_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "version": {
                      "type": "number"
                    },
                    "contact_id": {
                      "type": "string"
                    },
                    "email": {
                      "type": "string"
                    },
                    "end_reason": {
                      "type": "string"
                    },
                    "current_step": {
                      "type": "string"
                    },
                    "current_step_type": {
                      "type": "string"
                    },
                    "hold_reason": {},
                    "waiting": {},
                    "is_test": {
                      "type": "boolean"
                    },
                    "trigger": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string"
                        },
                        "ref": {
                          "type": "string"
                        }
                      }
                    },
                    "holds": {
                      "type": "array"
                    },
                    "error": {},
                    "steps": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "key": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "started_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "completed_at": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date-time"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "output": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "properties": {
                              "event": {
                                "type": "object",
                                "properties": {
                                  "event_name": {
                                    "type": "string"
                                  },
                                  "payload": {
                                    "type": "object",
                                    "properties": {
                                      "first_name": {
                                        "type": "string"
                                      },
                                      "plan": {
                                        "type": "string"
                                      }
                                    }
                                  }
                                }
                              },
                              "email_id": {
                                "type": "string"
                              }
                            }
                          },
                          "error": {},
                          "next": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "attempts": {
                            "type": "number"
                          },
                          "scheduled_for": {
                            "type": [
                              "null",
                              "string"
                            ]
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "automation_run",
                  "automation_id": "5b0f6f2e-3c1d-4a8e-9f7b-2d6c8e1a4b90",
                  "id": "9d2e4c1a-7b3f-4e6d-8a5c-1f0b2e3d4c5a",
                  "status": "cancelled",
                  "started_at": "2026-10-07T09:12:44.123456+00:00",
                  "completed_at": "2026-10-07T09:12:44.123456+00:00",
                  "created_at": "2026-10-07T09:12:44.123456+00:00",
                  "version": 1,
                  "contact_id": "e4c1b2a3-5d6f-4a7b-8c9d-0e1f2a3b4c5d",
                  "email": "jane@acme.com",
                  "end_reason": "cancelled_by_user",
                  "current_step": "wait_3d",
                  "current_step_type": "delay",
                  "hold_reason": null,
                  "waiting": null,
                  "is_test": false,
                  "trigger": {
                    "type": "event",
                    "ref": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f"
                  },
                  "holds": [],
                  "error": null,
                  "steps": [
                    {
                      "key": "start",
                      "type": "trigger",
                      "status": "completed",
                      "started_at": "2026-10-07T09:12:44.123456+00:00",
                      "completed_at": "2026-10-07T09:12:44.123456+00:00",
                      "created_at": "2026-10-07T09:12:44.123456+00:00",
                      "output": {
                        "event": {
                          "event_name": "user.created",
                          "payload": {
                            "first_name": "Jane",
                            "plan": "pro"
                          }
                        }
                      },
                      "error": null,
                      "next": "default",
                      "attempts": 1,
                      "scheduled_for": null
                    },
                    {
                      "key": "welcome",
                      "type": "send_email",
                      "status": "completed",
                      "started_at": "2026-10-07T09:12:44.123456+00:00",
                      "completed_at": "2026-10-07T09:12:44.123456+00:00",
                      "created_at": "2026-10-07T09:12:44.123456+00:00",
                      "output": {
                        "email_id": "49a3999c-0ce1-4ea6-ab68-afcd6dc2e794"
                      },
                      "error": null,
                      "next": "default",
                      "attempts": 1,
                      "scheduled_for": null
                    },
                    {
                      "key": "wait_3d",
                      "type": "delay",
                      "status": "waiting",
                      "started_at": "2026-10-07T09:12:44.123456+00:00",
                      "completed_at": null,
                      "created_at": "2026-10-07T09:12:44.123456+00:00",
                      "output": null,
                      "error": null,
                      "next": null,
                      "attempts": 1,
                      "scheduled_for": "2026-10-10T09:12:44.123456+00:00"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/automations/{id}/metrics": {
      "get": {
        "operationId": "getAutomationMetrics",
        "summary": "Retrieve metrics",
        "description": "Run counts, per-step counts and delivery stats of the emails the automation sent, for a time range. Test runs are left out.\n\n- send.io extension.",
        "tags": [
          "Automations"
        ],
        "x-docs-ids": [
          "get-automation-metrics"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The automation ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "Start (RFC 3339). Default 7 days ago.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "End (RFC 3339). Default now. The range is at most 400 days.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "automation_id": {
                      "type": "string"
                    },
                    "from": {
                      "type": "string"
                    },
                    "to": {
                      "type": "string"
                    },
                    "runs": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "number"
                        },
                        "running": {
                          "type": "number"
                        },
                        "completed": {
                          "type": "number"
                        },
                        "failed": {
                          "type": "number"
                        },
                        "cancelled": {
                          "type": "number"
                        },
                        "skipped": {
                          "type": "number"
                        },
                        "quota_exceeded": {
                          "type": "number"
                        }
                      }
                    },
                    "runs_daily": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "date": {
                            "type": "string"
                          },
                          "running": {
                            "type": "number"
                          },
                          "completed": {
                            "type": "number"
                          },
                          "failed": {
                            "type": "number"
                          },
                          "cancelled": {
                            "type": "number"
                          },
                          "skipped": {
                            "type": "number"
                          }
                        }
                      }
                    },
                    "steps": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "key": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "executions": {
                            "type": "number"
                          },
                          "completed": {
                            "type": "number"
                          },
                          "skipped": {
                            "type": "number"
                          },
                          "failed": {
                            "type": "number"
                          },
                          "waiting": {
                            "type": "number"
                          },
                          "avg_runtime_seconds": {},
                          "condition_met": {
                            "type": "number"
                          },
                          "condition_not_met": {
                            "type": "number"
                          },
                          "event_received": {
                            "type": "number"
                          },
                          "timed_out": {
                            "type": "number"
                          }
                        }
                      }
                    },
                    "delivery": {
                      "type": "object",
                      "properties": {
                        "emails": {
                          "type": "number"
                        },
                        "delivered": {
                          "type": "number"
                        },
                        "opened": {
                          "type": "number"
                        },
                        "clicked": {
                          "type": "number"
                        },
                        "bounced": {
                          "type": "number"
                        },
                        "complained": {
                          "type": "number"
                        },
                        "failed": {
                          "type": "number"
                        },
                        "deliverability_rate": {
                          "type": "number"
                        }
                      }
                    },
                    "delivery_daily": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "date": {
                            "type": "string"
                          },
                          "emails": {
                            "type": "number"
                          },
                          "delivered": {
                            "type": "number"
                          },
                          "opened": {
                            "type": "number"
                          },
                          "clicked": {
                            "type": "number"
                          },
                          "bounced": {
                            "type": "number"
                          },
                          "complained": {
                            "type": "number"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "automation_metrics",
                  "automation_id": "5b0f6f2e-3c1d-4a8e-9f7b-2d6c8e1a4b90",
                  "from": "2026-09-30T09:12:44Z",
                  "to": "2026-10-07T09:12:44Z",
                  "runs": {
                    "total": 420,
                    "running": 42,
                    "completed": 360,
                    "failed": 3,
                    "cancelled": 10,
                    "skipped": 5,
                    "quota_exceeded": 0
                  },
                  "runs_daily": [
                    {
                      "date": "2026-10-06",
                      "running": 6,
                      "completed": 51,
                      "failed": 0,
                      "cancelled": 1,
                      "skipped": 1
                    }
                  ],
                  "steps": [
                    {
                      "key": "welcome",
                      "type": "send_email",
                      "executions": 412,
                      "completed": 410,
                      "skipped": 2,
                      "failed": 0,
                      "waiting": 0,
                      "avg_runtime_seconds": null,
                      "condition_met": 0,
                      "condition_not_met": 0,
                      "event_received": 0,
                      "timed_out": 0
                    }
                  ],
                  "delivery": {
                    "emails": 410,
                    "delivered": 401,
                    "opened": 220,
                    "clicked": 61,
                    "bounced": 4,
                    "complained": 0,
                    "failed": 5,
                    "deliverability_rate": 0.978
                  },
                  "delivery_daily": [
                    {
                      "date": "2026-10-06",
                      "emails": 58,
                      "delivered": 57,
                      "opened": 30,
                      "clicked": 9,
                      "bounced": 1,
                      "complained": 0
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/automation-templates": {
      "get": {
        "operationId": "listAutomationTemplates",
        "summary": "List automation templates",
        "description": "Prebuilt automations with their emails, owned by send.io. Using one (POST /automations/from-template) copies it into your team as a normal automation.\n\n- send.io extension. `exists` says whether your team already has the event; `in_use_count` is how many of your automations were made from the template.",
        "tags": [
          "Automations"
        ],
        "x-docs-ids": [
          "list-automation-templates"
        ],
        "parameters": [
          {
            "name": "category",
            "in": "query",
            "required": false,
            "description": "onboarding, billing, ecommerce, engagement, lead_capture, appointments, events, education, account, nonprofit or internal.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "categories": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "object": {
                            "type": "string"
                          },
                          "slug": {
                            "type": "string"
                          },
                          "version": {
                            "type": "number"
                          },
                          "name": {
                            "type": "string"
                          },
                          "category": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string"
                          },
                          "outcome": {
                            "type": "string"
                          },
                          "events": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "ref": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                },
                                "purpose": {
                                  "type": "string"
                                },
                                "exists": {
                                  "type": "boolean"
                                }
                              }
                            }
                          },
                          "email_count": {
                            "type": "number"
                          },
                          "steps": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "key": {
                                  "type": "string"
                                },
                                "type": {
                                  "type": "string"
                                }
                              }
                            }
                          },
                          "connections": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "from": {
                                  "type": "string"
                                },
                                "to": {
                                  "type": "string"
                                },
                                "type": {
                                  "type": "string"
                                }
                              }
                            }
                          },
                          "in_use_count": {
                            "type": "number"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "categories": [
                    "onboarding",
                    "billing",
                    "ecommerce",
                    "engagement",
                    "lead_capture",
                    "appointments",
                    "events",
                    "education",
                    "account",
                    "nonprofit",
                    "internal"
                  ],
                  "data": [
                    {
                      "object": "automation_template",
                      "slug": "email-verification-reminder",
                      "version": 1,
                      "name": "Email verification reminder",
                      "category": "onboarding",
                      "kind": "transactional",
                      "outcome": "Remind users who haven't verified their email, at most twice.",
                      "events": [
                        {
                          "ref": "trigger",
                          "name": "user.created",
                          "purpose": "Starts the automation.",
                          "exists": true
                        },
                        {
                          "ref": "verified",
                          "name": "user.email.verified",
                          "purpose": "Ends the automation for that user.",
                          "exists": false
                        }
                      ],
                      "email_count": 2,
                      "steps": [
                        {
                          "key": "trigger",
                          "type": "trigger"
                        },
                        {
                          "key": "wait_1",
                          "type": "wait_for_event"
                        }
                      ],
                      "connections": [
                        {
                          "from": "trigger",
                          "to": "wait_1",
                          "type": "default"
                        }
                      ],
                      "in_use_count": 1
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/automation-templates/{slug}": {
      "get": {
        "operationId": "getAutomationTemplate",
        "summary": "Retrieve an automation template",
        "description": "One template in full: its steps, emails (subject, preview, HTML, themed with your team's brand), the waits and links setup asks for, and each event's schema and status in your team.\n\n- send.io extension. A `duration` param has a default; a `url` param has none and must be given at setup.\n\n- Emails are filled with your brand (Settings › Brand: logo or name, and primary colour), as setup will create them.",
        "tags": [
          "Automations"
        ],
        "x-docs-ids": [
          "get-automation-template"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "The template's slug, for example email-verification-reminder.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "slug": {
                      "type": "string"
                    },
                    "version": {
                      "type": "number"
                    },
                    "name": {
                      "type": "string"
                    },
                    "kind": {
                      "type": "string"
                    },
                    "how_it_works": {
                      "type": "string"
                    },
                    "events": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "ref": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "schema": {
                            "type": "object"
                          },
                          "exists": {
                            "type": "boolean"
                          },
                          "adds": {
                            "type": "object"
                          }
                        }
                      }
                    },
                    "emails": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "ref": {
                            "type": "string"
                          },
                          "step_label": {
                            "type": "string"
                          },
                          "subject": {
                            "type": "string"
                          },
                          "step_key": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "params": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "ref": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "label": {
                            "type": "string"
                          },
                          "default": {
                            "type": "string"
                          },
                          "placeholder": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "automation_template",
                  "slug": "email-verification-reminder",
                  "version": 2,
                  "name": "Email verification reminder",
                  "kind": "transactional",
                  "how_it_works": "Each signup starts its own run for that user.",
                  "events": [
                    {
                      "ref": "verified",
                      "name": "user.email.verified",
                      "schema": {},
                      "exists": false,
                      "adds": {}
                    }
                  ],
                  "emails": [
                    {
                      "ref": "reminder_1",
                      "step_label": "Reminder 1",
                      "subject": "Confirm your email to finish signing up",
                      "step_key": "email_1"
                    }
                  ],
                  "params": [
                    {
                      "ref": "wait_1",
                      "type": "duration",
                      "label": "First reminder if not verified within",
                      "default": "24 hours"
                    },
                    {
                      "ref": "resend_url",
                      "type": "url",
                      "label": "Link to get a new verification email",
                      "default": "",
                      "placeholder": "https://app.example.com/verify-email"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/automations/from-template": {
      "post": {
        "operationId": "createAutomationFromTemplate",
        "summary": "Create an automation from a template",
        "description": "Sets up a template in one transaction: creates the events your team does not have (or adds the template's fields to ones it has), the automation's emails, and the automation, disabled. If any part fails, nothing is created.\n\n- send.io extension. Send an Idempotency-Key: a retry with the same key returns the first answer instead of a second automation.\n\n- The automation is created disabled and never started here. Event schemas are only added to: an existing field keeps its type.\n\n- The automation's emails are templates owned by the automation: not listed by GET /templates, deleted with the automation.",
        "tags": [
          "Automations"
        ],
        "x-docs-ids": [
          "create-automation-from-template"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Makes a retry safe: the same key and body within 24 hours returns the first response instead of doing the work again. A key still in use by a request that has not finished, or reused with a different body, answers 409.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "slug": {
                    "type": "string",
                    "description": "The template."
                  },
                  "version": {
                    "type": "number",
                    "description": "The version you reviewed. A newer one returns 409 template_version_changed."
                  },
                  "name": {
                    "type": "string",
                    "description": "1 to 120 characters. Default: the template's name."
                  },
                  "events": {
                    "type": "object",
                    "description": "Per event ref: {mode: \"create\" | \"existing\", name}. create (the default) uses or creates the event; existing maps the ref to an event your app already sends. A template may list apps on the event that starts it (the event's apps): connected apps whose trigger can start the automation instead. Starting from one is done in the console's setup for now: it needs the id of the workspace's connection to that app, and this API has no endpoint that lists connections.",
                    "properties": {
                      "verified": {
                        "type": "object",
                        "properties": {
                          "mode": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  },
                  "sender": {
                    "type": "object",
                    "description": "{from, reply_to?}. from must be on one of your verified sending domains.",
                    "properties": {
                      "from": {
                        "type": "string"
                      },
                      "reply_to": {
                        "type": "string"
                      }
                    }
                  },
                  "topic_id": {
                    "type": "string",
                    "description": "Required for a marketing template: the topic contacts can unsubscribe from."
                  },
                  "params": {
                    "type": "object",
                    "description": "Per param ref. A duration: a number and minutes, hours, days or weeks (1 minute to 90 days); its default applies when left out. A url: required, a full http or https link.",
                    "properties": {
                      "wait_1": {
                        "type": "string"
                      },
                      "wait_2": {
                        "type": "string"
                      },
                      "resend_url": {
                        "type": "string"
                      }
                    }
                  }
                },
                "required": [
                  "slug",
                  "sender"
                ]
              },
              "example": {
                "slug": "email-verification-reminder",
                "version": 2,
                "name": "Verify reminders",
                "events": {
                  "verified": {
                    "mode": "existing",
                    "name": "account.confirmed"
                  }
                },
                "sender": {
                  "from": "Acme <hello@acme.com>",
                  "reply_to": "help@acme.com"
                },
                "params": {
                  "wait_1": "24 hours",
                  "wait_2": "2 days",
                  "resend_url": "https://app.acme.com/verify-email"
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "source_template": {
                      "type": "object",
                      "properties": {
                        "slug": {
                          "type": "string"
                        },
                        "version": {
                          "type": "number"
                        },
                        "name": {
                          "type": "string"
                        }
                      }
                    },
                    "emails": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "object": {
                            "type": "string"
                          },
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "step_key": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "events_created": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "events_reused": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": {
                  "object": "automation",
                  "id": "5b0f6f2e-3c1d-4a8e-9f7b-2d6c8e1a4b90",
                  "status": "disabled",
                  "source_template": {
                    "slug": "email-verification-reminder",
                    "version": 1,
                    "name": "Email verification reminder"
                  },
                  "emails": [
                    {
                      "object": "automation_email",
                      "id": "34a080c9-b17d-4187-ad80-5af20266e535",
                      "name": "Reminder 1",
                      "status": "published",
                      "step_key": "email_1"
                    }
                  ],
                  "events_created": [
                    "user.email.verified"
                  ],
                  "events_reused": [
                    "user.created"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/automations/{id}/emails": {
      "get": {
        "operationId": "listAutomationEmails",
        "summary": "List an automation's emails",
        "description": "The automation emails the automation owns, in the order its steps send them. Edit one with PATCH /templates/{id} and publish it.\n\n- send.io extension.",
        "tags": [
          "Automations"
        ],
        "x-docs-ids": [
          "list-automation-emails"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The automation ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "object": {
                            "type": "string"
                          },
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "subject": {
                            "type": "string"
                          },
                          "preview_text": {
                            "type": "string"
                          },
                          "from": {
                            "type": "string"
                          },
                          "reply_to": {},
                          "updated_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "has_unpublished_versions": {
                            "type": "boolean"
                          },
                          "step_key": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "data": [
                    {
                      "object": "automation_email",
                      "id": "34a080c9-b17d-4187-ad80-5af20266e535",
                      "name": "Reminder 1",
                      "status": "published",
                      "subject": "Confirm your email to get started",
                      "preview_text": "One click and you are in.",
                      "from": "Acme <onboarding@acme.com>",
                      "reply_to": null,
                      "updated_at": "2026-10-07T09:20:11.004512+00:00",
                      "has_unpublished_versions": false,
                      "step_key": "email_1"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/automations/{id}/emails/{email}/insert-template": {
      "post": {
        "operationId": "insertTemplateIntoAutomationEmail",
        "summary": "Insert a template into an automation email",
        "description": "Copies a saved template's subject, preview text, body and variables into the automation email and publishes it. The email keeps its From and Reply-to; nothing stays linked.\n\n- send.io extension.",
        "tags": [
          "Automations"
        ],
        "x-docs-ids": [
          "insert-template-into-automation-email"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The automation ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "email",
            "in": "path",
            "required": true,
            "description": "The automation email's ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "template_id": {
                    "type": "string",
                    "description": "A saved template's ID or alias (not another automation email)."
                  }
                },
                "required": [
                  "template_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "copied_from": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "object": "automation_email",
                  "id": "34a080c9-b17d-4187-ad80-5af20266e535",
                  "copied_from": "a1b2c3d4-0000-4000-8000-000000000001"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/automations/{id}/emails/{email}/save-as-template": {
      "post": {
        "operationId": "saveAutomationEmailAsTemplate",
        "summary": "Save an automation email as a template",
        "description": "Copies the automation email into a new draft template in Templates. Editing one never changes the other.\n\n- send.io extension.",
        "tags": [
          "Automations"
        ],
        "x-docs-ids": [
          "save-automation-email-as-template"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The automation ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "email",
            "in": "path",
            "required": true,
            "description": "The automation email's ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "1 to 120 characters."
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "object": "template",
                  "id": "a1b2c3d4-0000-4000-8000-000000000002"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/events/send": {
      "post": {
        "operationId": "sendEvent",
        "summary": "Send an event",
        "description": "Records an event for one contact and starts any automation it triggers. Identify the contact by `contact_id` or `email` (exactly one).\n\n- If the event has a schema, payload values are converted to the schema type when the meaning is clear (\"42\" to 42); otherwise you get 422.\n\n- send.io extension: sending a name that is not defined yet defines it, with a schema inferred from the payload. The answer has `event_created: true`.\n\n- Text in the payload cannot contain the NUL character (\\u0000): such a payload gets 422.\n\n- A repeat of an `id` already seen returns 202 without `id` and is not processed again.\n\n- `occurred_at` sets the time the event counts for in the contact's event summary (first time, last time). Automations start when the event is received, as without it, and a run waiting for the event is not affected. A time later than the receive time is stored as the receive time.\n\n- An `occurred_at` that is not an RFC 3339 timestamp fails with 422 \"occurred_at must be an RFC 3339 timestamp.\"; one more than 7 days old with 422 \"occurred_at must be within the last 7 days; use POST /events/import for older history.\"",
        "tags": [
          "Events"
        ],
        "x-docs-ids": [
          "send-event"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "event": {
                    "type": "string",
                    "description": "The event name. Letters, digits, dot, colon, dash and underscore, 1 to 100 characters. `name` is accepted as an alias."
                  },
                  "contact_id": {
                    "type": "string",
                    "description": "The contact's ID. Use this or `email`."
                  },
                  "email": {
                    "type": "string",
                    "description": "The contact's email. An unknown email creates the contact. Use this or `contact_id`."
                  },
                  "payload": {
                    "type": "object",
                    "description": "Event data, usable in automations as event.<field>. At most 100 keys and 64 KB.",
                    "properties": {
                      "first_name": {
                        "type": "string"
                      },
                      "plan": {
                        "type": "string"
                      },
                      "trial_ends_at": {
                        "type": "string"
                      }
                    }
                  },
                  "id": {
                    "type": "string",
                    "description": "send.io extension. Your own ID for this event (max 200 characters). Sending the same id again does nothing, so retries are safe."
                  },
                  "occurred_at": {
                    "type": "string",
                    "description": "send.io extension. When the event happened, as an RFC 3339 timestamp (2026-11-10T10:00:00Z), for an event you deliver late. At most 7 days in the past. Defaults to the time send.io receives the event."
                  }
                },
                "required": [
                  "event"
                ]
              },
              "example": {
                "event": "user.created",
                "email": "jane@acme.com",
                "payload": {
                  "first_name": "Jane",
                  "plan": "pro",
                  "trial_ends_at": "2026-10-21T00:00:00Z"
                },
                "id": "signup-8812",
                "occurred_at": "2026-10-07T09:10:00Z"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "event_created": {
                      "type": "boolean",
                      "description": "send.io extension. true when no event had this name, so this send created it. A `message` then says so: check the name for a typo."
                    },
                    "object": {
                      "type": "string"
                    },
                    "event": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "object": "event",
                  "event": "user.created",
                  "id": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
                  "event_created": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/events/import": {
      "post": {
        "operationId": "importEvents",
        "summary": "Import event history",
        "description": "Loads the history of events that happened before you started sending them, one item per contact and event: when it last happened and, optionally, when it first happened and how many times. It only writes the contact's event summary: no automation starts, no webhook is sent and no contact is created.\n\n- send.io extension. For workspace Admins and API keys; a workspace Member gets 403 `invalid_permission`.\n\n- An item whose contact does not exist is not imported: it is listed in `skipped` with its position in `events` (from 0) and the reason `contact_not_found`, and the other items are imported.\n\n- A malformed item fails the whole request with 422 `validation_error`, naming it (\"events[3]: last_at must not be in the future.\"), and nothing is imported.\n\n- Imported history is kept apart from the events you send, and the summary is both together: the earlier first time, the later last time, the sum of the counts. Importing a contact and event again replaces what was imported for them before, so a repeated request changes nothing and a wrong import is corrected by a second one. When one request names the same contact and event twice, the later item wins.",
        "tags": [
          "Events"
        ],
        "x-docs-ids": [
          "import-events"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "events": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "event": {
                          "type": "string",
                          "description": "The event name. Letters, digits, dot, colon, dash and underscore, 1 to 100 characters. A name that is not defined yet is defined, without a schema."
                        },
                        "contact_id": {
                          "type": "string",
                          "description": "The contact's ID (a UUID). Use this or `email`, exactly one."
                        },
                        "email": {
                          "type": "string",
                          "description": "The contact's email. Use this or `contact_id`, exactly one."
                        },
                        "last_at": {
                          "type": "string",
                          "description": "When the event last happened: an RFC 3339 timestamp (2025-03-02T10:00:00Z), a time without a zone (2025-03-02T10:00:00, read as UTC) or a day (2025-03-02, read as 00:00 UTC). Not in the future."
                        },
                        "first_at": {
                          "type": "string",
                          "description": "When the event first happened, in the same formats. Not after `last_at`. Defaults to `last_at`."
                        },
                        "count": {
                          "type": "number",
                          "description": "How many times the event happened: a whole number of at least 1. Defaults to 1."
                        }
                      },
                      "required": [
                        "event",
                        "last_at"
                      ]
                    },
                    "description": "1 to 1,000 items. Send more in further requests."
                  }
                },
                "required": [
                  "events"
                ]
              },
              "example": {
                "events": [
                  {
                    "event": "user.logged_in",
                    "email": "jane@acme.com",
                    "last_at": "2025-03-02T10:00:00Z",
                    "first_at": "2024-01-05",
                    "count": 41
                  },
                  {
                    "event": "order.paid",
                    "contact_id": "e4c1b2a3-5d6f-4a7b-8c9d-0e1f2a3b4c5d",
                    "last_at": "2025-06-18"
                  },
                  {
                    "event": "user.logged_in",
                    "email": "nobody@acme.com",
                    "last_at": "2025-02-11"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "imported": {
                      "type": "number"
                    },
                    "skipped": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "index": {
                            "type": "number"
                          },
                          "reason": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "event_import",
                  "imported": 2,
                  "skipped": [
                    {
                      "index": 2,
                      "reason": "contact_not_found"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/events": {
      "post": {
        "operationId": "createEvent",
        "summary": "Create an event",
        "description": "Defines an event name and, optionally, the types of its payload fields.\n\n- Names are case-insensitive. Creating a name that already exists, in any letter case, returns 409 `conflict`, unless it was only defined by sending (then your schema replaces the inferred one).",
        "tags": [
          "Events"
        ],
        "x-docs-ids": [
          "create-event"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Letters, digits, dot, colon, dash and underscore, 1 to 100 characters."
                  },
                  "schema": {
                    "type": "object",
                    "description": "Flat map of field name to type: string, number, boolean or date. Field names use letters, digits and underscore (max 50). At most 100 fields.",
                    "properties": {
                      "order_id": {
                        "type": "string"
                      },
                      "amount": {
                        "type": "string"
                      },
                      "paid_at": {
                        "type": "string"
                      }
                    }
                  }
                },
                "required": [
                  "name"
                ]
              },
              "example": {
                "name": "order.paid",
                "schema": {
                  "order_id": "string",
                  "amount": "number",
                  "paid_at": "date"
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "object": "event",
                  "id": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "get": {
        "operationId": "listEvents",
        "summary": "List events",
        "description": "Lists the team's event definitions, newest first.\n\n- `last_received_at` and `count_7d` are send.io extensions.",
        "tags": [
          "Events"
        ],
        "x-docs-ids": [
          "list-events"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "1 to 100. Without it, all events are returned.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "Return items after this event ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "description": "Return items before this event ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "schema": {
                            "type": "object",
                            "properties": {
                              "order_id": {
                                "type": "string"
                              },
                              "amount": {
                                "type": "string"
                              },
                              "paid_at": {
                                "type": "string"
                              }
                            }
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updated_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "last_received_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "count_7d": {
                            "type": "number"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "has_more": false,
                  "data": [
                    {
                      "id": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
                      "name": "order.paid",
                      "schema": {
                        "order_id": "string",
                        "amount": "number",
                        "paid_at": "date"
                      },
                      "created_at": "2026-10-07T09:12:44.123456+00:00",
                      "updated_at": "2026-10-07T09:12:44.123456+00:00",
                      "last_received_at": "2026-10-07T09:12:44.123456+00:00",
                      "count_7d": 1532
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/events/{id}": {
      "get": {
        "operationId": "getEvent",
        "summary": "Retrieve an event",
        "description": "Returns one event definition, by ID or by name.",
        "tags": [
          "Events"
        ],
        "x-docs-ids": [
          "get-event"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The event ID or its name.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "schema": {
                      "type": "object",
                      "properties": {
                        "order_id": {
                          "type": "string"
                        },
                        "amount": {
                          "type": "string"
                        },
                        "paid_at": {
                          "type": "string"
                        }
                      }
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "object": "event",
                  "id": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
                  "name": "order.paid",
                  "schema": {
                    "order_id": "string",
                    "amount": "number",
                    "paid_at": "date"
                  },
                  "created_at": "2026-10-07T09:12:44.123456+00:00",
                  "updated_at": "2026-10-07T09:12:44.123456+00:00"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "patch": {
        "operationId": "updateEvent",
        "summary": "Update an event",
        "description": "Replaces the event's schema. Send `schema: null` to remove it.",
        "tags": [
          "Events"
        ],
        "x-docs-ids": [
          "update-event"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The event ID or its name.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "schema": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "description": "The new schema (field name to string, number, boolean or date), or null.",
                    "properties": {
                      "order_id": {
                        "type": "string"
                      },
                      "amount": {
                        "type": "string"
                      },
                      "currency": {
                        "type": "string"
                      }
                    }
                  }
                },
                "required": [
                  "schema"
                ]
              },
              "example": {
                "schema": {
                  "order_id": "string",
                  "amount": "number",
                  "currency": "string"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "object": "event",
                  "id": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "delete": {
        "operationId": "deleteEvent",
        "summary": "Delete an event",
        "description": "Deletes an event definition.\n\n- Events already received are kept until they are 7 days old, then deleted. They no longer count: if the name is defined again, its count and recent events start from 0.",
        "tags": [
          "Events"
        ],
        "x-docs-ids": [
          "delete-event"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The event ID or its name.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "deleted": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "object": "event",
                  "id": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
                  "deleted": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/events/{id}/recent": {
      "get": {
        "operationId": "listRecentEvents",
        "summary": "List recent events",
        "description": "Returns the last 20 events received with this name, with their payloads. Handy for building and testing automations.\n\n- send.io extension. Not paginated.\n\n- An event name that is not defined returns 404. Only events received since the event was defined are listed.",
        "tags": [
          "Events"
        ],
        "x-docs-ids": [
          "list-recent-events"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The event ID or its name.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "contact_id": {
                            "type": "string"
                          },
                          "email": {
                            "type": "string"
                          },
                          "payload": {
                            "type": "object",
                            "properties": {
                              "order_id": {
                                "type": "string"
                              },
                              "amount": {
                                "type": "number"
                              },
                              "paid_at": {
                                "type": "string"
                              }
                            }
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "data": [
                    {
                      "id": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
                      "contact_id": "e4c1b2a3-5d6f-4a7b-8c9d-0e1f2a3b4c5d",
                      "email": "jane@acme.com",
                      "payload": {
                        "order_id": "ord_1029",
                        "amount": 49,
                        "paid_at": "2026-10-07T09:12:44Z"
                      },
                      "created_at": "2026-10-07T09:12:44.123456+00:00"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/mailboxes": {
      "get": {
        "operationId": "listMailboxes",
        "summary": "List mailboxes",
        "description": "Lists the team's mailboxes with 30-day sending stats and a health rating, most recently used first.\n\n- Not paginated.\n\n- Sending from an address with `POST /emails` adds a mailbox for it here if it is not listed yet (a verified domain, any local part). Addresses on send.io test domains are not added.\n\n- `sent`, `delivered`, `bounced` and `complained` cover the last 30 days; `sent_total` is all time.\n\n- `health` is no_data, healthy, at_risk (bounces at or above 2%) or poor (bounces at or above 5% or complaints at or above 0.1%).\n\n- `imap_smtp` is ready, pending (being set up) or retrying.\n\n- `can_send` says whether POST /emails accepts the address as `from` right now, by the same rule the send applies: a verified sending domain, your own agent or free mailbox, free sending on, not paused, under the daily cap. When it is false, `send_reason` says why in a short line.",
        "tags": [
          "Mailboxes"
        ],
        "x-docs-ids": [
          "list-mailboxes"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "agent_inbox_id": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The agent inbox on this address, or null when there is none."
                          },
                          "kind": {
                            "type": "string",
                            "description": "normal, or agent for a free mailbox or an agent inbox's mailbox."
                          },
                          "imap_smtp": {
                            "type": "string",
                            "description": "ready, pending (being set up), retrying, or unavailable (free mailboxes have no IMAP or SMTP login)."
                          },
                          "domain_id": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The domain the address is on."
                          },
                          "domain": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "That domain's name."
                          },
                          "last_sent_at": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "When the mailbox last sent; null when it never has.",
                            "format": "date-time"
                          },
                          "can_send": {
                            "type": "boolean",
                            "description": "Whether POST /emails accepts the address as `from` right now."
                          },
                          "send_eligible": {
                            "type": "boolean",
                            "description": "Whether the address can send at all. False only for reasons that do not clear by themselves, such as a domain that is not verified. A paused mailbox or a reached daily cap keeps it true and sets `can_send` to false."
                          },
                          "send_code": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The error name POST /emails would answer with (for example `receive_only`, `sending_paused` or `daily_limit`); null when `can_send` is true."
                          },
                          "send_reason": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Why it cannot send, in a short line; null when `can_send` is true."
                          },
                          "pool": {
                            "type": "boolean",
                            "description": "Free mailboxes only: always true."
                          },
                          "origin": {
                            "type": "string",
                            "description": "Free mailboxes only: claimed (claimed from an agent key) or workspace (made by the workspace)."
                          },
                          "free_claimed": {
                            "type": "boolean",
                            "description": "Free mailboxes only: true when it was claimed from an agent key."
                          },
                          "free_claimed_at": {
                            "type": "string",
                            "description": "Free mailboxes only: when it became the workspace's.",
                            "format": "date-time"
                          },
                          "receive_only": {
                            "type": "boolean",
                            "description": "Free mailboxes only: true while free mailboxes can receive but not send."
                          },
                          "sending": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "description": "Free mailboxes only: `status` (enabled, paused or disabled), `reason` when paused, `sent_today` and `daily_limit`."
                          },
                          "id": {
                            "type": "string"
                          },
                          "object": {
                            "type": "string"
                          },
                          "address": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "sent": {
                            "type": "number"
                          },
                          "sent_total": {
                            "type": "number"
                          },
                          "delivered": {
                            "type": "number"
                          },
                          "bounced": {
                            "type": "number"
                          },
                          "complained": {
                            "type": "number"
                          },
                          "health": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "object": {
                      "type": "string"
                    },
                    "has_more": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "has_more": false,
                  "data": [
                    {
                      "agent_inbox_id": null,
                      "id": "7f3a9c2e-1b4d-4e6f-a8c0-2d4e6f8a0b1c",
                      "object": "mailbox",
                      "address": "sales@acme.com",
                      "kind": "normal",
                      "imap_smtp": "ready",
                      "domain_id": "4ef9a417-02e9-4d39-ad75-9611e0fcc33c",
                      "domain": "acme.com",
                      "created_at": "2026-10-07T09:12:44.123456+00:00",
                      "sent": 1240,
                      "sent_total": 5310,
                      "delivered": 1218,
                      "bounced": 9,
                      "complained": 0,
                      "last_sent_at": "2026-10-07T09:12:44.123456+00:00",
                      "health": "healthy",
                      "can_send": true,
                      "send_eligible": true,
                      "send_code": null,
                      "send_reason": null
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "post": {
        "operationId": "createMailbox",
        "summary": "Create a mailbox",
        "description": "Adds a mailbox on a verified domain. The IMAP/SMTP password is returned once, in `credentials`.\n\n- The domain must be verified (or partially verified). An address that already exists returns 409.\n\n- The password is also an API key for this mailbox, limited to sending from its domain. Store it safely; it is not shown again.\n\n- If IMAP/SMTP setup is delayed, `credentials` is missing and `imap_smtp` is pending. Use the password reset endpoint to get a password later.",
        "tags": [
          "Mailboxes"
        ],
        "x-docs-ids": [
          "create-mailbox"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "address": {
                    "type": "string",
                    "description": "The full address. Or send `local_part` and `domain_id`."
                  },
                  "local_part": {
                    "type": "string",
                    "description": "The part before the @. Use with `domain_id`."
                  },
                  "domain_id": {
                    "type": "string",
                    "description": "The domain ID. Use with `local_part`."
                  }
                }
              },
              "example": {
                "address": "sales@acme.com"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "agent_inbox_id": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The agent inbox on this address, or null when there is none."
                    },
                    "kind": {
                      "type": "string",
                      "description": "normal, or agent for a free mailbox or an agent inbox's mailbox."
                    },
                    "imap_smtp": {
                      "type": "string",
                      "description": "ready, pending (being set up), retrying, or unavailable (free mailboxes have no IMAP or SMTP login)."
                    },
                    "domain_id": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The domain the address is on."
                    },
                    "domain": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "That domain's name."
                    },
                    "last_sent_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "When the mailbox last sent; null when it never has.",
                      "format": "date-time"
                    },
                    "can_send": {
                      "type": "boolean",
                      "description": "Whether POST /emails accepts the address as `from` right now."
                    },
                    "send_eligible": {
                      "type": "boolean",
                      "description": "Whether the address can send at all. False only for reasons that do not clear by themselves, such as a domain that is not verified. A paused mailbox or a reached daily cap keeps it true and sets `can_send` to false."
                    },
                    "send_code": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The error name POST /emails would answer with (for example `receive_only`, `sending_paused` or `daily_limit`); null when `can_send` is true."
                    },
                    "send_reason": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Why it cannot send, in a short line; null when `can_send` is true."
                    },
                    "pool": {
                      "type": "boolean",
                      "description": "Free mailboxes only: always true."
                    },
                    "origin": {
                      "type": "string",
                      "description": "Free mailboxes only: claimed (claimed from an agent key) or workspace (made by the workspace)."
                    },
                    "free_claimed": {
                      "type": "boolean",
                      "description": "Free mailboxes only: true when it was claimed from an agent key."
                    },
                    "free_claimed_at": {
                      "type": "string",
                      "description": "Free mailboxes only: when it became the workspace's.",
                      "format": "date-time"
                    },
                    "receive_only": {
                      "type": "boolean",
                      "description": "Free mailboxes only: true while free mailboxes can receive but not send."
                    },
                    "sending": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "Free mailboxes only: `status` (enabled, paused or disabled), `reason` when paused, `sent_today` and `daily_limit`."
                    },
                    "id": {
                      "type": "string"
                    },
                    "object": {
                      "type": "string"
                    },
                    "address": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "sent": {
                      "type": "number"
                    },
                    "sent_total": {
                      "type": "number"
                    },
                    "delivered": {
                      "type": "number"
                    },
                    "bounced": {
                      "type": "number"
                    },
                    "complained": {
                      "type": "number"
                    },
                    "health": {
                      "type": "string"
                    },
                    "credentials": {
                      "type": "object",
                      "properties": {
                        "username": {
                          "type": "string"
                        },
                        "password": {
                          "type": "string"
                        },
                        "imap": {
                          "type": "object",
                          "properties": {
                            "host": {
                              "type": "string"
                            },
                            "port": {
                              "type": "number"
                            },
                            "security": {
                              "type": "string"
                            }
                          }
                        },
                        "smtp": {
                          "type": "object",
                          "properties": {
                            "host": {
                              "type": "string"
                            },
                            "port": {
                              "type": "number"
                            },
                            "security": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "agent_inbox_id": null,
                  "id": "7f3a9c2e-1b4d-4e6f-a8c0-2d4e6f8a0b1c",
                  "object": "mailbox",
                  "address": "sales@acme.com",
                  "kind": "normal",
                  "imap_smtp": "ready",
                  "domain_id": "4ef9a417-02e9-4d39-ad75-9611e0fcc33c",
                  "domain": "acme.com",
                  "created_at": "2026-10-07T09:12:44.123456+00:00",
                  "sent": 0,
                  "sent_total": 0,
                  "delivered": 0,
                  "bounced": 0,
                  "complained": 0,
                  "last_sent_at": null,
                  "health": "no_data",
                  "can_send": true,
                  "send_eligible": true,
                  "send_code": null,
                  "send_reason": null,
                  "credentials": {
                    "username": "sales@acme.com",
                    "password": "mx_9f8e7d6c5b4a39281706f5e4d3c2b1a0",
                    "imap": {
                      "host": "imap.send.io",
                      "port": 993,
                      "security": "ssl"
                    },
                    "smtp": {
                      "host": "smtp.send.io",
                      "port": 587,
                      "security": "starttls"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/mailboxes/{id}": {
      "delete": {
        "operationId": "deleteMailbox",
        "summary": "Delete a mailbox",
        "description": "Deletes the mailbox. IMAP and SMTP stop within a minute, its API key is revoked, and an agent inbox on it is deleted too.\n\n- Returns 503 if the mail servers cannot be reached; nothing is deleted then. Try again in a minute.",
        "tags": [
          "Mailboxes"
        ],
        "x-docs-ids": [
          "delete-mailbox"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The mailbox ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "deleted": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "object": "mailbox",
                  "id": "7f3a9c2e-1b4d-4e6f-a8c0-2d4e6f8a0b1c",
                  "deleted": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/mailboxes/{id}/password": {
      "post": {
        "operationId": "resetMailboxPassword",
        "summary": "Reset a mailbox password",
        "description": "Sets a new IMAP/SMTP password and returns it once. The old password stops working.\n\n- The new password is a new API key for the mailbox; the old key is revoked.",
        "tags": [
          "Mailboxes"
        ],
        "x-docs-ids": [
          "reset-mailbox-password"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The mailbox ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "address": {
                      "type": "string"
                    },
                    "credentials": {
                      "type": "object",
                      "properties": {
                        "username": {
                          "type": "string"
                        },
                        "password": {
                          "type": "string"
                        },
                        "imap": {
                          "type": "object",
                          "properties": {
                            "host": {
                              "type": "string"
                            },
                            "port": {
                              "type": "number"
                            },
                            "security": {
                              "type": "string"
                            }
                          }
                        },
                        "smtp": {
                          "type": "object",
                          "properties": {
                            "host": {
                              "type": "string"
                            },
                            "port": {
                              "type": "number"
                            },
                            "security": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "note": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "object": "mailbox_credentials",
                  "id": "7f3a9c2e-1b4d-4e6f-a8c0-2d4e6f8a0b1c",
                  "address": "sales@acme.com",
                  "credentials": {
                    "username": "sales@acme.com",
                    "password": "mx_9f8e7d6c5b4a39281706f5e4d3c2b1a0",
                    "imap": {
                      "host": "imap.send.io",
                      "port": 993,
                      "security": "ssl"
                    },
                    "smtp": {
                      "host": "smtp.send.io",
                      "port": 587,
                      "security": "starttls"
                    }
                  },
                  "note": "The password is also this mailbox's API key. IMAP and SMTP accept it within about a minute."
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/inboxes": {
      "post": {
        "operationId": "createInbox",
        "summary": "Create an inbox",
        "description": "Creates an inbox. With no domain it is a free mailbox on your workspace's sendiomail.com address; with no username a random one is picked. An inbox on your own domain or the shared agent domain also returns IMAP/SMTP credentials once.\n\n- On the shared agent domain, reserved usernames (abuse, postmaster, support, admin, noreply and similar) are refused. A free mailbox's org label and a company subdomain belong to your workspace alone, so there only mail-system names (abuse, postmaster, hostmaster, webmaster, mailer-daemon, root) are refused.\n\n- A taken address returns 409. An unverified domain returns 403.\n\n- `credentials` (an IMAP/SMTP login; the password is an API key scoped to this inbox, shown only once) is returned for an inbox on your own domain or the shared agent domain. A free mailbox has no IMAP or SMTP login: it has no `credentials` and its `imap_smtp` is `unavailable`. Use the API, MCP or the Unibox with it.\n\n- Use GET /agent-domain to find the shared agent domain and the free mailbox domain.\n\n- Which free domain is which: name@<org>.sendiomail.com is your workspace's free mailbox, made here when you give no domain (GET /agent-domain returns it as `free_mailbox_domain`). name@org.sendioinbox.com is the no-signup agent mailbox (/docs/agent-mailbox), made with no account and sealed to its key; claimed into a workspace it keeps its sendioinbox.com address and counts as one of the workspace's free mailboxes.",
        "tags": [
          "Inboxes"
        ],
        "x-docs-ids": [
          "create-inbox"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "username": {
                    "type": "string",
                    "description": "On a free mailbox (the default, no `domain` given): a-z, 0-9, dot and dash, 2 to 32 characters, not starting or ending with a dot or dash. On your own domain or the shared agent domain: a-z, 0-9, dot, dash, underscore and plus, 1 to 64 characters. Random when left out."
                  },
                  "domain": {
                    "type": "string",
                    "description": "Leave it out for a free mailbox at name@<org>.sendiomail.com (the label is your workspace's own; free mailboxes have no IMAP or SMTP login). Or give a domain verified for sending on your team, the shared agent domain (agents.send.io), or a company subdomain of it (acme.agents.send.io). GET /agent-domain names both domains."
                  },
                  "display_name": {
                    "type": "string",
                    "description": "The name shown in the From header."
                  },
                  "client_id": {
                    "type": "string",
                    "description": "Your own ID. If an inbox with this client_id exists, it is returned instead of creating a new one."
                  },
                  "pod_id": {
                    "type": "string",
                    "description": "Put the inbox in this pod."
                  }
                }
              },
              "example": {
                "username": "support-bot",
                "domain": "acme.com",
                "display_name": "Acme Support",
                "client_id": "support-bot-1"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "object": {
                      "type": "string"
                    },
                    "address": {
                      "type": "string"
                    },
                    "display_name": {
                      "type": "string"
                    },
                    "client_id": {
                      "type": "string"
                    },
                    "pod_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "metadata": {},
                    "message_ttl_hours": {},
                    "demo_expires_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    },
                    "auto_reply": {
                      "type": "boolean"
                    },
                    "domain": {
                      "type": "string"
                    },
                    "mailbox_id": {
                      "type": "string"
                    },
                    "imap_smtp": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "threads": {
                      "type": "number"
                    },
                    "unread": {
                      "type": "number"
                    },
                    "pending_drafts": {
                      "type": "number"
                    },
                    "last_message_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    },
                    "credentials": {
                      "type": "object",
                      "properties": {
                        "username": {
                          "type": "string"
                        },
                        "password": {
                          "type": "string"
                        },
                        "imap": {
                          "type": "object",
                          "properties": {
                            "host": {
                              "type": "string"
                            },
                            "port": {
                              "type": "number"
                            },
                            "security": {
                              "type": "string"
                            }
                          }
                        },
                        "smtp": {
                          "type": "object",
                          "properties": {
                            "host": {
                              "type": "string"
                            },
                            "port": {
                              "type": "number"
                            },
                            "security": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
                  "object": "inbox",
                  "address": "support-bot@acme.com",
                  "display_name": "Acme Support",
                  "client_id": "support-bot-1",
                  "pod_id": null,
                  "metadata": null,
                  "message_ttl_hours": null,
                  "demo_expires_at": null,
                  "auto_reply": false,
                  "domain": "acme.com",
                  "mailbox_id": "7f3a9c2e-1b4d-4e6f-a8c0-2d4e6f8a0b1c",
                  "imap_smtp": "ready",
                  "created_at": "2026-10-07T09:12:44.123456+00:00",
                  "updated_at": "2026-10-07T09:12:44.123456+00:00",
                  "threads": 0,
                  "unread": 0,
                  "pending_drafts": 0,
                  "last_message_at": null,
                  "credentials": {
                    "username": "support-bot@acme.com",
                    "password": "mx_9f8e7d6c5b4a39281706f5e4d3c2b1a0",
                    "imap": {
                      "host": "imap.send.io",
                      "port": 993,
                      "security": "ssl"
                    },
                    "smtp": {
                      "host": "smtp.send.io",
                      "port": 587,
                      "security": "starttls"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "get": {
        "operationId": "listInboxes",
        "summary": "List inboxes",
        "description": "Lists the team's inboxes, newest first, with thread and unread counts.\n\n- Not paginated (up to 1,000 inboxes).\n\n- A key limited to an inbox or pod sees only that inbox or pod.",
        "tags": [
          "Inboxes"
        ],
        "x-docs-ids": [
          "list-inboxes"
        ],
        "parameters": [
          {
            "name": "pod_id",
            "in": "query",
            "required": false,
            "description": "Only inboxes in this pod.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "object": {
                            "type": "string"
                          },
                          "address": {
                            "type": "string"
                          },
                          "display_name": {
                            "type": "string"
                          },
                          "client_id": {
                            "type": "string"
                          },
                          "pod_id": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "metadata": {},
                          "message_ttl_hours": {},
                          "demo_expires_at": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date-time"
                          },
                          "auto_reply": {
                            "type": "boolean"
                          },
                          "domain": {
                            "type": "string"
                          },
                          "mailbox_id": {
                            "type": "string"
                          },
                          "imap_smtp": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updated_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "threads": {
                            "type": "number"
                          },
                          "unread": {
                            "type": "number"
                          },
                          "pending_drafts": {
                            "type": "number"
                          },
                          "last_message_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "data": [
                    {
                      "id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
                      "object": "inbox",
                      "address": "support-bot@acme.com",
                      "display_name": "Acme Support",
                      "client_id": "support-bot-1",
                      "pod_id": null,
                      "metadata": null,
                      "message_ttl_hours": null,
                      "demo_expires_at": null,
                      "auto_reply": false,
                      "domain": "acme.com",
                      "mailbox_id": "7f3a9c2e-1b4d-4e6f-a8c0-2d4e6f8a0b1c",
                      "imap_smtp": "ready",
                      "created_at": "2026-10-07T09:12:44.123456+00:00",
                      "updated_at": "2026-10-07T09:12:44.123456+00:00",
                      "threads": 12,
                      "unread": 3,
                      "pending_drafts": 1,
                      "last_message_at": "2026-10-07T09:12:44.123456+00:00"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/inboxes/{id}": {
      "get": {
        "operationId": "getInbox",
        "summary": "Retrieve an inbox",
        "description": "Returns one inbox, by ID or by address.",
        "tags": [
          "Inboxes"
        ],
        "x-docs-ids": [
          "get-inbox"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The inbox ID or its email address.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "object": {
                      "type": "string"
                    },
                    "address": {
                      "type": "string"
                    },
                    "display_name": {
                      "type": "string"
                    },
                    "client_id": {
                      "type": "string"
                    },
                    "pod_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "metadata": {},
                    "message_ttl_hours": {},
                    "demo_expires_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    },
                    "auto_reply": {
                      "type": "boolean"
                    },
                    "domain": {
                      "type": "string"
                    },
                    "mailbox_id": {
                      "type": "string"
                    },
                    "imap_smtp": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "threads": {
                      "type": "number"
                    },
                    "unread": {
                      "type": "number"
                    },
                    "pending_drafts": {
                      "type": "number"
                    },
                    "last_message_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
                  "object": "inbox",
                  "address": "support-bot@acme.com",
                  "display_name": "Acme Support",
                  "client_id": "support-bot-1",
                  "pod_id": null,
                  "metadata": null,
                  "message_ttl_hours": null,
                  "demo_expires_at": null,
                  "auto_reply": false,
                  "domain": "acme.com",
                  "mailbox_id": "7f3a9c2e-1b4d-4e6f-a8c0-2d4e6f8a0b1c",
                  "imap_smtp": "ready",
                  "created_at": "2026-10-07T09:12:44.123456+00:00",
                  "updated_at": "2026-10-07T09:12:44.123456+00:00",
                  "threads": 12,
                  "unread": 3,
                  "pending_drafts": 1,
                  "last_message_at": "2026-10-07T09:12:44.123456+00:00"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "patch": {
        "operationId": "updateInbox",
        "summary": "Update an inbox",
        "description": "Changes the display name or how long messages are kept.\n\n- `auto_reply` is read-only: it is true only on the onboarding demo inbox, which answers by itself. send.io never replies from your inboxes on its own: nothing is sent unless you or your agent sends it or approves a draft. Setting it to true answers 422.",
        "tags": [
          "Inboxes"
        ],
        "x-docs-ids": [
          "update-inbox"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The inbox ID or its email address.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "display_name": {
                    "type": "string",
                    "description": "Max 100 characters, without quotes, angle brackets or line breaks."
                  },
                  "message_ttl_hours": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "description": "Delete messages after this many hours (1 to 8760). 0 or null keeps them."
                  }
                }
              },
              "example": {
                "display_name": "Acme Help",
                "message_ttl_hours": 720
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "object": {
                      "type": "string"
                    },
                    "address": {
                      "type": "string"
                    },
                    "display_name": {
                      "type": "string"
                    },
                    "client_id": {
                      "type": "string"
                    },
                    "pod_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "metadata": {},
                    "message_ttl_hours": {
                      "type": "number"
                    },
                    "demo_expires_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    },
                    "auto_reply": {
                      "type": "boolean"
                    },
                    "domain": {
                      "type": "string"
                    },
                    "mailbox_id": {
                      "type": "string"
                    },
                    "imap_smtp": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "threads": {
                      "type": "number"
                    },
                    "unread": {
                      "type": "number"
                    },
                    "pending_drafts": {
                      "type": "number"
                    },
                    "last_message_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
                  "object": "inbox",
                  "address": "support-bot@acme.com",
                  "display_name": "Acme Help",
                  "client_id": "support-bot-1",
                  "pod_id": null,
                  "metadata": null,
                  "message_ttl_hours": 720,
                  "demo_expires_at": null,
                  "auto_reply": false,
                  "domain": "acme.com",
                  "mailbox_id": "7f3a9c2e-1b4d-4e6f-a8c0-2d4e6f8a0b1c",
                  "imap_smtp": "ready",
                  "created_at": "2026-10-07T09:12:44.123456+00:00",
                  "updated_at": "2026-10-07T09:12:44.123456+00:00",
                  "threads": 12,
                  "unread": 3,
                  "pending_drafts": 1,
                  "last_message_at": "2026-10-07T09:12:44.123456+00:00"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "delete": {
        "operationId": "deleteInbox",
        "summary": "Delete an inbox",
        "description": "Deletes the inbox: the address stops receiving and pending drafts are discarded. Existing threads stay readable.",
        "tags": [
          "Inboxes"
        ],
        "x-docs-ids": [
          "delete-inbox"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The inbox ID or its email address.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "keep_mailbox",
            "in": "query",
            "required": false,
            "description": "true keeps the address as a plain mailbox (IMAP/SMTP keep working). Not allowed for addresses on the shared domain.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "deleted": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "object": "inbox",
                  "id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
                  "deleted": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/inboxes/{id}/messages": {
      "get": {
        "operationId": "listInboxMessages",
        "summary": "List messages",
        "description": "Lists the inbox's newest messages, received and sent, without bodies.\n\n- `extracted_text` is the new text of a reply, without the quoted history.",
        "tags": [
          "Inboxes"
        ],
        "x-docs-ids": [
          "list-inbox-messages"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The inbox ID or its email address.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "1 to 200. Default 50.",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "object": {
                            "type": "string"
                          },
                          "direction": {
                            "type": "string"
                          },
                          "thread_id": {
                            "type": "string"
                          },
                          "from": {
                            "type": "string"
                          },
                          "to": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "subject": {
                            "type": "string"
                          },
                          "snippet": {
                            "type": "string"
                          },
                          "extracted_text": {
                            "type": "string"
                          },
                          "is_read": {
                            "type": "boolean"
                          },
                          "is_spam": {
                            "type": "boolean"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "status": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "data": [
                    {
                      "id": "2c4e6a8b-0d1f-4a3c-9e5b-7d9f1b3d5e7a",
                      "object": "message",
                      "direction": "inbound",
                      "thread_id": "f0e1d2c3-b4a5-4968-8776-655443322110",
                      "from": "jane@example.com",
                      "to": [
                        "support-bot@acme.com"
                      ],
                      "subject": "Question about my invoice",
                      "snippet": "Hi, I was charged twice this month...",
                      "extracted_text": "Hi, I was charged twice this month. Can you help?",
                      "is_read": false,
                      "is_spam": false,
                      "created_at": "2026-10-07T09:12:44.123456+00:00"
                    },
                    {
                      "id": "49a3999c-0ce1-4ea6-ab68-afcd6dc2e794",
                      "object": "message",
                      "direction": "outbound",
                      "thread_id": "f0e1d2c3-b4a5-4968-8776-655443322110",
                      "from": "support-bot@acme.com",
                      "to": [
                        "jane@example.com"
                      ],
                      "subject": "Re: Question about my invoice",
                      "status": "delivered",
                      "created_at": "2026-10-07T09:12:44.123456+00:00"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "post": {
        "operationId": "sendInboxMessage",
        "summary": "Send a message",
        "description": "Sends a new email from the inbox and starts a new thread.\n\n- The From address is the inbox (with its display name).\n\n- Recipients blocked by the inbox's send list are refused with 403.",
        "tags": [
          "Inboxes"
        ],
        "x-docs-ids": [
          "send-inbox-message"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The inbox ID or its email address.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "to": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "Recipients."
                  },
                  "subject": {
                    "type": "string",
                    "description": "The subject."
                  },
                  "cc": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "Cc recipients."
                  },
                  "bcc": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "Bcc recipients."
                  },
                  "text": {
                    "type": "string",
                    "description": "Plain text body."
                  },
                  "html": {
                    "type": "string",
                    "description": "HTML body."
                  },
                  "reply_to": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "Reply-To addresses."
                  },
                  "headers": {
                    "type": "object",
                    "description": "Custom headers."
                  },
                  "attachments": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    },
                    "description": "Attachments, as in POST /emails."
                  },
                  "tags": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    },
                    "description": "Tags, as in POST /emails."
                  },
                  "labels": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Labels for the new thread (1 to 64 characters each, max 50)."
                  }
                },
                "required": [
                  "to",
                  "subject"
                ]
              },
              "example": {
                "to": [
                  "jane@example.com"
                ],
                "subject": "Your order has shipped",
                "text": "Hi Jane, your order is on its way.",
                "labels": [
                  "orders"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "thread_id": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "id": "49a3999c-0ce1-4ea6-ab68-afcd6dc2e794",
                  "thread_id": "f0e1d2c3-b4a5-4968-8776-655443322110"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/inboxes/{id}/messages/{message}": {
      "get": {
        "operationId": "getInboxMessage",
        "summary": "Retrieve a message",
        "description": "Returns one message of the inbox with its HTML and text bodies, headers and attachment list.",
        "tags": [
          "Inboxes"
        ],
        "x-docs-ids": [
          "get-inbox-message"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The inbox ID or its email address.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "message",
            "in": "path",
            "required": true,
            "description": "The message ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "object": {
                      "type": "string"
                    },
                    "direction": {
                      "type": "string"
                    },
                    "thread_id": {
                      "type": "string"
                    },
                    "inbox_id": {
                      "type": "string"
                    },
                    "from": {
                      "type": "string"
                    },
                    "from_name": {
                      "type": "string"
                    },
                    "to": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "cc": {
                      "type": "array"
                    },
                    "reply_to": {},
                    "received_for": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "subject": {
                      "type": "string"
                    },
                    "message_id": {
                      "type": "string"
                    },
                    "in_reply_to": {},
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "is_read": {
                      "type": "boolean"
                    },
                    "is_spam": {
                      "type": "boolean"
                    },
                    "snippet": {
                      "type": "string"
                    },
                    "extracted_text": {
                      "type": "string"
                    },
                    "extracted_html": {},
                    "labels": {
                      "type": "array"
                    },
                    "trashed": {
                      "type": "boolean"
                    },
                    "size": {
                      "type": "number"
                    },
                    "references": {
                      "type": "array"
                    },
                    "headers": {
                      "type": "object"
                    },
                    "attachments": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "filename": {
                            "type": "string"
                          },
                          "content_type": {
                            "type": "string"
                          },
                          "size": {
                            "type": "number"
                          }
                        }
                      }
                    },
                    "html": {
                      "type": "string"
                    },
                    "text": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "id": "2c4e6a8b-0d1f-4a3c-9e5b-7d9f1b3d5e7a",
                  "object": "message",
                  "direction": "inbound",
                  "thread_id": "f0e1d2c3-b4a5-4968-8776-655443322110",
                  "inbox_id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
                  "from": "jane@example.com",
                  "from_name": "Jane Doe",
                  "to": [
                    "support-bot@acme.com"
                  ],
                  "cc": [],
                  "reply_to": null,
                  "received_for": [
                    "support-bot@acme.com"
                  ],
                  "subject": "Question about my invoice",
                  "message_id": "<CAF1234@mail.example.com>",
                  "in_reply_to": null,
                  "created_at": "2026-10-07T09:12:44.123456+00:00",
                  "is_read": false,
                  "is_spam": false,
                  "snippet": "Hi, I was charged twice this month...",
                  "extracted_text": "Hi, I was charged twice this month. Can you help?",
                  "extracted_html": null,
                  "labels": [],
                  "trashed": false,
                  "size": 4210,
                  "references": [],
                  "headers": {},
                  "attachments": [
                    {
                      "id": "0a2c4e6b-8d0f-4c2a-9e4b-6d8f0a2c4e6b",
                      "filename": "invoice.pdf",
                      "content_type": "application/pdf",
                      "size": 48213
                    }
                  ],
                  "html": "<p>Hi, I was charged twice this month. Can you help?</p>",
                  "text": "Hi, I was charged twice this month. Can you help?"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/inboxes/{id}/messages/{message}/attachments/{attachment}": {
      "get": {
        "operationId": "getInboxAttachment",
        "summary": "Retrieve an attachment",
        "description": "Returns an attachment's details, its extracted text when available, and a signed download link.",
        "tags": [
          "Inboxes"
        ],
        "x-docs-ids": [
          "get-inbox-attachment"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The inbox ID or its email address.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "message",
            "in": "path",
            "required": true,
            "description": "The message ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "attachment",
            "in": "path",
            "required": true,
            "description": "The attachment ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "filename": {
                      "type": "string"
                    },
                    "size": {
                      "type": "number"
                    },
                    "content_type": {
                      "type": "string"
                    },
                    "content_disposition": {
                      "type": "string"
                    },
                    "content_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "extracted_text": {
                      "type": "string"
                    },
                    "download_url": {
                      "type": "string"
                    },
                    "expires_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "object": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "id": "0a2c4e6b-8d0f-4c2a-9e4b-6d8f0a2c4e6b",
                  "filename": "invoice.pdf",
                  "size": 48213,
                  "content_type": "application/pdf",
                  "content_disposition": "attachment",
                  "content_id": null,
                  "extracted_text": "Invoice #1042 ... Total: $49.00",
                  "download_url": "https://api.send.io/download/3f9a2c...",
                  "expires_at": "2026-10-07T10:12:44Z",
                  "object": "attachment"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/inboxes/{id}/threads": {
      "get": {
        "operationId": "listInboxThreads",
        "summary": "List threads",
        "description": "Lists the inbox's threads, newest activity first.",
        "tags": [
          "Inboxes"
        ],
        "x-docs-ids": [
          "list-inbox-threads"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The inbox ID or its email address.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter",
            "in": "query",
            "required": false,
            "description": "all (the default: not archived), unread, archived or trash.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "label",
            "in": "query",
            "required": false,
            "description": "Only threads with this label.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Search subject, snippet and participants.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "description": "Only threads whose last message is older than this time (ISO 8601). Use it to page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "1 to 200. Default 50.",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "object": {
                            "type": "string"
                          },
                          "subject": {
                            "type": "string"
                          },
                          "participants": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "mailboxes": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "last_message_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "snippet": {
                            "type": "string"
                          },
                          "message_count": {
                            "type": "number"
                          },
                          "unread_count": {
                            "type": "number"
                          },
                          "archived": {
                            "type": "boolean"
                          },
                          "inbox_id": {
                            "type": "string"
                          },
                          "labels": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "trashed": {
                            "type": "boolean"
                          },
                          "participant_names": {
                            "type": "object",
                            "properties": {
                              "jane@example.com": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "data": [
                    {
                      "id": "f0e1d2c3-b4a5-4968-8776-655443322110",
                      "object": "thread",
                      "subject": "Question about my invoice",
                      "participants": [
                        "jane@example.com"
                      ],
                      "mailboxes": [
                        "support-bot@acme.com"
                      ],
                      "last_message_at": "2026-10-07T09:12:44.123456+00:00",
                      "snippet": "Hi, I was charged twice this month...",
                      "message_count": 2,
                      "unread_count": 1,
                      "archived": false,
                      "inbox_id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
                      "labels": [
                        "billing"
                      ],
                      "trashed": false,
                      "participant_names": {
                        "jane@example.com": "Jane Doe"
                      }
                    }
                  ],
                  "has_more": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/inboxes/{id}/threads/{thread}": {
      "get": {
        "operationId": "getInboxThread",
        "summary": "Retrieve a thread",
        "description": "Returns a thread of the inbox with all its messages (received and sent), oldest first, with bodies.",
        "tags": [
          "Inboxes"
        ],
        "x-docs-ids": [
          "get-inbox-thread"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The inbox ID or its email address.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "thread",
            "in": "path",
            "required": true,
            "description": "The thread ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "object": {
                      "type": "string"
                    },
                    "subject": {
                      "type": "string"
                    },
                    "participants": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "mailboxes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "last_message_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "snippet": {
                      "type": "string"
                    },
                    "message_count": {
                      "type": "number"
                    },
                    "unread_count": {
                      "type": "number"
                    },
                    "archived": {
                      "type": "boolean"
                    },
                    "inbox_id": {
                      "type": "string"
                    },
                    "labels": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "trashed": {
                      "type": "boolean"
                    },
                    "messages": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "object": {
                            "type": "string"
                          },
                          "direction": {
                            "type": "string"
                          },
                          "thread_id": {
                            "type": "string"
                          },
                          "inbox_id": {
                            "type": "string"
                          },
                          "from": {
                            "type": "string"
                          },
                          "from_name": {
                            "type": "string"
                          },
                          "to": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "cc": {
                            "type": "array"
                          },
                          "reply_to": {},
                          "received_for": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "subject": {
                            "type": "string"
                          },
                          "message_id": {
                            "type": "string"
                          },
                          "in_reply_to": {},
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "is_read": {
                            "type": "boolean"
                          },
                          "is_spam": {
                            "type": "boolean"
                          },
                          "snippet": {
                            "type": "string"
                          },
                          "extracted_text": {
                            "type": "string"
                          },
                          "extracted_html": {},
                          "labels": {
                            "type": "array"
                          },
                          "trashed": {
                            "type": "boolean"
                          },
                          "size": {
                            "type": "number"
                          },
                          "references": {
                            "type": "array"
                          },
                          "headers": {
                            "type": "object"
                          },
                          "attachments": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "filename": {
                                  "type": "string"
                                },
                                "content_type": {
                                  "type": "string"
                                },
                                "size": {
                                  "type": "number"
                                }
                              }
                            }
                          },
                          "html": {
                            "type": "string"
                          },
                          "text": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "id": "f0e1d2c3-b4a5-4968-8776-655443322110",
                  "object": "thread",
                  "subject": "Question about my invoice",
                  "participants": [
                    "jane@example.com"
                  ],
                  "mailboxes": [
                    "support-bot@acme.com"
                  ],
                  "last_message_at": "2026-10-07T09:12:44.123456+00:00",
                  "snippet": "Hi, I was charged twice this month...",
                  "message_count": 2,
                  "unread_count": 1,
                  "archived": false,
                  "inbox_id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
                  "labels": [
                    "billing"
                  ],
                  "trashed": false,
                  "messages": [
                    {
                      "id": "2c4e6a8b-0d1f-4a3c-9e5b-7d9f1b3d5e7a",
                      "object": "message",
                      "direction": "inbound",
                      "thread_id": "f0e1d2c3-b4a5-4968-8776-655443322110",
                      "inbox_id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
                      "from": "jane@example.com",
                      "from_name": "Jane Doe",
                      "to": [
                        "support-bot@acme.com"
                      ],
                      "cc": [],
                      "reply_to": null,
                      "received_for": [
                        "support-bot@acme.com"
                      ],
                      "subject": "Question about my invoice",
                      "message_id": "<CAF1234@mail.example.com>",
                      "in_reply_to": null,
                      "created_at": "2026-10-07T09:12:44.123456+00:00",
                      "is_read": false,
                      "is_spam": false,
                      "snippet": "Hi, I was charged twice this month...",
                      "extracted_text": "Hi, I was charged twice this month. Can you help?",
                      "extracted_html": null,
                      "labels": [],
                      "trashed": false,
                      "size": 4210,
                      "references": [],
                      "headers": {},
                      "attachments": [
                        {
                          "id": "0a2c4e6b-8d0f-4c2a-9e4b-6d8f0a2c4e6b",
                          "filename": "invoice.pdf",
                          "content_type": "application/pdf",
                          "size": 48213
                        }
                      ],
                      "html": "<p>Hi, I was charged twice this month. Can you help?</p>",
                      "text": "Hi, I was charged twice this month. Can you help?"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/inboxes/{id}/threads/{thread}/reply": {
      "post": {
        "operationId": "replyInboxThread",
        "summary": "Reply to a thread",
        "description": "Replies to the newest message in the thread, from the inbox. Threading headers are set for you and the reply is filed in the thread.",
        "tags": [
          "Inboxes"
        ],
        "x-docs-ids": [
          "reply-inbox-thread"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The inbox ID or its email address.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "thread",
            "in": "path",
            "required": true,
            "description": "The thread ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "text": {
                    "type": "string",
                    "description": "Plain text body. `text` or `html` is required."
                  },
                  "html": {
                    "type": "string",
                    "description": "HTML body."
                  },
                  "reply_all": {
                    "type": "boolean",
                    "description": "true copies everyone on the last message (except the inbox). Default false."
                  },
                  "to": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "Override the recipients. Default: the sender (or its Reply-To)."
                  },
                  "cc": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "Cc recipients."
                  },
                  "bcc": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "Bcc recipients."
                  }
                }
              },
              "example": {
                "text": "Hi Jane, we refunded the second charge. Sorry for the trouble."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "thread_id": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "id": "49a3999c-0ce1-4ea6-ab68-afcd6dc2e794",
                  "thread_id": "f0e1d2c3-b4a5-4968-8776-655443322110"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/inboxes/{id}/threads/{thread}/forward": {
      "post": {
        "operationId": "forwardInboxThread",
        "summary": "Forward a thread",
        "description": "Forwards the thread's newest message, quoted below your note, as a new thread.",
        "tags": [
          "Inboxes"
        ],
        "x-docs-ids": [
          "forward-inbox-thread"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The inbox ID or its email address.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "thread",
            "in": "path",
            "required": true,
            "description": "The thread ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "to": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "Recipients."
                  },
                  "cc": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "Cc recipients."
                  },
                  "text": {
                    "type": "string",
                    "description": "A note above the forwarded message."
                  }
                },
                "required": [
                  "to"
                ]
              },
              "example": {
                "to": [
                  "billing@acme.com"
                ],
                "text": "Can you check this refund?"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "thread_id": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "id": "49a3999c-0ce1-4ea6-ab68-afcd6dc2e794",
                  "thread_id": "1d3f5b7a-9c1e-4b3d-8f5a-7c9e1b3d5f7a"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/inboxes/{id}/metrics": {
      "get": {
        "operationId": "getInboxMetrics",
        "summary": "Retrieve inbox metrics",
        "description": "Sent, delivered, bounced and received counts per day, with totals.\n\n- Deleting mail does not change past numbers: a deleted sent message still counts for the inbox it was sent from. `received` counts received messages still in the inbox; a permanently deleted or expired message is no longer counted.",
        "tags": [
          "Inboxes"
        ],
        "x-docs-ids": [
          "get-inbox-metrics"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The inbox ID or its email address.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "days",
            "in": "query",
            "required": false,
            "description": "1 to 90. Default 30. Other values answer 422.",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "inbox_id": {
                      "type": "string"
                    },
                    "days": {
                      "type": "number"
                    },
                    "totals": {
                      "type": "object",
                      "properties": {
                        "sent": {
                          "type": "number"
                        },
                        "delivered": {
                          "type": "number"
                        },
                        "bounced": {
                          "type": "number"
                        },
                        "received": {
                          "type": "number"
                        }
                      }
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "date": {
                            "type": "string"
                          },
                          "sent": {
                            "type": "number"
                          },
                          "delivered": {
                            "type": "number"
                          },
                          "bounced": {
                            "type": "number"
                          },
                          "received": {
                            "type": "number"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "metrics",
                  "inbox_id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
                  "days": 30,
                  "totals": {
                    "sent": 140,
                    "delivered": 137,
                    "bounced": 2,
                    "received": 96
                  },
                  "data": [
                    {
                      "date": "2026-10-07",
                      "sent": 6,
                      "delivered": 6,
                      "bounced": 0,
                      "received": 4
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/inboxes/{id}/events": {
      "get": {
        "operationId": "listInboxEvents",
        "summary": "List inbox events",
        "description": "Lists message events of the inbox (received, sent, delivered, bounced, complained, opened, rejected), newest first.\n\n- Paged with `limit`, `page_token` and `next_page_token`. At most the newest 1,000 events in the range.",
        "tags": [
          "Inboxes"
        ],
        "x-docs-ids": [
          "list-inbox-events"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The inbox ID or its email address.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "description": "Start time (RFC 3339). Default 30 days ago.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "description": "End time (RFC 3339). Default now.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "event_types",
            "in": "query",
            "required": false,
            "description": "Only these types, comma-separated (for example message.received,message.bounced).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "1 to 100. Default 50.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "required": false,
            "description": "The `next_page_token` from the previous page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "number"
                    },
                    "limit": {
                      "type": "number"
                    },
                    "events": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "event_type": {
                            "type": "string"
                          },
                          "timestamp": {
                            "type": "string"
                          },
                          "message_id": {
                            "type": "string"
                          },
                          "thread_id": {
                            "type": "string"
                          },
                          "inbox_id": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "count": 1,
                  "limit": 50,
                  "events": [
                    {
                      "event_type": "message.received",
                      "timestamp": "2026-10-07T09:12:44.123456+00:00",
                      "message_id": "2c4e6a8b-0d1f-4a3c-9e5b-7d9f1b3d5e7a",
                      "thread_id": "f0e1d2c3-b4a5-4968-8776-655443322110",
                      "inbox_id": "support-bot@acme.com"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/inboxes/{id}/rates": {
      "get": {
        "operationId": "getInboxRates",
        "summary": "Retrieve inbox rates",
        "description": "Delivery, bounce, complaint, rejection and open rates of the inbox's sent mail for a time range.",
        "tags": [
          "Inboxes"
        ],
        "x-docs-ids": [
          "get-inbox-rates"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The inbox ID or its email address.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "description": "Start time (RFC 3339). Default 30 days ago.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "description": "End time (RFC 3339). Default now.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "start": {
                      "type": "string"
                    },
                    "end": {
                      "type": "string"
                    },
                    "sent": {
                      "type": "number"
                    },
                    "delivery_rate": {
                      "type": "number"
                    },
                    "bounce_rate": {
                      "type": "number"
                    },
                    "complaint_rate": {
                      "type": "number"
                    },
                    "rejection_rate": {
                      "type": "number"
                    },
                    "open_rate": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "start": "2026-09-07T09:12:44Z",
                  "end": "2026-10-07T09:12:44Z",
                  "sent": 140,
                  "delivery_rate": 0.9785,
                  "bounce_rate": 0.0142,
                  "complaint_rate": 0,
                  "rejection_rate": 0.0071,
                  "open_rate": 0.4214
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/inboxes/{id}/webhooks": {
      "get": {
        "operationId": "listInboxWebhooks",
        "summary": "List inbox webhooks",
        "description": "Lists the webhooks limited to this inbox.",
        "tags": [
          "Inboxes"
        ],
        "x-docs-ids": [
          "list-inbox-webhooks"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The inbox ID or its email address.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "1 to 100. Default 50.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "required": false,
            "description": "The `next_page_token` from the previous page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "number"
                    },
                    "limit": {
                      "type": "number"
                    },
                    "webhooks": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "webhook_id": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string"
                          },
                          "event_types": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "enabled": {
                            "type": "boolean"
                          },
                          "client_id": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "inbox_ids": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "pod_ids": {
                            "type": "array"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updated_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "count": 1,
                  "limit": 50,
                  "webhooks": [
                    {
                      "webhook_id": "4dd369bc-aa82-4ff3-97de-514ae3000ee0",
                      "url": "https://acme.com/hooks/sendio",
                      "event_types": [
                        "message.received"
                      ],
                      "enabled": true,
                      "client_id": null,
                      "inbox_ids": [
                        "support-bot@acme.com"
                      ],
                      "pod_ids": [],
                      "created_at": "2026-10-07T09:12:44.123456+00:00",
                      "updated_at": "2026-10-07T09:12:44.123456+00:00"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "post": {
        "operationId": "createInboxWebhook",
        "summary": "Create an inbox webhook",
        "description": "Creates a webhook that only fires for this inbox. The signing secret is returned once.\n\n- Counts toward your plan's webhook limit.",
        "tags": [
          "Inboxes"
        ],
        "x-docs-ids": [
          "create-inbox-webhook"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The inbox ID or its email address.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "The https endpoint. `endpoint` is accepted as an alias."
                  },
                  "event_types": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Events to send. Default [\"message.received\"]. Others include message.sent, message.delivered, message.bounced, message.complained, message.rejected, message.opened, message.received.spam."
                  },
                  "client_id": {
                    "type": "string",
                    "description": "Your own ID. If a webhook with this client_id exists with the same settings, it is returned instead; different settings answer 409."
                  }
                },
                "required": [
                  "url"
                ]
              },
              "example": {
                "url": "https://acme.com/hooks/sendio",
                "event_types": [
                  "message.received"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "webhook_id": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "event_types": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "enabled": {
                      "type": "boolean"
                    },
                    "client_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "inbox_ids": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "pod_ids": {
                      "type": "array"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "secret": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "webhook_id": "4dd369bc-aa82-4ff3-97de-514ae3000ee0",
                  "url": "https://acme.com/hooks/sendio",
                  "event_types": [
                    "message.received"
                  ],
                  "enabled": true,
                  "client_id": null,
                  "inbox_ids": [
                    "support-bot@acme.com"
                  ],
                  "pod_ids": [],
                  "created_at": "2026-10-07T09:12:44.123456+00:00",
                  "updated_at": "2026-10-07T09:12:44.123456+00:00",
                  "secret": "whsec_MfKQ9r8GKYqrTwjUPD8ILPZIo2LaLaSw"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/inboxes/{id}/webhooks/{webhook_id}": {
      "delete": {
        "operationId": "deleteInboxWebhook",
        "summary": "Delete an inbox webhook",
        "description": "Deletes a webhook of this inbox.",
        "tags": [
          "Inboxes"
        ],
        "x-docs-ids": [
          "delete-inbox-webhook"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The inbox ID or its email address.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook_id",
            "in": "path",
            "required": true,
            "description": "The webhook ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {}
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/inboxes/{id}/api-keys": {
      "get": {
        "operationId": "listInboxApiKeys",
        "summary": "List inbox API keys",
        "description": "Lists the active API keys limited to this inbox.",
        "tags": [
          "Inboxes"
        ],
        "x-docs-ids": [
          "list-inbox-api-keys"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The inbox ID or its email address.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "object": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "token_prefix": {
                            "type": "string"
                          },
                          "permission": {
                            "type": "string"
                          },
                          "inbox_id": {
                            "type": "string"
                          },
                          "permissions": {
                            "type": "object",
                            "properties": {
                              "message_read": {
                                "type": "boolean"
                              },
                              "message_reply": {
                                "type": "boolean"
                              }
                            }
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "last_used_at": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "data": [
                    {
                      "id": "d91cd9bd-1176-453e-8fc1-35364d380206",
                      "object": "api_key",
                      "name": "support agent",
                      "token_prefix": "mx_3kd92jf0a",
                      "permission": "inbox_access",
                      "inbox_id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
                      "permissions": {
                        "message_read": true,
                        "message_reply": true
                      },
                      "created_at": "2026-10-07T09:12:44.123456+00:00",
                      "last_used_at": null
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "post": {
        "operationId": "createInboxApiKey",
        "summary": "Create an inbox API key",
        "description": "Creates an API key that can only use this inbox. Give it to an agent so it cannot touch the rest of your account. The token is returned once.\n\n- Needs an admin, and cannot be called with a key that is itself limited to an inbox or pod.\n\n- An inbox key may only call /inboxes, /inbox/threads, /pods, /agent-domain and the /v0 API.",
        "tags": [
          "Inboxes"
        ],
        "x-docs-ids": [
          "create-inbox-api-key"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The inbox ID or its email address.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Max 50 characters. Default \"agent key\"."
                  },
                  "permissions": {
                    "type": "object",
                    "description": "Optional map of permission to true, to limit the key further (for example message_read, message_send, message_reply, draft_create, draft_send, webhook_read). Without it the key can do everything within the inbox.",
                    "properties": {
                      "message_read": {
                        "type": "boolean"
                      },
                      "message_reply": {
                        "type": "boolean"
                      },
                      "draft_create": {
                        "type": "boolean"
                      }
                    }
                  }
                }
              },
              "example": {
                "name": "support agent",
                "permissions": {
                  "message_read": true,
                  "message_reply": true,
                  "draft_create": true
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "object": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "permission": {
                      "type": "string"
                    },
                    "inbox_id": {
                      "type": "string"
                    },
                    "pod_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "permissions": {
                      "type": "object",
                      "properties": {
                        "message_read": {
                          "type": "boolean"
                        },
                        "message_reply": {
                          "type": "boolean"
                        },
                        "draft_create": {
                          "type": "boolean"
                        }
                      }
                    },
                    "token": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "id": "d91cd9bd-1176-453e-8fc1-35364d380206",
                  "object": "api_key",
                  "name": "support agent",
                  "permission": "inbox_access",
                  "inbox_id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
                  "pod_id": null,
                  "permissions": {
                    "message_read": true,
                    "message_reply": true,
                    "draft_create": true
                  },
                  "token": "mx_3kd92jf0a8b7c6d5e4f3a2b1c0d9e8f7"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/inboxes/{id}/drafts": {
      "post": {
        "operationId": "createInboxDraft",
        "summary": "Create a draft",
        "description": "Creates a pending draft. With `thread_id` it is a reply in that thread; otherwise it starts a new thread and needs `to`.",
        "tags": [
          "Inbox drafts"
        ],
        "x-docs-ids": [
          "create-inbox-draft"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The inbox ID or its email address.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "thread_id": {
                    "type": "string",
                    "description": "Reply in this thread. The subject defaults to \"Re: <thread subject>\"."
                  },
                  "to": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Recipients. Required without `thread_id`."
                  },
                  "cc": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Cc recipients."
                  },
                  "bcc": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Bcc recipients."
                  },
                  "subject": {
                    "type": "string",
                    "description": "The subject."
                  },
                  "text": {
                    "type": "string",
                    "description": "Plain text body. `text` or `html` is required."
                  },
                  "html": {
                    "type": "string",
                    "description": "HTML body."
                  },
                  "send_at": {
                    "type": "string",
                    "description": "Send automatically at this time (RFC 3339). Must not be in the past. Without it, the draft waits for approval."
                  }
                }
              },
              "example": {
                "thread_id": "f0e1d2c3-b4a5-4968-8776-655443322110",
                "text": "Hi Jane, sorry about that. We refunded the second charge."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "object": {
                      "type": "string"
                    },
                    "inbox_id": {
                      "type": "string"
                    },
                    "thread_id": {
                      "type": "string"
                    },
                    "to": {
                      "type": "array"
                    },
                    "cc": {
                      "type": "array"
                    },
                    "bcc": {
                      "type": "array"
                    },
                    "subject": {
                      "type": "string"
                    },
                    "text": {
                      "type": "string"
                    },
                    "html": {},
                    "status": {
                      "type": "string"
                    },
                    "send_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    },
                    "email_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "error": {},
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "sent_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    },
                    "labels": {
                      "type": "array"
                    },
                    "client_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "forward_of": {},
                    "reply_to": {},
                    "attachments": {},
                    "in_reply_to": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "id": "6e8a0c2e-4b6d-4f8a-9c1e-3a5c7e9b1d3f",
                  "object": "draft",
                  "inbox_id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
                  "thread_id": "f0e1d2c3-b4a5-4968-8776-655443322110",
                  "to": [],
                  "cc": [],
                  "bcc": [],
                  "subject": "Re: Question about my invoice",
                  "text": "Hi Jane, sorry about that. We refunded the second charge.",
                  "html": null,
                  "status": "pending",
                  "send_at": null,
                  "email_id": null,
                  "error": null,
                  "created_at": "2026-10-07T09:12:44.123456+00:00",
                  "updated_at": "2026-10-07T09:12:44.123456+00:00",
                  "sent_at": null,
                  "labels": [],
                  "client_id": null,
                  "forward_of": null,
                  "reply_to": null,
                  "attachments": null,
                  "in_reply_to": "2c4e6a8b-0d1f-4a3c-9e5b-7d9f1b3d5e7a"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "get": {
        "operationId": "listInboxDrafts",
        "summary": "List drafts",
        "description": "Lists the inbox's drafts, newest first.\n\n- Not paginated (up to 200 drafts).",
        "tags": [
          "Inbox drafts"
        ],
        "x-docs-ids": [
          "list-inbox-drafts"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The inbox ID or its email address.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "pending (the default), sending, sent, failed, discarded, or all.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "object": {
                            "type": "string"
                          },
                          "inbox_id": {
                            "type": "string"
                          },
                          "thread_id": {
                            "type": "string"
                          },
                          "to": {
                            "type": "array"
                          },
                          "cc": {
                            "type": "array"
                          },
                          "bcc": {
                            "type": "array"
                          },
                          "subject": {
                            "type": "string"
                          },
                          "text": {
                            "type": "string"
                          },
                          "html": {},
                          "status": {
                            "type": "string"
                          },
                          "send_at": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date-time"
                          },
                          "email_id": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "error": {},
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updated_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "sent_at": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date-time"
                          },
                          "labels": {
                            "type": "array"
                          },
                          "client_id": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "forward_of": {},
                          "reply_to": {},
                          "attachments": {},
                          "in_reply_to": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "data": [
                    {
                      "id": "6e8a0c2e-4b6d-4f8a-9c1e-3a5c7e9b1d3f",
                      "object": "draft",
                      "inbox_id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
                      "thread_id": "f0e1d2c3-b4a5-4968-8776-655443322110",
                      "to": [],
                      "cc": [],
                      "bcc": [],
                      "subject": "Re: Question about my invoice",
                      "text": "Hi Jane, sorry about that. We refunded the second charge.",
                      "html": null,
                      "status": "pending",
                      "send_at": null,
                      "email_id": null,
                      "error": null,
                      "created_at": "2026-10-07T09:12:44.123456+00:00",
                      "updated_at": "2026-10-07T09:12:44.123456+00:00",
                      "sent_at": null,
                      "labels": [],
                      "client_id": null,
                      "forward_of": null,
                      "reply_to": null,
                      "attachments": null,
                      "in_reply_to": "2c4e6a8b-0d1f-4a3c-9e5b-7d9f1b3d5e7a"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/inboxes/{id}/drafts/{draft}": {
      "get": {
        "operationId": "getInboxDraft",
        "summary": "Retrieve a draft",
        "description": "Returns one draft.",
        "tags": [
          "Inbox drafts"
        ],
        "x-docs-ids": [
          "get-inbox-draft"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The inbox ID or its email address.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "draft",
            "in": "path",
            "required": true,
            "description": "The draft ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "object": {
                      "type": "string"
                    },
                    "inbox_id": {
                      "type": "string"
                    },
                    "thread_id": {
                      "type": "string"
                    },
                    "to": {
                      "type": "array"
                    },
                    "cc": {
                      "type": "array"
                    },
                    "bcc": {
                      "type": "array"
                    },
                    "subject": {
                      "type": "string"
                    },
                    "text": {
                      "type": "string"
                    },
                    "html": {},
                    "status": {
                      "type": "string"
                    },
                    "send_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    },
                    "email_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "error": {},
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "sent_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    },
                    "labels": {
                      "type": "array"
                    },
                    "client_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "forward_of": {},
                    "reply_to": {},
                    "attachments": {},
                    "in_reply_to": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "id": "6e8a0c2e-4b6d-4f8a-9c1e-3a5c7e9b1d3f",
                  "object": "draft",
                  "inbox_id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
                  "thread_id": "f0e1d2c3-b4a5-4968-8776-655443322110",
                  "to": [],
                  "cc": [],
                  "bcc": [],
                  "subject": "Re: Question about my invoice",
                  "text": "Hi Jane, sorry about that. We refunded the second charge.",
                  "html": null,
                  "status": "pending",
                  "send_at": null,
                  "email_id": null,
                  "error": null,
                  "created_at": "2026-10-07T09:12:44.123456+00:00",
                  "updated_at": "2026-10-07T09:12:44.123456+00:00",
                  "sent_at": null,
                  "labels": [],
                  "client_id": null,
                  "forward_of": null,
                  "reply_to": null,
                  "attachments": null,
                  "in_reply_to": "2c4e6a8b-0d1f-4a3c-9e5b-7d9f1b3d5e7a"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "patch": {
        "operationId": "updateInboxDraft",
        "summary": "Update a draft",
        "description": "Changes a pending draft. Only the fields you send change.\n\n- Only a pending draft can be changed (409 otherwise).",
        "tags": [
          "Inbox drafts"
        ],
        "x-docs-ids": [
          "update-inbox-draft"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The inbox ID or its email address.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "draft",
            "in": "path",
            "required": true,
            "description": "The draft ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "to": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Recipients."
                  },
                  "cc": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Cc recipients."
                  },
                  "bcc": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Bcc recipients."
                  },
                  "subject": {
                    "type": "string",
                    "description": "The subject."
                  },
                  "text": {
                    "type": "string",
                    "description": "Plain text body."
                  },
                  "html": {
                    "type": "string",
                    "description": "HTML body."
                  },
                  "send_at": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Scheduled send time (RFC 3339), or null to clear."
                  }
                }
              },
              "example": {
                "text": "Hi Jane, we refunded the second charge. It shows in 3 to 5 days."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "object": {
                      "type": "string"
                    },
                    "inbox_id": {
                      "type": "string"
                    },
                    "thread_id": {
                      "type": "string"
                    },
                    "to": {
                      "type": "array"
                    },
                    "cc": {
                      "type": "array"
                    },
                    "bcc": {
                      "type": "array"
                    },
                    "subject": {
                      "type": "string"
                    },
                    "text": {
                      "type": "string"
                    },
                    "html": {},
                    "status": {
                      "type": "string"
                    },
                    "send_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    },
                    "email_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "error": {},
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "sent_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    },
                    "labels": {
                      "type": "array"
                    },
                    "client_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "forward_of": {},
                    "reply_to": {},
                    "attachments": {},
                    "in_reply_to": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "id": "6e8a0c2e-4b6d-4f8a-9c1e-3a5c7e9b1d3f",
                  "object": "draft",
                  "inbox_id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
                  "thread_id": "f0e1d2c3-b4a5-4968-8776-655443322110",
                  "to": [],
                  "cc": [],
                  "bcc": [],
                  "subject": "Re: Question about my invoice",
                  "text": "Hi Jane, we refunded the second charge. It shows in 3 to 5 days.",
                  "html": null,
                  "status": "pending",
                  "send_at": null,
                  "email_id": null,
                  "error": null,
                  "created_at": "2026-10-07T09:12:44.123456+00:00",
                  "updated_at": "2026-10-07T09:12:44.123456+00:00",
                  "sent_at": null,
                  "labels": [],
                  "client_id": null,
                  "forward_of": null,
                  "reply_to": null,
                  "attachments": null,
                  "in_reply_to": "2c4e6a8b-0d1f-4a3c-9e5b-7d9f1b3d5e7a"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "delete": {
        "operationId": "discardInboxDraft",
        "summary": "Discard a draft",
        "description": "Discards a pending draft. Returns the draft with status discarded.",
        "tags": [
          "Inbox drafts"
        ],
        "x-docs-ids": [
          "discard-inbox-draft"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The inbox ID or its email address.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "draft",
            "in": "path",
            "required": true,
            "description": "The draft ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "object": {
                      "type": "string"
                    },
                    "inbox_id": {
                      "type": "string"
                    },
                    "thread_id": {
                      "type": "string"
                    },
                    "to": {
                      "type": "array"
                    },
                    "cc": {
                      "type": "array"
                    },
                    "bcc": {
                      "type": "array"
                    },
                    "subject": {
                      "type": "string"
                    },
                    "text": {
                      "type": "string"
                    },
                    "html": {},
                    "status": {
                      "type": "string"
                    },
                    "send_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    },
                    "email_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "error": {},
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "sent_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    },
                    "labels": {
                      "type": "array"
                    },
                    "client_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "forward_of": {},
                    "reply_to": {},
                    "attachments": {},
                    "in_reply_to": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "id": "6e8a0c2e-4b6d-4f8a-9c1e-3a5c7e9b1d3f",
                  "object": "draft",
                  "inbox_id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
                  "thread_id": "f0e1d2c3-b4a5-4968-8776-655443322110",
                  "to": [],
                  "cc": [],
                  "bcc": [],
                  "subject": "Re: Question about my invoice",
                  "text": "Hi Jane, sorry about that. We refunded the second charge.",
                  "html": null,
                  "status": "discarded",
                  "send_at": null,
                  "email_id": null,
                  "error": null,
                  "created_at": "2026-10-07T09:12:44.123456+00:00",
                  "updated_at": "2026-10-07T09:12:44.123456+00:00",
                  "sent_at": null,
                  "labels": [],
                  "client_id": null,
                  "forward_of": null,
                  "reply_to": null,
                  "attachments": null,
                  "in_reply_to": "2c4e6a8b-0d1f-4a3c-9e5b-7d9f1b3d5e7a"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/inboxes/{id}/drafts/{draft}/restore": {
      "post": {
        "operationId": "restoreInboxDraft",
        "summary": "Restore a discarded draft",
        "description": "Undoes a discard: the draft is pending again and waits for approval. A schedule it had is cleared.\n\n- Only a discarded draft can be restored; any other answers 409.",
        "tags": [
          "Inbox drafts"
        ],
        "x-docs-ids": [
          "restore-inbox-draft"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The inbox ID or its email address.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "draft",
            "in": "path",
            "required": true,
            "description": "The draft ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "object": {
                      "type": "string"
                    },
                    "inbox_id": {
                      "type": "string"
                    },
                    "thread_id": {
                      "type": "string"
                    },
                    "to": {
                      "type": "array"
                    },
                    "cc": {
                      "type": "array"
                    },
                    "bcc": {
                      "type": "array"
                    },
                    "subject": {
                      "type": "string"
                    },
                    "text": {
                      "type": "string"
                    },
                    "html": {},
                    "status": {
                      "type": "string"
                    },
                    "send_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    },
                    "email_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "error": {},
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "sent_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    },
                    "labels": {
                      "type": "array"
                    },
                    "client_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "forward_of": {},
                    "reply_to": {},
                    "attachments": {},
                    "in_reply_to": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "id": "6e8a0c2e-4b6d-4f8a-9c1e-3a5c7e9b1d3f",
                  "object": "draft",
                  "inbox_id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
                  "thread_id": "f0e1d2c3-b4a5-4968-8776-655443322110",
                  "to": [],
                  "cc": [],
                  "bcc": [],
                  "subject": "Re: Question about my invoice",
                  "text": "Hi Jane, sorry about that. We refunded the second charge.",
                  "html": null,
                  "status": "pending",
                  "send_at": null,
                  "email_id": null,
                  "error": null,
                  "created_at": "2026-10-07T09:12:44.123456+00:00",
                  "updated_at": "2026-10-07T09:12:44.123456+00:00",
                  "sent_at": null,
                  "labels": [],
                  "client_id": null,
                  "forward_of": null,
                  "reply_to": null,
                  "attachments": null,
                  "in_reply_to": "2c4e6a8b-0d1f-4a3c-9e5b-7d9f1b3d5e7a"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/inboxes/{id}/drafts/{draft}/send": {
      "post": {
        "operationId": "sendInboxDraft",
        "summary": "Send a draft",
        "description": "Approves a pending draft and sends it now. Returns the draft with the sent email.",
        "tags": [
          "Inbox drafts"
        ],
        "x-docs-ids": [
          "send-inbox-draft"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The inbox ID or its email address.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "draft",
            "in": "path",
            "required": true,
            "description": "The draft ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "object": {
                      "type": "string"
                    },
                    "inbox_id": {
                      "type": "string"
                    },
                    "thread_id": {
                      "type": "string"
                    },
                    "to": {
                      "type": "array"
                    },
                    "cc": {
                      "type": "array"
                    },
                    "bcc": {
                      "type": "array"
                    },
                    "subject": {
                      "type": "string"
                    },
                    "text": {
                      "type": "string"
                    },
                    "html": {},
                    "status": {
                      "type": "string"
                    },
                    "send_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    },
                    "email_id": {
                      "type": "string"
                    },
                    "error": {},
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "sent_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "labels": {
                      "type": "array"
                    },
                    "client_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "forward_of": {},
                    "reply_to": {},
                    "attachments": {},
                    "in_reply_to": {
                      "type": "string"
                    },
                    "email": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "thread_id": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "id": "6e8a0c2e-4b6d-4f8a-9c1e-3a5c7e9b1d3f",
                  "object": "draft",
                  "inbox_id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
                  "thread_id": "f0e1d2c3-b4a5-4968-8776-655443322110",
                  "to": [],
                  "cc": [],
                  "bcc": [],
                  "subject": "Re: Question about my invoice",
                  "text": "Hi Jane, sorry about that. We refunded the second charge.",
                  "html": null,
                  "status": "sent",
                  "send_at": null,
                  "email_id": "49a3999c-0ce1-4ea6-ab68-afcd6dc2e794",
                  "error": null,
                  "created_at": "2026-10-07T09:12:44.123456+00:00",
                  "updated_at": "2026-10-07T09:12:44.123456+00:00",
                  "sent_at": "2026-10-07T09:12:44.123456+00:00",
                  "labels": [],
                  "client_id": null,
                  "forward_of": null,
                  "reply_to": null,
                  "attachments": null,
                  "in_reply_to": "2c4e6a8b-0d1f-4a3c-9e5b-7d9f1b3d5e7a",
                  "email": {
                    "id": "49a3999c-0ce1-4ea6-ab68-afcd6dc2e794",
                    "thread_id": "f0e1d2c3-b4a5-4968-8776-655443322110"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/inboxes/{id}/lists": {
      "get": {
        "operationId": "listInboxListEntries",
        "summary": "List entries",
        "description": "Lists the inbox's entries, plus team-wide entries (shown with inbox_id null).",
        "tags": [
          "Inbox lists"
        ],
        "x-docs-ids": [
          "list-inbox-list-entries"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The inbox ID or its email address.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "object": {
                            "type": "string"
                          },
                          "inbox_id": {
                            "type": "string"
                          },
                          "direction": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string"
                          },
                          "entry": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "data": [
                    {
                      "id": "3c5e7a9b-1d3f-4b5d-8e7a-9c1e3b5d7f9a",
                      "object": "list_entry",
                      "inbox_id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
                      "direction": "receive",
                      "kind": "block",
                      "entry": "spammy.example",
                      "created_at": "2026-10-07T09:12:44.123456+00:00"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "post": {
        "operationId": "addInboxListEntry",
        "summary": "Add an entry",
        "description": "Adds an email address or domain to the inbox's send or receive list.",
        "tags": [
          "Inbox lists"
        ],
        "x-docs-ids": [
          "add-inbox-list-entry"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The inbox ID or its email address.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "direction": {
                    "type": "string",
                    "description": "send or receive."
                  },
                  "kind": {
                    "type": "string",
                    "description": "allow or block."
                  },
                  "entry": {
                    "type": "string",
                    "description": "An email address or a domain (a domain also matches its subdomains). Max 254 characters."
                  }
                },
                "required": [
                  "direction",
                  "kind",
                  "entry"
                ]
              },
              "example": {
                "direction": "receive",
                "kind": "block",
                "entry": "spammy.example"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "object": {
                      "type": "string"
                    },
                    "inbox_id": {
                      "type": "string"
                    },
                    "direction": {
                      "type": "string"
                    },
                    "kind": {
                      "type": "string"
                    },
                    "entry": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "id": "3c5e7a9b-1d3f-4b5d-8e7a-9c1e3b5d7f9a",
                  "object": "list_entry",
                  "inbox_id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
                  "direction": "receive",
                  "kind": "block",
                  "entry": "spammy.example",
                  "created_at": "2026-10-07T09:12:44.123456+00:00"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/inboxes/{id}/lists/{entry}": {
      "delete": {
        "operationId": "removeInboxListEntry",
        "summary": "Remove an entry",
        "description": "Removes an entry from the inbox's lists.",
        "tags": [
          "Inbox lists"
        ],
        "x-docs-ids": [
          "remove-inbox-list-entry"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The inbox ID or its email address.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "entry",
            "in": "path",
            "required": true,
            "description": "The entry ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "deleted": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "object": "list_entry",
                  "id": "3c5e7a9b-1d3f-4b5d-8e7a-9c1e3b5d7f9a",
                  "deleted": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/inbox/mailboxes": {
      "get": {
        "operationId": "listInboxMailboxes",
        "summary": "List inbox addresses",
        "description": "Lists every address that has threads, with its unread and thread counts, the labels in use and the agent inboxes with theirs, plus team totals.\n\n- `unread` counts threads with at least one unread message, as the Unread view lists them; `unread_messages` counts the unread messages.\n\n- Counts leave out archived and trashed threads.",
        "tags": [
          "Inbox threads"
        ],
        "x-docs-ids": [
          "list-inbox-mailboxes"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "address": {
                            "type": "string"
                          },
                          "unread": {
                            "type": "number"
                          },
                          "unread_messages": {
                            "type": "number"
                          },
                          "threads": {
                            "type": "number"
                          }
                        }
                      }
                    },
                    "labels": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string"
                          },
                          "unread": {
                            "type": "number"
                          },
                          "unread_messages": {
                            "type": "number"
                          },
                          "threads": {
                            "type": "number"
                          }
                        }
                      }
                    },
                    "inboxes": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "inbox_id": {
                            "type": "string"
                          },
                          "unread": {
                            "type": "number"
                          },
                          "unread_messages": {
                            "type": "number"
                          },
                          "threads": {
                            "type": "number"
                          }
                        }
                      }
                    },
                    "unread": {
                      "type": "number"
                    },
                    "unread_messages": {
                      "type": "number"
                    },
                    "threads": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "data": [
                    {
                      "address": "sales@acme.com",
                      "unread": 4,
                      "unread_messages": 6,
                      "threads": 37
                    },
                    {
                      "address": "support-bot@acme.com",
                      "unread": 3,
                      "unread_messages": 3,
                      "threads": 12
                    }
                  ],
                  "labels": [
                    {
                      "label": "lead",
                      "unread": 2,
                      "unread_messages": 2,
                      "threads": 9
                    }
                  ],
                  "inboxes": [
                    {
                      "inbox_id": "9f3c1a2e-5b7d-4e8f-a1c3-2d4b6e8f0a1c",
                      "unread": 3,
                      "unread_messages": 3,
                      "threads": 12
                    }
                  ],
                  "unread": 7,
                  "unread_messages": 9,
                  "threads": 49
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/inbox/threads": {
      "get": {
        "operationId": "listAllInboxThreads",
        "summary": "List threads",
        "description": "Lists threads across all addresses, newest activity first.\n\n- A search (`q`) in the default view also finds archived threads; trashed threads are only found with `filter=trash`.\n\n- `label` matches however the label is typed: labels are stored lower-case.\n\n- `participant_names` maps a participant's address to a display name: the newest name that address sent in the thread, else the name of your agent inbox at that address. Addresses with no known name are left out.",
        "tags": [
          "Inbox threads"
        ],
        "x-docs-ids": [
          "list-all-inbox-threads"
        ],
        "parameters": [
          {
            "name": "mailbox",
            "in": "query",
            "required": false,
            "description": "Only threads of this address.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "inbox_id",
            "in": "query",
            "required": false,
            "description": "Only threads of this agent inbox.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter",
            "in": "query",
            "required": false,
            "description": "all (the default: not archived), unread, archived or trash.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "label",
            "in": "query",
            "required": false,
            "description": "Only threads with this label.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Search subject, snippet and participants.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "description": "Only threads whose last message is older than this time (ISO 8601). Use it to page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "1 to 200. Default 50.",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "object": {
                            "type": "string"
                          },
                          "subject": {
                            "type": "string"
                          },
                          "participants": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "mailboxes": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "last_message_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "snippet": {
                            "type": "string"
                          },
                          "message_count": {
                            "type": "number"
                          },
                          "unread_count": {
                            "type": "number"
                          },
                          "archived": {
                            "type": "boolean"
                          },
                          "inbox_id": {
                            "type": "string"
                          },
                          "labels": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "trashed": {
                            "type": "boolean"
                          },
                          "participant_names": {
                            "type": "object",
                            "properties": {
                              "jane@example.com": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "data": [
                    {
                      "id": "f0e1d2c3-b4a5-4968-8776-655443322110",
                      "object": "thread",
                      "subject": "Question about my invoice",
                      "participants": [
                        "jane@example.com"
                      ],
                      "mailboxes": [
                        "support-bot@acme.com"
                      ],
                      "last_message_at": "2026-10-07T09:12:44.123456+00:00",
                      "snippet": "Hi, I was charged twice this month...",
                      "message_count": 2,
                      "unread_count": 1,
                      "archived": false,
                      "inbox_id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
                      "labels": [
                        "billing"
                      ],
                      "trashed": false,
                      "participant_names": {
                        "jane@example.com": "Jane Doe"
                      }
                    }
                  ],
                  "has_more": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/inbox/threads/{id}": {
      "get": {
        "operationId": "getAllInboxThread",
        "summary": "Retrieve a thread",
        "description": "Returns a thread with all its received and sent messages, oldest first, with bodies.\n\n- `reply_defaults` is the From and To a reply to the thread goes out with when it names no `from` or `to`: the agent inbox, else the address that received the newest message; to that message's Reply-To, else its sender. It is null when the thread has no message to answer.",
        "tags": [
          "Inbox threads"
        ],
        "x-docs-ids": [
          "get-all-inbox-thread"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The thread ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "object": {
                      "type": "string"
                    },
                    "subject": {
                      "type": "string"
                    },
                    "participants": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "mailboxes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "last_message_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "snippet": {
                      "type": "string"
                    },
                    "message_count": {
                      "type": "number"
                    },
                    "unread_count": {
                      "type": "number"
                    },
                    "archived": {
                      "type": "boolean"
                    },
                    "inbox_id": {
                      "type": "string"
                    },
                    "labels": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "trashed": {
                      "type": "boolean"
                    },
                    "messages": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "object": {
                            "type": "string"
                          },
                          "direction": {
                            "type": "string"
                          },
                          "thread_id": {
                            "type": "string"
                          },
                          "inbox_id": {
                            "type": "string"
                          },
                          "from": {
                            "type": "string"
                          },
                          "from_name": {
                            "type": "string"
                          },
                          "to": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "cc": {
                            "type": "array"
                          },
                          "reply_to": {},
                          "received_for": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "subject": {
                            "type": "string"
                          },
                          "message_id": {
                            "type": "string"
                          },
                          "in_reply_to": {},
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "is_read": {
                            "type": "boolean"
                          },
                          "is_spam": {
                            "type": "boolean"
                          },
                          "snippet": {
                            "type": "string"
                          },
                          "extracted_text": {
                            "type": "string"
                          },
                          "extracted_html": {},
                          "labels": {
                            "type": "array"
                          },
                          "trashed": {
                            "type": "boolean"
                          },
                          "size": {
                            "type": "number"
                          },
                          "references": {
                            "type": "array"
                          },
                          "headers": {
                            "type": "object"
                          },
                          "attachments": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "filename": {
                                  "type": "string"
                                },
                                "content_type": {
                                  "type": "string"
                                },
                                "size": {
                                  "type": "number"
                                }
                              }
                            }
                          },
                          "html": {
                            "type": "string"
                          },
                          "text": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "reply_defaults": {
                      "type": "object",
                      "properties": {
                        "from": {
                          "type": "string"
                        },
                        "to": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "id": "f0e1d2c3-b4a5-4968-8776-655443322110",
                  "object": "thread",
                  "subject": "Question about my invoice",
                  "participants": [
                    "jane@example.com"
                  ],
                  "mailboxes": [
                    "support-bot@acme.com"
                  ],
                  "last_message_at": "2026-10-07T09:12:44.123456+00:00",
                  "snippet": "Hi, I was charged twice this month...",
                  "message_count": 2,
                  "unread_count": 1,
                  "archived": false,
                  "inbox_id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
                  "labels": [
                    "billing"
                  ],
                  "trashed": false,
                  "messages": [
                    {
                      "id": "2c4e6a8b-0d1f-4a3c-9e5b-7d9f1b3d5e7a",
                      "object": "message",
                      "direction": "inbound",
                      "thread_id": "f0e1d2c3-b4a5-4968-8776-655443322110",
                      "inbox_id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
                      "from": "jane@example.com",
                      "from_name": "Jane Doe",
                      "to": [
                        "support-bot@acme.com"
                      ],
                      "cc": [],
                      "reply_to": null,
                      "received_for": [
                        "support-bot@acme.com"
                      ],
                      "subject": "Question about my invoice",
                      "message_id": "<CAF1234@mail.example.com>",
                      "in_reply_to": null,
                      "created_at": "2026-10-07T09:12:44.123456+00:00",
                      "is_read": false,
                      "is_spam": false,
                      "snippet": "Hi, I was charged twice this month...",
                      "extracted_text": "Hi, I was charged twice this month. Can you help?",
                      "extracted_html": null,
                      "labels": [],
                      "trashed": false,
                      "size": 4210,
                      "references": [],
                      "headers": {},
                      "attachments": [
                        {
                          "id": "0a2c4e6b-8d0f-4c2a-9e4b-6d8f0a2c4e6b",
                          "filename": "invoice.pdf",
                          "content_type": "application/pdf",
                          "size": 48213
                        }
                      ],
                      "html": "<p>Hi, I was charged twice this month. Can you help?</p>",
                      "text": "Hi, I was charged twice this month. Can you help?"
                    }
                  ],
                  "reply_defaults": {
                    "from": "support@yourdomain.com",
                    "to": [
                      "customer@example.com"
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "patch": {
        "operationId": "updateInboxThread",
        "summary": "Update a thread",
        "description": "Marks a thread read or unread, archives, trashes or relabels it. Returns the thread.\n\n- Labels are lower-cased, 1 to 64 characters each, at most 50 per thread.",
        "tags": [
          "Inbox threads"
        ],
        "x-docs-ids": [
          "update-inbox-thread"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The thread ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "read": {
                    "type": "boolean",
                    "description": "true marks every message read; false marks them unread."
                  },
                  "read_up_to": {
                    "type": "string",
                    "description": "With `read: true`, marks read only the received messages up to and including this one (a message ID from the thread), so a message that arrived after you loaded the thread stays unread."
                  },
                  "archived": {
                    "type": "boolean",
                    "description": "Archive or unarchive."
                  },
                  "trashed": {
                    "type": "boolean",
                    "description": "Move to trash or restore."
                  },
                  "labels": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Replace all labels."
                  },
                  "add_labels": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Labels to add."
                  },
                  "remove_labels": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Labels to remove."
                  }
                }
              },
              "example": {
                "read": true,
                "add_labels": [
                  "billing"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "object": {
                      "type": "string"
                    },
                    "subject": {
                      "type": "string"
                    },
                    "participants": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "mailboxes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "last_message_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "snippet": {
                      "type": "string"
                    },
                    "message_count": {
                      "type": "number"
                    },
                    "unread_count": {
                      "type": "number"
                    },
                    "archived": {
                      "type": "boolean"
                    },
                    "inbox_id": {
                      "type": "string"
                    },
                    "labels": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "trashed": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "id": "f0e1d2c3-b4a5-4968-8776-655443322110",
                  "object": "thread",
                  "subject": "Question about my invoice",
                  "participants": [
                    "jane@example.com"
                  ],
                  "mailboxes": [
                    "support-bot@acme.com"
                  ],
                  "last_message_at": "2026-10-07T09:12:44.123456+00:00",
                  "snippet": "Hi, I was charged twice this month...",
                  "message_count": 2,
                  "unread_count": 0,
                  "archived": false,
                  "inbox_id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
                  "labels": [
                    "billing"
                  ],
                  "trashed": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/inbox/threads/{id}/reply": {
      "post": {
        "operationId": "replyAllInboxThread",
        "summary": "Reply to a thread",
        "description": "Replies to the newest message in the thread with threading headers set. A thread of an agent inbox always replies from that inbox; otherwise from the address that received it.\n\n- Replying unarchives the thread.\n\n- Size limits are the same as for Send email.",
        "tags": [
          "Inbox threads"
        ],
        "x-docs-ids": [
          "reply-all-inbox-thread"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The thread ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "text": {
                    "type": "string",
                    "description": "Plain text body. `text` or `html` is required."
                  },
                  "html": {
                    "type": "string",
                    "description": "HTML body."
                  },
                  "from": {
                    "type": "string",
                    "description": "Sender for threads that are not on an agent inbox."
                  },
                  "to": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "Override the recipients. Default: the sender (or its Reply-To)."
                  },
                  "cc": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "Cc recipients."
                  },
                  "bcc": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "Bcc recipients."
                  },
                  "reply_all": {
                    "type": "boolean",
                    "description": "true copies everyone on the last message. Default false."
                  },
                  "attachments": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    },
                    "description": "Files to attach, same shape as Send email."
                  },
                  "reply_to": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "Reply-To addresses."
                  },
                  "quote": {
                    "type": "boolean",
                    "description": "true adds the usual quoted history of the message you answer under your text (\"On <date>, <sender> wrote:\"). Default false."
                  }
                }
              },
              "example": {
                "text": "Thanks, we will look into it today.",
                "quote": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "thread_id": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "id": "49a3999c-0ce1-4ea6-ab68-afcd6dc2e794",
                  "thread_id": "f0e1d2c3-b4a5-4968-8776-655443322110"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/inbox/threads/{id}/forward": {
      "post": {
        "operationId": "forwardAllInboxThread",
        "summary": "Forward a thread",
        "description": "Forwards one message of the thread with its attachments, your note above it and a forwarded header (From, Date, Subject, To, Cc). It goes out from the address a reply would use and is filed in the thread.\n\n- The forward is plain text; the original's files go with it, so a forward over the email size limit is refused with that error.\n\n- Returns 422 when `message_id` is not a message of this thread.",
        "tags": [
          "Inbox threads"
        ],
        "x-docs-ids": [
          "forward-all-inbox-thread"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The thread ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "to": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "Recipients."
                  },
                  "cc": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "Cc recipients."
                  },
                  "bcc": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "Bcc recipients."
                  },
                  "text": {
                    "type": "string",
                    "description": "Your note above the forwarded message."
                  },
                  "message_id": {
                    "type": "string",
                    "description": "The message to forward. Default: the newest message in the thread."
                  },
                  "subject": {
                    "type": "string",
                    "description": "Default is \"Fwd: \" plus the original subject."
                  },
                  "attachments": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    },
                    "description": "More files to attach, same shape as Send email."
                  },
                  "from": {
                    "type": "string",
                    "description": "Sender for threads that are not on an agent inbox."
                  }
                },
                "required": [
                  "to"
                ]
              },
              "example": {
                "to": [
                  "accounts@acme.com"
                ],
                "text": "Can you check this one?"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "thread_id": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "id": "49a3999c-0ce1-4ea6-ab68-afcd6dc2e794",
                  "thread_id": "f0e1d2c3-b4a5-4968-8776-655443322110"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/pods": {
      "post": {
        "operationId": "createPod",
        "summary": "Create a pod",
        "description": "Creates a pod.\n\n- Cannot be called with a key limited to an inbox or pod.",
        "tags": [
          "Pods"
        ],
        "x-docs-ids": [
          "create-pod"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Max 100 characters."
                  },
                  "client_id": {
                    "type": "string",
                    "description": "Your own ID. If a pod with this client_id exists, it is returned instead of creating a new one."
                  }
                }
              },
              "example": {
                "name": "Customer: Globex",
                "client_id": "globex"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "object": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "client_id": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "inboxes": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "id": "8b0d2f4a-6c8e-4a0c-b2d4-6f8a0c2e4b6d",
                  "object": "pod",
                  "name": "Customer: Globex",
                  "client_id": "globex",
                  "created_at": "2026-10-07T09:12:44.123456+00:00",
                  "updated_at": "2026-10-07T09:12:44.123456+00:00",
                  "inboxes": 0
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "get": {
        "operationId": "listPods",
        "summary": "List pods",
        "description": "Lists the team's pods, newest first, with their inbox counts.\n\n- Not paginated (up to 1,000 pods). A pod key sees only its pod.",
        "tags": [
          "Pods"
        ],
        "x-docs-ids": [
          "list-pods"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "object": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "client_id": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updated_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "inboxes": {
                            "type": "number"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "data": [
                    {
                      "id": "8b0d2f4a-6c8e-4a0c-b2d4-6f8a0c2e4b6d",
                      "object": "pod",
                      "name": "Customer: Globex",
                      "client_id": "globex",
                      "created_at": "2026-10-07T09:12:44.123456+00:00",
                      "updated_at": "2026-10-07T09:12:44.123456+00:00",
                      "inboxes": 2
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/pods/{pod}": {
      "get": {
        "operationId": "getPod",
        "summary": "Retrieve a pod",
        "description": "Returns one pod.",
        "tags": [
          "Pods"
        ],
        "x-docs-ids": [
          "get-pod"
        ],
        "parameters": [
          {
            "name": "pod",
            "in": "path",
            "required": true,
            "description": "The pod ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "object": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "client_id": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "inboxes": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "id": "8b0d2f4a-6c8e-4a0c-b2d4-6f8a0c2e4b6d",
                  "object": "pod",
                  "name": "Customer: Globex",
                  "client_id": "globex",
                  "created_at": "2026-10-07T09:12:44.123456+00:00",
                  "updated_at": "2026-10-07T09:12:44.123456+00:00",
                  "inboxes": 2
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "delete": {
        "operationId": "deletePod",
        "summary": "Delete a pod",
        "description": "Deletes an empty pod.\n\n- Delete the pod's inboxes first: a pod with inboxes returns 409.",
        "tags": [
          "Pods"
        ],
        "x-docs-ids": [
          "delete-pod"
        ],
        "parameters": [
          {
            "name": "pod",
            "in": "path",
            "required": true,
            "description": "The pod ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "deleted": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "object": "pod",
                  "id": "8b0d2f4a-6c8e-4a0c-b2d4-6f8a0c2e4b6d",
                  "deleted": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/pods/{pod}/inboxes": {
      "get": {
        "operationId": "listPodInboxes",
        "summary": "List pod inboxes",
        "description": "Lists the inboxes in the pod.",
        "tags": [
          "Pods"
        ],
        "x-docs-ids": [
          "list-pod-inboxes"
        ],
        "parameters": [
          {
            "name": "pod",
            "in": "path",
            "required": true,
            "description": "The pod ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "object": {
                            "type": "string"
                          },
                          "address": {
                            "type": "string"
                          },
                          "display_name": {
                            "type": "string"
                          },
                          "client_id": {
                            "type": "string"
                          },
                          "pod_id": {
                            "type": "string"
                          },
                          "metadata": {},
                          "message_ttl_hours": {},
                          "demo_expires_at": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date-time"
                          },
                          "auto_reply": {
                            "type": "boolean"
                          },
                          "domain": {
                            "type": "string"
                          },
                          "mailbox_id": {
                            "type": "string"
                          },
                          "imap_smtp": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updated_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "threads": {
                            "type": "number"
                          },
                          "unread": {
                            "type": "number"
                          },
                          "pending_drafts": {
                            "type": "number"
                          },
                          "last_message_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "data": [
                    {
                      "id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
                      "object": "inbox",
                      "address": "support-bot@acme.com",
                      "display_name": "Acme Support",
                      "client_id": "support-bot-1",
                      "pod_id": "8b0d2f4a-6c8e-4a0c-b2d4-6f8a0c2e4b6d",
                      "metadata": null,
                      "message_ttl_hours": null,
                      "demo_expires_at": null,
                      "auto_reply": false,
                      "domain": "acme.com",
                      "mailbox_id": "7f3a9c2e-1b4d-4e6f-a8c0-2d4e6f8a0b1c",
                      "imap_smtp": "ready",
                      "created_at": "2026-10-07T09:12:44.123456+00:00",
                      "updated_at": "2026-10-07T09:12:44.123456+00:00",
                      "threads": 12,
                      "unread": 3,
                      "pending_drafts": 1,
                      "last_message_at": "2026-10-07T09:12:44.123456+00:00"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "post": {
        "operationId": "createPodInbox",
        "summary": "Create a pod inbox",
        "description": "Creates an inbox in the pod. Takes the same body as POST /inboxes.",
        "tags": [
          "Pods"
        ],
        "x-docs-ids": [
          "create-pod-inbox"
        ],
        "parameters": [
          {
            "name": "pod",
            "in": "path",
            "required": true,
            "description": "The pod ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "username": {
                    "type": "string",
                    "description": "The part before the @. Default agent-<random>."
                  },
                  "domain": {
                    "type": "string",
                    "description": "A verified domain, or the shared agent domain (default)."
                  },
                  "display_name": {
                    "type": "string",
                    "description": "The name shown in the From header."
                  },
                  "client_id": {
                    "type": "string",
                    "description": "Your own ID, for safe retries."
                  }
                }
              },
              "example": {
                "username": "globex-support",
                "display_name": "Globex Support"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "object": {
                      "type": "string"
                    },
                    "address": {
                      "type": "string"
                    },
                    "display_name": {
                      "type": "string"
                    },
                    "client_id": {
                      "type": "string"
                    },
                    "pod_id": {
                      "type": "string"
                    },
                    "metadata": {},
                    "message_ttl_hours": {},
                    "demo_expires_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    },
                    "auto_reply": {
                      "type": "boolean"
                    },
                    "domain": {
                      "type": "string"
                    },
                    "mailbox_id": {
                      "type": "string"
                    },
                    "imap_smtp": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "threads": {
                      "type": "number"
                    },
                    "unread": {
                      "type": "number"
                    },
                    "pending_drafts": {
                      "type": "number"
                    },
                    "last_message_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
                  "object": "inbox",
                  "address": "globex-support@acme.com",
                  "display_name": "Globex Support",
                  "client_id": "support-bot-1",
                  "pod_id": "8b0d2f4a-6c8e-4a0c-b2d4-6f8a0c2e4b6d",
                  "metadata": null,
                  "message_ttl_hours": null,
                  "demo_expires_at": null,
                  "auto_reply": false,
                  "domain": "acme.com",
                  "mailbox_id": "7f3a9c2e-1b4d-4e6f-a8c0-2d4e6f8a0b1c",
                  "imap_smtp": "ready",
                  "created_at": "2026-10-07T09:12:44.123456+00:00",
                  "updated_at": "2026-10-07T09:12:44.123456+00:00",
                  "threads": 0,
                  "unread": 0,
                  "pending_drafts": 0,
                  "last_message_at": null
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/pods/{pod}/api-keys": {
      "post": {
        "operationId": "createPodApiKey",
        "summary": "Create a pod API key",
        "description": "Creates an API key that can only use this pod and its inboxes. The token is returned once.\n\n- Needs an admin, and cannot be called with a key that is itself limited to an inbox or pod.",
        "tags": [
          "Pods"
        ],
        "x-docs-ids": [
          "create-pod-api-key"
        ],
        "parameters": [
          {
            "name": "pod",
            "in": "path",
            "required": true,
            "description": "The pod ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Max 50 characters. Default \"agent key\"."
                  },
                  "permissions": {
                    "type": "object",
                    "description": "Optional map of permission to true, to limit the key further (for example inbox_create, message_read, message_send)."
                  }
                }
              },
              "example": {
                "name": "globex agent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "object": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "permission": {
                      "type": "string"
                    },
                    "inbox_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "pod_id": {
                      "type": "string"
                    },
                    "permissions": {},
                    "token": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "id": "d91cd9bd-1176-453e-8fc1-35364d380206",
                  "object": "api_key",
                  "name": "globex agent",
                  "permission": "inbox_access",
                  "inbox_id": null,
                  "pod_id": "8b0d2f4a-6c8e-4a0c-b2d4-6f8a0c2e4b6d",
                  "permissions": null,
                  "token": "mx_7a6b5c4d3e2f1a0b9c8d7e6f5a4b3c2d"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/agent-domain": {
      "get": {
        "operationId": "getAgentDomain",
        "summary": "Retrieve the agent domain",
        "description": "Returns the shared agent domain (`domain`), the free mailbox domain (`free_mailbox_domain`, null when free mailboxes are off) and the domain a new inbox gets when you give none (`default_domain`).\n\n- With free mailboxes on, an inbox created with no domain is name@<org>.sendiomail.com, where <org> is your workspace's own label.\n\n- Which free domain is which: name@<org>.sendiomail.com is your workspace's free mailbox, made here when you give no domain (GET /agent-domain returns it as `free_mailbox_domain`). name@org.sendioinbox.com is the no-signup agent mailbox (/docs/agent-mailbox), made with no account and sealed to its key; claimed into a workspace it keeps its sendioinbox.com address and counts as one of the workspace's free mailboxes.\n\n- Inbox and pod keys may call this too.",
        "tags": [
          "Agent domain and AgentID"
        ],
        "x-docs-ids": [
          "get-agent-domain"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "domain": {
                      "type": "string"
                    },
                    "default_domain": {
                      "type": "string"
                    },
                    "free_mailbox_domain": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "object": "agent_domain",
                  "domain": "agents.send.io",
                  "default_domain": "sendiomail.com",
                  "free_mailbox_domain": "sendiomail.com"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/sending-environment": {
      "get": {
        "operationId": "getSendingEnvironment",
        "summary": "Retrieve the sending environment",
        "description": "Says whether this environment delivers only to test addresses, and which one to send tests to.\n\n- `simulator_only` is true on development environments, where the email provider only delivers to test addresses. `test_recipient` is then `delivered@send.io`, a test address send.io simulates; it is null otherwise.\n\n- Production always answers false.",
        "tags": [
          "Agent domain and AgentID"
        ],
        "x-docs-ids": [
          "get-sending-environment"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "simulator_only": {
                      "type": "boolean"
                    },
                    "test_recipient": {}
                  }
                },
                "example": {
                  "object": "sending_environment",
                  "simulator_only": false,
                  "test_recipient": null
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/agentid/apps": {
      "get": {
        "operationId": "listAgentidApps",
        "summary": "List AgentID apps",
        "description": "Lists the team's registered AgentID apps, newest first.",
        "tags": [
          "Agent domain and AgentID"
        ],
        "x-docs-ids": [
          "list-agentid-apps"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "object": {
                            "type": "string"
                          },
                          "client_id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "redirect_uris": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "share_owner": {
                            "type": "boolean"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "data": [
                    {
                      "object": "agentid_app",
                      "client_id": "aid_app_k2J9xQ4mN7pR1sT5vW8y",
                      "name": "Acme Portal",
                      "redirect_uris": [
                        "https://portal.acme.com/callback"
                      ],
                      "share_owner": false,
                      "created_at": "2026-10-07T09:12:44.123456+00:00"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "post": {
        "operationId": "createAgentidApp",
        "summary": "Create an AgentID app",
        "description": "Registers an app that can sign agents in. The client secret is returned once.",
        "tags": [
          "Agent domain and AgentID"
        ],
        "x-docs-ids": [
          "create-agentid-app"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "1 to 100 characters."
                  },
                  "redirect_uris": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "1 to 10 URLs. https only (http allowed for localhost), no fragment."
                  },
                  "share_owner": {
                    "type": "boolean",
                    "description": "true lets the app ask for the human owner's details. Default false."
                  }
                },
                "required": [
                  "name",
                  "redirect_uris"
                ]
              },
              "example": {
                "name": "Acme Portal",
                "redirect_uris": [
                  "https://portal.acme.com/callback"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "client_id": {
                      "type": "string"
                    },
                    "client_secret": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "redirect_uris": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "share_owner": {
                      "type": "boolean"
                    },
                    "issuer": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "object": "agentid_app",
                  "client_id": "aid_app_k2J9xQ4mN7pR1sT5vW8y",
                  "client_secret": "aid_secret_Zx8Yw7Vu6Ts5Rq4Po3Nm2Lk1Jh0Gf9Ed8Cb7",
                  "name": "Acme Portal",
                  "redirect_uris": [
                    "https://portal.acme.com/callback"
                  ],
                  "share_owner": false,
                  "issuer": "https://api.send.io/v0"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/agentid/apps/{id}": {
      "delete": {
        "operationId": "deleteAgentidApp",
        "summary": "Delete an AgentID app",
        "description": "Deletes an AgentID app. Its client ID and secret stop working.",
        "tags": [
          "Agent domain and AgentID"
        ],
        "x-docs-ids": [
          "delete-agentid-app"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The app's client_id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "client_id": {
                      "type": "string"
                    },
                    "deleted": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "object": "agentid_app",
                  "client_id": "aid_app_k2J9xQ4mN7pR1sT5vW8y",
                  "deleted": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/logs": {
      "get": {
        "operationId": "listLogs",
        "summary": "List API logs",
        "description": "Lists the team's API requests, newest first. Filters combine, and paging works within them. A parameter not listed here is refused with 422 `invalid_parameter`.",
        "tags": [
          "API logs"
        ],
        "x-docs-ids": [
          "list-logs"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Number of items to return, 1 to 100. Defaults to 20.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "Return items after this id (the next page). Cannot be used with `before`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "description": "Return items before this id (the previous page). Cannot be used with `after`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "method",
            "in": "query",
            "required": false,
            "description": "Only this HTTP method, for example `POST`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Only this status code (`422`) or class (`2xx`, `4xx`, `5xx`).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "path",
            "in": "query",
            "required": false,
            "description": "Only paths starting with this, for example `/emails` (at most 200 characters).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api_key_id",
            "in": "query",
            "required": false,
            "description": "Only requests made with this API key.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "created_after",
            "in": "query",
            "required": false,
            "description": "Only requests at or after this time: an RFC 3339 timestamp, a date or Unix seconds.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "created_before",
            "in": "query",
            "required": false,
            "description": "Only requests before this time: an RFC 3339 timestamp, a date or Unix seconds.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Matches the path, method or status code (at most 100 characters).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "api_key_id": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The API key that made the request."
                    },
                    "api_key_name": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "That key's name, or null when the key was deleted."
                    },
                    "ip": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The address the request came from."
                    },
                    "object": {
                      "type": "string"
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "endpoint": {
                            "type": "string"
                          },
                          "method": {
                            "type": "string"
                          },
                          "response_status": {
                            "type": "number"
                          },
                          "user_agent": {
                            "type": "string"
                          },
                          "api_key_id": {
                            "type": "string"
                          },
                          "api_key_name": {
                            "type": "string"
                          },
                          "ip": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "has_more": false,
                  "data": [
                    {
                      "id": "5e7a9c1e-3b5d-4f7a-9c1e-3b5d7f9a1c3e",
                      "created_at": "2026-10-07T09:12:44.123456+00:00",
                      "endpoint": "/emails",
                      "method": "POST",
                      "response_status": 200,
                      "user_agent": "resend-node:6.32.0",
                      "api_key_id": "b6d24b8e-af0b-4c3c-be0c-359bbd97381e",
                      "api_key_name": "Production",
                      "ip": "203.0.113.7"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/logs/{log_id}": {
      "get": {
        "operationId": "retrieveLog",
        "summary": "Retrieve API log",
        "description": "Gets one API request by id, with what was sent and answered.\n\n- `request_body` and `response_body` hold the JSON as sent and answered, with passwords, tokens, secrets and keys replaced by `[hidden]` and attachment content left out.\n\n- A body is not stored, and holds a short sentence saying why, when it is larger than 16 KB, is not JSON, or is a sent email's content (see the email in Email logs). The answer to a successful GET is not stored: call the endpoint again. A GET has no request body, so `request_body` is null.\n\n- Calls with a revoked, suspended or expired key are listed with status 401 (at most one a minute per key), and calls with a working key to a path that does not exist with status 404. Calls with no key or a key that never existed belong to no workspace and are not listed. Reading the logs (GET /logs) is not itself logged.",
        "tags": [
          "API logs"
        ],
        "x-docs-ids": [
          "retrieve-log"
        ],
        "parameters": [
          {
            "name": "log_id",
            "in": "path",
            "required": true,
            "description": "The log id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "endpoint": {
                      "type": "string"
                    },
                    "method": {
                      "type": "string"
                    },
                    "response_status": {
                      "type": "number"
                    },
                    "user_agent": {
                      "type": "string"
                    },
                    "api_key_id": {
                      "type": "string"
                    },
                    "api_key_name": {
                      "type": "string"
                    },
                    "ip": {
                      "type": "string"
                    },
                    "request_body": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        }
                      }
                    },
                    "response_body": {
                      "type": "object",
                      "properties": {
                        "object": {
                          "type": "string"
                        },
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "log",
                  "id": "5e7a9c1e-3b5d-4f7a-9c1e-3b5d7f9a1c3e",
                  "created_at": "2026-10-07T09:12:44.123456+00:00",
                  "endpoint": "/domains",
                  "method": "POST",
                  "response_status": 200,
                  "user_agent": "resend-node:6.32.0",
                  "api_key_id": "b6d24b8e-af0b-4c3c-be0c-359bbd97381e",
                  "api_key_name": "Production",
                  "ip": "203.0.113.7",
                  "request_body": {
                    "name": "acme.com"
                  },
                  "response_body": {
                    "object": "domain",
                    "id": "4ef1d1a3-2c5b-4d7e-9f60-1b2c3d4e5f60",
                    "name": "acme.com"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/brand": {
      "get": {
        "operationId": "getBrand",
        "summary": "Get brand",
        "description": "The team's brand: its name, logo and colours, as the template editor uses them.\n\n- send.io extension.",
        "tags": [
          "Assets"
        ],
        "x-docs-ids": [
          "get-brand"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The brand name, or null when not set."
                    },
                    "logo_url": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "A public URL of the logo (PNG), or null when there is none."
                    },
                    "logo_width": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "The logo's width in pixels. Left out before a brand is saved."
                    },
                    "logo_height": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "The logo's height in pixels. Left out before a brand is saved."
                    },
                    "palette": {
                      "type": "object",
                      "description": "Named colours, such as `primary`. `{}` when none are set.",
                      "properties": {
                        "primary": {
                          "type": "string"
                        }
                      }
                    },
                    "updated_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "When the brand last changed, or null when it was never saved.",
                      "format": "date-time"
                    },
                    "object": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "object": "brand",
                  "name": "Acme",
                  "logo_url": "https://api.send.io/brand-logo/4c7e1a9b2d5f8e3a6c0b9d2e5f8a1b4c.png",
                  "logo_width": 320,
                  "logo_height": 96,
                  "palette": {
                    "primary": "#ff5a1f"
                  },
                  "updated_at": "2026-10-05T16:22:48.903311+00:00"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/assets": {
      "post": {
        "operationId": "createAsset",
        "summary": "Upload an image",
        "description": "Uploads an image and returns a permanent public URL to use in your emails.\n\n- The URL is public and cached forever; it never changes.\n\n- A team can store up to 2,000 images.",
        "tags": [
          "Assets"
        ],
        "x-docs-ids": [
          "create-asset"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "image": {
                    "type": "string",
                    "description": "The image as base64. PNG, JPEG or GIF, under 2 MB, at most 4000 x 4000 pixels."
                  },
                  "content_type": {
                    "type": "string",
                    "description": "Optional. The type is read from the image itself."
                  }
                },
                "required": [
                  "image"
                ]
              },
              "example": {
                "image": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==",
                "content_type": "image/png"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "width": {
                      "type": "number"
                    },
                    "height": {
                      "type": "number"
                    },
                    "bytes": {
                      "type": "number"
                    },
                    "content_type": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "object": "asset",
                  "id": "1b3d5f7a-9c1e-4d3f-8a5b-7c9e1d3f5a7b",
                  "url": "https://api.send.io/assets/9f2b6c1e4a7d3b8f0e5c2a9d6b1f4e7a.png",
                  "width": 600,
                  "height": 200,
                  "bytes": 18342,
                  "content_type": "image/png"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/mcp": {
      "post": {
        "operationId": "mcpRequest",
        "summary": "Call the MCP server",
        "description": "JSON-RPC 2.0 over HTTP. Supports initialize, ping, tools/list and tools/call. Each tool call runs the matching API endpoint with your key.\n\n- Authenticate with `Authorization: Bearer mx_...`, the same as the REST API. Browser requests from other origins are refused.\n\n- Tools: send-email, send-batch-emails; list/get for emails, domains, api-keys, webhooks, suppressions, templates and logs; create, verify and remove for domains, API keys, webhooks, suppressions and templates; cancel-email and update-email; transactional emails (create, list, get, update, remove, send-test, stats); agent inboxes (create, list, get, delete, threads, messages, send, reply, forward, update-thread, drafts); automations (create, list, get, update, duplicate, stop, remove, runs); events (send-event, create, list, get, update, remove).\n\n- The tool result is the endpoint's JSON response as text. `isError` is true when the endpoint returned 400 or above.\n\n- Protocol versions 2025-06-18, 2025-11-25 and 2026-07-28: the server answers with the version the client asks for when it is one of these, otherwise with the newest. Request bodies are limited to 1 MB.",
        "tags": [
          "MCP"
        ],
        "x-docs-ids": [
          "mcp-request"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "description": "Always \"2.0\"."
                  },
                  "id": {
                    "type": [
                      "string",
                      "number"
                    ],
                    "description": "Request ID. A message without an id is a notification and gets an empty 202."
                  },
                  "method": {
                    "type": "string",
                    "description": "initialize, ping, tools/list or tools/call."
                  },
                  "params": {
                    "type": "object",
                    "description": "For tools/call: {name, arguments}. Path IDs (id, thread, draft, run) go in arguments.",
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "arguments": {
                        "type": "object",
                        "properties": {
                          "from": {
                            "type": "string"
                          },
                          "to": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "subject": {
                            "type": "string"
                          },
                          "text": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "required": [
                  "jsonrpc",
                  "method"
                ]
              },
              "example": {
                "jsonrpc": "2.0",
                "id": 1,
                "method": "tools/call",
                "params": {
                  "name": "send-email",
                  "arguments": {
                    "from": "Acme <hello@acme.com>",
                    "to": [
                      "jane@example.com"
                    ],
                    "subject": "Hello from MCP",
                    "text": "It works."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "jsonrpc": {
                      "type": "string"
                    },
                    "id": {
                      "type": "number"
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "content": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string"
                              },
                              "text": {
                                "type": "string"
                              }
                            }
                          }
                        },
                        "isError": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "jsonrpc": "2.0",
                  "id": 1,
                  "result": {
                    "content": [
                      {
                        "type": "text",
                        "text": "{\"id\":\"49a3999c-0ce1-4ea6-ab68-afcd6dc2e794\"}"
                      }
                    ],
                    "isError": false
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/billing/balance": {
      "get": {
        "operationId": "getCreditBalance",
        "summary": "Retrieve the balance",
        "description": "The credit balance your team can spend, with lifetime totals. For a subaccount it is the parent's balance, with `shared_with_parent` set.\n\n- `low_balance_credits`: under this balance you get the `credits.low` webhook and email (once, until you top up).\n\n- `unpaid_daily_limit`: recipients per day you can send to until your first purchase (each To, Cc and Bcc address counts as one); `null` once you have bought credits or are on a paid plan. When a paid plan ends and the workspace is back on the Free plan without bought credits, the limit applies again. It is a daily cap, separate from `balance`: it gives no credits.\n\n- `daily_limit`: the daily cap in force, `null` when there is none. `reason` `unpaid`: the unpaid daily limit above, until the first purchase and again on the Free plan after a paid plan has ended. `reason` `ramp`: new paid accounts can send to up to 5,000 recipients a day for the first 7 days after the first purchase (by default); `lifts_at` says when it ends for you. `limit`, `used` and `remaining` count recipients (each To, Cc and Bcc address), and a scheduled email counts on the day it was created. Over the limit, sends answer 429 `daily_quota_exceeded` until 00:00 UTC (05:30 IST).\n\n- `last_topup`: the most recent credits added (a purchase, a grant or the welcome credits), `0` when none; with `balance` it shows how much of that top-up is left.\n\n- `spend_14d`: credits used in the last 14 days (the whole account, subaccounts included); divide by 14 for the average daily spend.\n\n- `balance`, `purchased`, `granted` and `used` are credits with up to 3 decimals; the `_millicredits` fields are the same amounts as integers.",
        "tags": [
          "Billing"
        ],
        "x-docs-ids": [
          "get-credit-balance"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "first_purchase_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "When credits were first bought, or null before the first purchase.",
                      "format": "date-time"
                    },
                    "unpaid_daily_limit": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Emails per day you can send until your first purchase, broadcasts included; null once you have bought credits or are on a paid plan. It applies again when a paid plan ends and the workspace is back on the Free plan."
                    },
                    "last_topup_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "When the last credits were added, or null when none.",
                      "format": "date-time"
                    },
                    "daily_limit": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The daily sending limit that applies now: `reason` (`unpaid` before the first purchase or back on the Free plan, `ramp` for new paid accounts), `limit`, `used` and `remaining` today, `resets_at` (00:00 UTC), and for `ramp` `ramp_days` and `lifts_at`. null when no such limit applies.",
                      "properties": {
                        "reason": {
                          "type": "string",
                          "description": "`unpaid` or `ramp`."
                        },
                        "limit": {
                          "type": "integer",
                          "description": "Recipients per day."
                        },
                        "used": {
                          "type": "integer",
                          "description": "Recipients counted today (UTC)."
                        },
                        "remaining": {
                          "type": "integer",
                          "description": "`limit` minus `used`, never below 0."
                        },
                        "resets_at": {
                          "type": "string",
                          "description": "The next 00:00 UTC.",
                          "format": "date-time"
                        },
                        "ramp_days": {
                          "type": [
                            "integer",
                            "null"
                          ],
                          "description": "How many days the paid ramp lasts; null for `unpaid`."
                        },
                        "lifts_at": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "When the paid ramp ends; null for `unpaid`.",
                          "format": "date-time"
                        }
                      }
                    },
                    "low_balance_credits": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Under this balance you get the `credits.low` webhook and email; null when no threshold is set."
                    },
                    "last_topup": {
                      "type": "number",
                      "description": "The most recent credits added (a purchase, a grant or the welcome credits), `0` when none."
                    },
                    "last_topup_millicredits": {
                      "type": "integer",
                      "description": "`last_topup` in thousandths of a credit."
                    },
                    "spend_14d": {
                      "type": "number",
                      "description": "Credits used in the last 14 days, subaccounts included."
                    },
                    "spend_14d_millicredits": {
                      "type": "integer",
                      "description": "`spend_14d` in thousandths of a credit."
                    },
                    "checkout_available": {
                      "type": "boolean",
                      "description": "Whether credits can be bought online right now (Billing in the dashboard). When false, contact support@send.io."
                    },
                    "object": {
                      "type": "string"
                    },
                    "team_id": {
                      "type": "string"
                    },
                    "shared_with_parent": {
                      "type": "boolean"
                    },
                    "balance": {
                      "type": "number"
                    },
                    "balance_millicredits": {
                      "type": "number"
                    },
                    "purchased": {
                      "type": "number"
                    },
                    "granted": {
                      "type": "number"
                    },
                    "used": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "object": "credit_balance",
                  "team_id": "6a1f0c3e-2b4d-4e8f-9a7c-1d3e5f7a9b0c",
                  "shared_with_parent": false,
                  "balance": 42180.5,
                  "balance_millicredits": 42180500,
                  "purchased": 50000,
                  "granted": 5000,
                  "used": 10819.5,
                  "first_purchase_at": "2026-09-20T09:12:00Z",
                  "low_balance_credits": 1000,
                  "unpaid_daily_limit": null,
                  "daily_limit": {
                    "reason": "ramp",
                    "limit": 5000,
                    "used": 1240,
                    "remaining": 3760,
                    "resets_at": "2026-09-23T00:00:00Z",
                    "ramp_days": 7,
                    "lifts_at": "2026-09-27T09:12:00Z"
                  },
                  "last_topup": 50000,
                  "last_topup_millicredits": 50000000,
                  "last_topup_at": "2026-09-20T09:12:00Z",
                  "spend_14d": 19040,
                  "spend_14d_millicredits": 19040000,
                  "checkout_available": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/billing/pricing": {
      "get": {
        "operationId": "getPricing",
        "summary": "Retrieve pricing",
        "description": "What each service costs in credits, the monthly plans, and the credit packs and custom amount when they are on sale. Public: no API key needed.\n\n- No API key needed on the API host.\n\n- `metered: false` means the service is listed but not charged yet.\n\n- `next_change` announces a scheduled price: the new `credits_per_unit` and when it takes effect. Usage is charged at the price in force when the email was created.\n\n- `monthly.catalog.plans`: the monthly plans. A plan's `credits` are added every billing cycle for `price_cents` a month. A plan with `active: false` is not on sale, and `contact_sales: true` means the price is agreed with sales. Read plans and prices from here: they change with each published `monthly.revision`. The catalog also carries its policy and service rates.\n\n- `monthly.checkout_enabled`: whether plans can be bought online right now.\n\n- `packs` and `custom_amount` are one-time credit purchases, offered only when send.io has them on sale. Otherwise `packs` is empty and `custom_amount.enabled` is `false`, and the other `custom_amount` fields do not apply. When they are on sale, one purchase is one pack, or one custom amount from `custom_amount.min_credits` to `custom_amount.max_credits`.\n\n- `custom_amount.pricing` is `pack_ladder` or `flat`. On the pack ladder a custom amount costs the per-credit rate of the largest pack at or below it (below the smallest pack, that pack's rate), rounded up to the cent, and never more than any larger pack. With `flat` it costs `credits × price_cents_per_1000 / 1000` cents, rounded up to the cent. `GET /billing/pricing/custom` gives the exact price.\n\n- `unpaid_daily_limit`: until your first credit purchase you can send to this many recipients a day (each To, Cc and Bcc address counts as one). Broadcasts count toward this limit, a scheduled email counts on the day it was created, and the count resets at 00:00 UTC. `null`: no such limit.\n\n- `paid_ramp`: after the first purchase, new paid accounts can send to up to `daily_limit` recipients a day for the first `days` days, then there is no daily limit. `null`: no such limit.\n\n- `checkout_available`: whether credits can be bought online right now. It is `false` when online payment is not set up or send.io has checkout switched off; a pack or custom amount purchase is refused then. When it is `false`, contact support@send.io to raise your limit.\n\n- `tax_added_at_checkout`: when `true`, prices are before tax and Stripe adds tax at checkout where it applies. Every purchase gets an invoice.",
        "tags": [
          "Billing"
        ],
        "x-docs-ids": [
          "get-pricing"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "services": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "unit": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "metered": {
                            "type": "boolean"
                          },
                          "credits_per_unit": {
                            "type": "number"
                          },
                          "next_change": {}
                        }
                      }
                    },
                    "monthly": {
                      "type": "object",
                      "properties": {
                        "revision": {
                          "type": "number"
                        },
                        "published_at": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "checkout_enabled": {
                          "type": "boolean"
                        },
                        "catalog": {
                          "type": "object",
                          "properties": {
                            "currency": {
                              "type": "string"
                            },
                            "plans": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "code": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "description": {
                                    "type": "string"
                                  },
                                  "price_cents": {
                                    "type": "number"
                                  },
                                  "credits": {
                                    "type": "number"
                                  },
                                  "active": {
                                    "type": "boolean"
                                  },
                                  "featured": {
                                    "type": "boolean"
                                  },
                                  "contact_sales": {
                                    "type": "boolean"
                                  }
                                }
                              }
                            },
                            "packs": {
                              "type": "array"
                            }
                          }
                        }
                      }
                    },
                    "packs": {
                      "type": "array"
                    },
                    "custom_amount": {
                      "type": "object",
                      "properties": {
                        "enabled": {
                          "type": "boolean"
                        },
                        "min_credits": {
                          "type": "number"
                        },
                        "max_credits": {
                          "type": "number"
                        },
                        "price_cents_per_1000": {
                          "type": "number"
                        },
                        "pricing": {
                          "type": "string"
                        }
                      }
                    },
                    "unpaid_daily_limit": {
                      "type": "number"
                    },
                    "paid_ramp": {
                      "type": "object",
                      "properties": {
                        "daily_limit": {
                          "type": "number"
                        },
                        "days": {
                          "type": "number"
                        }
                      }
                    },
                    "checkout_available": {
                      "type": "boolean"
                    },
                    "tax_added_at_checkout": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "object": "pricing",
                  "currency": "usd",
                  "services": [
                    {
                      "code": "email.sent",
                      "name": "Emails sent",
                      "unit": "recipient",
                      "description": "Each recipient of an email you send (to, cc and bcc).",
                      "metered": true,
                      "credits_per_unit": 1,
                      "next_change": null
                    },
                    {
                      "code": "email.received",
                      "name": "Emails received",
                      "unit": "email",
                      "description": "Inbound email to your domains and inboxes.",
                      "metered": false,
                      "credits_per_unit": 0,
                      "next_change": null
                    },
                    {
                      "code": "agent_inbox",
                      "name": "Agent inbox",
                      "unit": "inbox_month",
                      "description": "Each agent inbox, per month.",
                      "metered": true,
                      "credits_per_unit": 1000,
                      "next_change": null
                    },
                    {
                      "code": "automation.run",
                      "name": "Automation run",
                      "unit": "run",
                      "description": "Each run of an automation that starts (skipped runs are free).",
                      "metered": true,
                      "credits_per_unit": 2,
                      "next_change": null
                    }
                  ],
                  "monthly": {
                    "revision": 12,
                    "published_at": "2026-11-24T06:00:00Z",
                    "checkout_enabled": true,
                    "catalog": {
                      "currency": "usd",
                      "plans": [
                        {
                          "code": "free",
                          "name": "Free",
                          "description": "Experience every feature.",
                          "price_cents": 0,
                          "credits": 5000,
                          "active": true,
                          "featured": false,
                          "contact_sales": false
                        },
                        {
                          "code": "starter",
                          "name": "Starter",
                          "description": "For side projects and your first product.",
                          "price_cents": 1000,
                          "credits": 50000,
                          "active": true,
                          "featured": false,
                          "contact_sales": false
                        },
                        {
                          "code": "pro",
                          "name": "Pro",
                          "description": "For teams sending at high volume.",
                          "price_cents": 2000,
                          "credits": 100000,
                          "active": true,
                          "featured": false,
                          "contact_sales": false
                        },
                        {
                          "code": "scale",
                          "name": "Scale",
                          "description": "For growing SaaS and busy products.",
                          "price_cents": 4000,
                          "credits": 250000,
                          "active": true,
                          "featured": false,
                          "contact_sales": false
                        }
                      ],
                      "packs": []
                    }
                  },
                  "packs": [],
                  "custom_amount": {
                    "enabled": false,
                    "min_credits": 10000,
                    "max_credits": 5000000,
                    "price_cents_per_1000": 0,
                    "pricing": "pack_ladder"
                  },
                  "unpaid_daily_limit": 100,
                  "paid_ramp": {
                    "daily_limit": 5000,
                    "days": 7
                  },
                  "checkout_available": true,
                  "tax_added_at_checkout": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        },
        "security": []
      }
    },
    "/billing/pricing/custom": {
      "get": {
        "operationId": "getCustomPrice",
        "summary": "Price a custom amount",
        "description": "The exact price of buying a custom number of credits: the amount the checkout charges, before tax.\n\n- Priced as `custom_amount.pricing` says ([Retrieve pricing](/docs/api#get-pricing)): on the pack ladder, the per-credit rate of the largest pack at or below the amount, rounded up to the cent and never more than any larger pack; with `flat`, `price_cents_per_1000` per 1,000 credits, rounded up to the cent.\n\n- Needs an API key, unlike Retrieve pricing.\n\n- Answers 422 `validation_error` when `credits` is missing or not a whole number, is outside the custom amount range, or custom amounts are turned off.",
        "tags": [
          "Billing"
        ],
        "x-docs-ids": [
          "get-custom-price"
        ],
        "parameters": [
          {
            "name": "credits",
            "in": "query",
            "required": true,
            "description": "How many credits, a whole number within `custom_amount.min_credits` and `max_credits` of [Retrieve pricing](/docs/api#get-pricing).",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string",
                      "description": "Always `custom_price`."
                    },
                    "credits": {
                      "type": "integer",
                      "description": "The amount you asked about."
                    },
                    "price_cents": {
                      "type": "integer",
                      "description": "The price in cents, before tax."
                    },
                    "currency": {
                      "type": "string",
                      "description": "The price's currency (`usd`)."
                    },
                    "based_on_pack_id": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The pack whose per-credit rate priced it on the pack ladder, or null with flat pricing."
                    }
                  }
                },
                "example": {
                  "object": "custom_price",
                  "credits": 25000,
                  "price_cents": 2500,
                  "currency": "usd",
                  "based_on_pack_id": "4b8e2a1c-6d3f-4e5a-9b7c-0d2e4f6a8b1c"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/billing/transactions": {
      "get": {
        "operationId": "listCreditTransactions",
        "summary": "List transactions",
        "description": "Every change to the balance, newest first: purchases, grants, usage, refunds and corrections.\n\n- `amount` is signed: negative for usage and other debits. `source_team_id` is the team or subaccount whose usage it was.",
        "tags": [
          "Billing"
        ],
        "x-docs-ids": [
          "list-credit-transactions"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many to return, 1 to 100. Default 20.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "The `id` of the last item of the previous page (the next, older page). Use it while `has_more` is true. Cannot be combined with `before`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "description": "The `id` of the first item of the page you have (the previous, newer page). Cannot be combined with `after`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "description": "Only this kind: `welcome`, `purchase`, `grant`, `adjustment`, `usage`, `refund`, `migration` or `reversal`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "object": {
                            "type": "string",
                            "description": "Always `credit_transaction`."
                          },
                          "id": {
                            "type": "string",
                            "description": "The transaction id; use it as the `after` or `before` cursor."
                          },
                          "kind": {
                            "type": "string",
                            "description": "`welcome`, `purchase`, `grant`, `adjustment`, `usage`, `refund`, `migration` or `reversal`."
                          },
                          "amount": {
                            "type": "number",
                            "description": "Credits added (positive) or taken (negative), up to 3 decimals."
                          },
                          "balance_after": {
                            "type": "number",
                            "description": "The balance right after this transaction."
                          },
                          "service": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The service a usage row is for (`email.sent`), or null for other kinds."
                          },
                          "quantity": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "Units used, or null for other kinds."
                          },
                          "unit_credits": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Credits per unit, or null for other kinds."
                          },
                          "source_team_id": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The team or subaccount whose usage it was, or null."
                          },
                          "actor_type": {
                            "type": "string",
                            "description": "Who made the change: `system` (usage, welcome credits), `stripe` (purchases), `admin` (send.io support: grants, refunds, corrections) or `customer`."
                          },
                          "reason": {
                            "type": "string",
                            "description": "Why a grant, refund or correction was made; an empty string when none."
                          },
                          "reference": {
                            "type": "string",
                            "description": "What it belongs to, such as a purchase, a support ticket or the UTC day (`YYYY-MM-DD`) of a daily charge (agent inboxes); an empty string when none."
                          },
                          "created_at": {
                            "type": "string",
                            "description": "When it was recorded.",
                            "format": "date-time"
                          }
                        }
                      }
                    },
                    "object": {
                      "type": "string"
                    },
                    "has_more": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "has_more": true,
                  "data": [
                    {
                      "object": "credit_transaction",
                      "id": "c0a8e1f2-3b4d-4c5e-8f6a-7b8c9d0e1f2a",
                      "kind": "usage",
                      "amount": -120,
                      "balance_after": 42180.5,
                      "service": "email.sent",
                      "quantity": 120,
                      "unit_credits": 1,
                      "source_team_id": "6a1f0c3e-2b4d-4e8f-9a7c-1d3e5f7a9b0c",
                      "actor_type": "system",
                      "reason": "",
                      "reference": "",
                      "created_at": "2026-10-08T14:03:11.204Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/billing/usage": {
      "get": {
        "operationId": "getCreditUsage",
        "summary": "Retrieve usage",
        "description": "Credits used per day and service, with totals for the period.\n\n- Days are UTC. Days without usage are left out.",
        "tags": [
          "Billing"
        ],
        "x-docs-ids": [
          "get-credit-usage"
        ],
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "required": false,
            "description": "How many days back, up to 365. Default 30.",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "days": {
                      "type": "number"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "date": {
                            "type": "string"
                          },
                          "service": {
                            "type": "string"
                          },
                          "quantity": {
                            "type": "number"
                          },
                          "credits": {
                            "type": "number"
                          }
                        }
                      }
                    },
                    "totals": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "service": {
                            "type": "string"
                          },
                          "quantity": {
                            "type": "number"
                          },
                          "credits": {
                            "type": "number"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "usage",
                  "days": 30,
                  "data": [
                    {
                      "date": "2026-10-07",
                      "service": "email.sent",
                      "quantity": 860,
                      "credits": 860
                    },
                    {
                      "date": "2026-10-08",
                      "service": "email.sent",
                      "quantity": 1240,
                      "credits": 1240
                    }
                  ],
                  "totals": [
                    {
                      "service": "email.sent",
                      "quantity": 20300,
                      "credits": 20300
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/usage": {
      "get": {
        "operationId": "getAccountUsage",
        "summary": "Retrieve account usage and limits",
        "description": "What the account has used against its limits: emails sent today and this billing period, contacts, segments, broadcasts, domains, automation runs and the API rate limit. The SDKs' `usage.get()` calls it.\n\n- `emails.*.used` and `sent` count emails sent; `received` counts inbound email, which does not count against the limit. The daily window is the UTC day.\n\n- A parent account's numbers include its subaccounts', as its limits do. A subaccount with its own limits sees its own numbers and limits.\n\n- `ai_credits` is always 0 with no limit: no send.io service spends AI credits. It is kept so SDK models read the same shape.\n\n- `rate_limit.limit` is the requests per second allowed for your team.\n\n- For credits used per day and service, see [Retrieve usage](#get-credit-usage) (`GET /billing/usage`).",
        "tags": [
          "Billing"
        ],
        "x-docs-ids": [
          "get-account-usage"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "emails": {
                      "type": "object",
                      "properties": {
                        "daily": {
                          "type": "object",
                          "properties": {
                            "limit": {
                              "type": [
                                "number",
                                "null"
                              ],
                              "description": "Emails per day, or null when there is no daily limit."
                            },
                            "resets_at": {
                              "type": "string",
                              "description": "The next 00:00 UTC.",
                              "format": "date-time"
                            },
                            "used": {
                              "type": "number"
                            },
                            "sent": {
                              "type": "number"
                            },
                            "received": {
                              "type": "number"
                            }
                          }
                        },
                        "monthly": {
                          "type": "object",
                          "properties": {
                            "limit": {
                              "type": "number",
                              "description": "Emails per billing period."
                            },
                            "resets_at": {
                              "type": "string",
                              "description": "The end of the billing period.",
                              "format": "date-time"
                            },
                            "used": {
                              "type": "number"
                            },
                            "sent": {
                              "type": "number"
                            },
                            "received": {
                              "type": "number"
                            }
                          }
                        }
                      }
                    },
                    "contacts": {
                      "type": "object",
                      "properties": {
                        "limit": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "Always null: contacts have no limit."
                        },
                        "used": {
                          "type": "number"
                        }
                      }
                    },
                    "segments": {
                      "type": "object",
                      "properties": {
                        "limit": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "Always null: segments have no limit."
                        },
                        "used": {
                          "type": "number"
                        }
                      }
                    },
                    "broadcasts": {
                      "type": "object",
                      "properties": {
                        "limit": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "Always null: broadcasts have no limit."
                        },
                        "used": {
                          "type": "number"
                        }
                      }
                    },
                    "domains": {
                      "type": "object",
                      "properties": {
                        "limit": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "The plan's domain limit."
                        },
                        "used": {
                          "type": "number"
                        }
                      }
                    },
                    "automation_runs": {
                      "type": "object",
                      "properties": {
                        "limit": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "Always null: automation runs have no limit."
                        },
                        "used": {
                          "type": "number"
                        },
                        "resets_at": {
                          "type": "string",
                          "format": "date-time"
                        }
                      }
                    },
                    "ai_credits": {
                      "type": "object",
                      "properties": {
                        "limit": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "Always null."
                        },
                        "next_increase_at": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Always null.",
                          "format": "date-time"
                        },
                        "used": {
                          "type": "number"
                        }
                      }
                    },
                    "object": {
                      "type": "string"
                    },
                    "rate_limit": {
                      "type": "object",
                      "properties": {
                        "limit": {
                          "type": "number"
                        },
                        "duration": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "usage",
                  "emails": {
                    "daily": {
                      "used": 120,
                      "limit": 1000,
                      "sent": 120,
                      "received": 4,
                      "resets_at": "2026-10-08T00:00:00Z"
                    },
                    "monthly": {
                      "used": 18250,
                      "limit": 50000,
                      "sent": 18250,
                      "received": 96,
                      "resets_at": "2026-10-31T00:00:00Z"
                    }
                  },
                  "contacts": {
                    "used": 4200,
                    "limit": null
                  },
                  "segments": {
                    "used": 6,
                    "limit": null
                  },
                  "broadcasts": {
                    "used": 14,
                    "limit": null
                  },
                  "domains": {
                    "used": 2,
                    "limit": 10
                  },
                  "automation_runs": {
                    "used": 310,
                    "limit": null,
                    "resets_at": "2026-10-31T00:00:00Z"
                  },
                  "ai_credits": {
                    "used": 0,
                    "limit": null,
                    "next_increase_at": null
                  },
                  "rate_limit": {
                    "limit": 10,
                    "duration": "1000ms"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/billing/purchases": {
      "get": {
        "operationId": "listCreditPurchases",
        "summary": "List purchases",
        "description": "Credit purchases with their payment status, Stripe invoice and receipt, newest first.\n\n- `status`: `pending`, `paid`, `failed`, `canceled`, `refunded` or `partially_refunded`. Credits are bought in the dashboard (Settings, Billing).\n\n- `amount_cents` is the price of the credits, before tax and discounts. `total_cents` is what was paid, with `tax_cents` added and `discount_cents` taken off. They are `null` until Stripe reports the payment. A promotion code never reduces the credits you get.\n\n- `invoice_url` and `invoice_pdf_url`: the Stripe invoice of the purchase, once it is paid.",
        "tags": [
          "Billing"
        ],
        "x-docs-ids": [
          "list-credit-purchases"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many to return, 1 to 100. Default 20.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "The `id` of the last item of the previous page (the next, older page). Use it while `has_more` is true. Cannot be combined with `before`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "description": "The `id` of the first item of the page you have (the previous, newer page). Cannot be combined with `after`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "pack_id": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The credit pack bought, or null for any other purchase. Packs are offered only when send.io has them on sale."
                          },
                          "refunded_cents": {
                            "type": "integer",
                            "description": "How much of the payment has been refunded, in cents. `0` when none."
                          },
                          "receipt_url": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The Stripe receipt, or null until the payment succeeds."
                          },
                          "total_cents": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "What was paid, tax included and discounts taken off; null until Stripe reports the payment."
                          },
                          "tax_cents": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "Tax on the purchase; null until Stripe reports the payment."
                          },
                          "discount_cents": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "Discount from a promotion code; null until Stripe reports the payment."
                          },
                          "invoice_url": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The Stripe invoice page, or null until it is paid."
                          },
                          "invoice_pdf_url": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The Stripe invoice PDF, or null until it is paid."
                          },
                          "paid_at": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "When the payment succeeded, or null.",
                            "format": "date-time"
                          },
                          "object": {
                            "type": "string"
                          },
                          "id": {
                            "type": "string"
                          },
                          "credits": {
                            "type": "number"
                          },
                          "amount_cents": {
                            "type": "number"
                          },
                          "currency": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    },
                    "object": {
                      "type": "string"
                    },
                    "has_more": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "object": "list",
                  "has_more": false,
                  "data": [
                    {
                      "object": "credit_purchase",
                      "id": "e3f4a5b6-c7d8-4e9f-a0b1-c2d3e4f5a6b7",
                      "pack_id": "9c1d3e5f-7a2b-4c6d-8e0f-1a3b5c7d9e2f",
                      "credits": 50000,
                      "amount_cents": 4000,
                      "currency": "usd",
                      "status": "paid",
                      "refunded_cents": 0,
                      "receipt_url": "https://pay.stripe.com/receipts/...",
                      "total_cents": 4800,
                      "tax_cents": 800,
                      "discount_cents": 0,
                      "invoice_url": "https://invoice.stripe.com/i/...",
                      "invoice_pdf_url": "https://pay.stripe.com/invoice/.../pdf",
                      "created_at": "2026-09-20T09:10:02Z",
                      "paid_at": "2026-09-20T09:12:00Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/reputation": {
      "get": {
        "operationId": "getReputation",
        "summary": "Retrieve sending reputation",
        "description": "The team's reputation state, since when, its volume tier, the worst rate against its limit, both windows, and today's bulk (broadcast and automation) cap.\n\n- `state`: `healthy`, `warning` or `suspended`. A subaccount whose parent is suspended reads `suspended` with `suspended_by_parent: true`.\n\n- `worst`: the measure closest to its limit. `judged: \"rates\"` compares `value` with `limit` (fractions: 0.05 is 5%); `judged: \"counts\"` (small senders, or few events) compares `count` with `count_limit`.\n\n- `since`, `evaluated_at`, `tier`, `accepted_30d`, `limits` and `worst` are `null`, and `windows` is `{}`, until the team is first evaluated.\n\n- `subaccount_suspended`: this subaccount itself is suspended, by send.io or by its parent account. Its sends answer 403 `subaccount_suspended`.\n\n- `bulk`: today's (UTC) cap on broadcast and automation recipients; recipients over it are sent the next day.",
        "tags": [
          "Sending reputation"
        ],
        "x-docs-ids": [
          "get-reputation"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "since": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "When the team entered this state, or null before the first evaluation."
                    },
                    "suspended_by_parent": {
                      "type": "boolean",
                      "description": "The parent account is suspended, so this subaccount reads `suspended` too."
                    },
                    "subaccount_suspended": {
                      "type": "boolean",
                      "description": "This subaccount itself is suspended (by send.io or its parent): its sends answer 403 `subaccount_suspended`. Always false for a main account."
                    },
                    "evaluated_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "When the rates were last computed, or null before the first evaluation.",
                      "format": "date-time"
                    },
                    "tier": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The volume tier, or null before the first evaluation."
                    },
                    "accepted_30d": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Emails accepted in the last 30 days, or null before the first evaluation."
                    },
                    "limits": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The tier's limits, or null before the first evaluation.",
                      "properties": {
                        "bounce_rate": {
                          "type": "number"
                        },
                        "complaint_rate": {
                          "type": "number"
                        },
                        "warning_fraction": {
                          "type": "number"
                        }
                      }
                    },
                    "worst": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The measure closest to its limit, or null before the first evaluation.",
                      "properties": {
                        "window": {
                          "type": "string"
                        },
                        "metric": {
                          "type": "string"
                        },
                        "judged": {
                          "type": "string"
                        },
                        "value": {
                          "type": "number"
                        },
                        "limit": {
                          "type": "number"
                        },
                        "count": {
                          "type": "number"
                        },
                        "count_limit": {
                          "type": "number"
                        },
                        "accepted": {
                          "type": "number"
                        },
                        "level": {
                          "type": "string"
                        },
                        "ratio": {
                          "type": "number"
                        }
                      }
                    },
                    "windows": {
                      "type": "object",
                      "description": "Keys `24h` and `7d`, each present once that window has been evaluated. `{}` before the first evaluation.",
                      "properties": {
                        "24h": {
                          "type": "object",
                          "description": "The last 24 hours. Left out before the first evaluation.",
                          "properties": {
                            "worst": {
                              "type": [
                                "object",
                                "null"
                              ],
                              "description": "The window's measure closest to its limit, or null."
                            },
                            "accepted": {
                              "type": "number"
                            },
                            "hard_bounces": {
                              "type": "number"
                            },
                            "complaints": {
                              "type": "number"
                            },
                            "bounce_rate": {
                              "type": "number"
                            },
                            "complaint_rate": {
                              "type": "number"
                            },
                            "judged": {
                              "type": "string"
                            },
                            "level": {
                              "type": "string"
                            }
                          }
                        },
                        "7d": {
                          "type": "object",
                          "description": "The last 7 days. Left out before the first evaluation.",
                          "properties": {
                            "worst": {
                              "type": [
                                "object",
                                "null"
                              ],
                              "description": "The window's measure closest to its limit, or null."
                            },
                            "accepted": {
                              "type": "number"
                            },
                            "hard_bounces": {
                              "type": "number"
                            },
                            "complaints": {
                              "type": "number"
                            },
                            "bounce_rate": {
                              "type": "number"
                            },
                            "complaint_rate": {
                              "type": "number"
                            },
                            "judged": {
                              "type": "string"
                            },
                            "level": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "object": {
                      "type": "string"
                    },
                    "state": {
                      "type": "string"
                    },
                    "bulk": {
                      "type": "object",
                      "properties": {
                        "day": {
                          "type": "string"
                        },
                        "daily_cap": {
                          "type": "number"
                        },
                        "sent_today": {
                          "type": "number"
                        },
                        "remaining": {
                          "type": "number"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "object": "sending_reputation",
                  "state": "warning",
                  "since": "2026-10-14T09:05:00Z",
                  "suspended_by_parent": false,
                  "subaccount_suspended": false,
                  "evaluated_at": "2026-10-14T14:00:00Z",
                  "tier": "medium",
                  "accepted_30d": 18250,
                  "limits": {
                    "bounce_rate": 0.05,
                    "complaint_rate": 0.0008,
                    "warning_fraction": 0.8
                  },
                  "worst": {
                    "window": "24h",
                    "metric": "bounce_rate",
                    "judged": "rates",
                    "value": 0.042,
                    "limit": 0.05,
                    "count": 42,
                    "count_limit": 15,
                    "accepted": 1000,
                    "level": "warning",
                    "ratio": 0.84
                  },
                  "windows": {
                    "24h": {
                      "accepted": 1000,
                      "hard_bounces": 42,
                      "complaints": 0,
                      "bounce_rate": 0.042,
                      "complaint_rate": 0,
                      "judged": "rates",
                      "level": "warning",
                      "worst": null
                    },
                    "7d": {
                      "accepted": 5200,
                      "hard_bounces": 61,
                      "complaints": 1,
                      "bounce_rate": 0.011731,
                      "complaint_rate": 0.000192,
                      "judged": "rates",
                      "level": "healthy",
                      "worst": null
                    }
                  },
                  "bulk": {
                    "day": "2026-10-14",
                    "daily_cap": 4000,
                    "sent_today": 1200,
                    "remaining": 2800
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/inboxes": {
      "get": {
        "operationId": "amListInboxes",
        "summary": "List inboxes",
        "description": "Lists the inboxes in your organization, newest first.\n\n- `next_page_token` is only present when there is another page.\n\n- A key scoped to one inbox or pod only sees the inboxes it can reach.",
        "tags": [
          "Inboxes (Agent inboxes)"
        ],
        "x-docs-ids": [
          "am-list-inboxes"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Items per page, 1 to 100. Default 50. Other values answer 422.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "required": false,
            "description": "The `next_page_token` from the previous page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "number"
                    },
                    "limit": {
                      "type": "number"
                    },
                    "inboxes": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "pod_id": {
                            "type": "string"
                          },
                          "inbox_id": {
                            "type": "string"
                          },
                          "email": {
                            "type": "string"
                          },
                          "display_name": {
                            "type": "string"
                          },
                          "client_id": {
                            "type": "string"
                          },
                          "metadata": {
                            "type": "object",
                            "properties": {
                              "team": {
                                "type": "string"
                              }
                            }
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updated_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "count": 1,
                  "limit": 50,
                  "inboxes": [
                    {
                      "pod_id": "default",
                      "inbox_id": "support@acme.com",
                      "email": "support@acme.com",
                      "display_name": "Acme Support",
                      "client_id": "support-inbox-1",
                      "metadata": {
                        "team": "support"
                      },
                      "created_at": "2026-10-01T09:12:44.512Z",
                      "updated_at": "2026-10-01T09:12:44.512Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "post": {
        "operationId": "amCreateInbox",
        "summary": "Create inbox",
        "description": "Creates an inbox. Leave out `username` for a random address. Leave out `domain` for a free mailbox on your workspace's sendiomail.com address.\n\n- Which free domain is which: name@<org>.sendiomail.com is your workspace's free mailbox, made here when you give no domain (GET https://api.send.io/agent-domain returns it as `free_mailbox_domain`). name@org.sendioinbox.com is the no-signup agent mailbox (/docs/agent-mailbox), made with no account and sealed to its key; claimed into a workspace it keeps its sendioinbox.com address and counts as one of the workspace's free mailboxes.\n\n- send.io extension: `credentials` (an IMAP/SMTP login; the password is an API key scoped to this inbox, shown only once) is returned for an inbox on your own domain or the shared agent domain. A free mailbox has no IMAP or SMTP login: it has no `credentials` and its `imap_smtp` is `unavailable`. Use the API, MCP or the Unibox with it.\n\n- On the shared agent domain, reserved usernames (abuse, postmaster, support, admin, noreply and similar) are refused. A free mailbox's org label and a company subdomain belong to your workspace alone, so there only mail-system names (abuse, postmaster, hostmaster, webmaster, mailer-daemon, root) are refused.\n\n- Returns 409 when the address is taken, and 403 when the domain is not verified for your team.\n\n- With a scoped key, only a pod-scoped key can create inboxes (always in its own pod).",
        "tags": [
          "Inboxes (Agent inboxes)"
        ],
        "x-docs-ids": [
          "am-create-inbox"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "username": {
                    "type": "string",
                    "description": "On a free mailbox (the default, no `domain` given): a-z, 0-9, dot and dash, 2 to 32 characters, not starting or ending with a dot or dash. On your own domain or the shared agent domain: a-z, 0-9, dot, dash, underscore and plus, 1 to 64 characters. Random when left out."
                  },
                  "domain": {
                    "type": "string",
                    "description": "Leave it out for a free mailbox at name@<org>.sendiomail.com (the label is your workspace's own; free mailboxes have no IMAP or SMTP login). Or give a domain verified for sending on your team, the shared agent domain (agents.send.io), or a company subdomain of it (acme.agents.send.io). GET https://api.send.io/agent-domain (the send.io API, not under /v0) names both domains."
                  },
                  "display_name": {
                    "type": "string",
                    "description": "The sender name shown on mail from this inbox."
                  },
                  "client_id": {
                    "type": "string",
                    "description": "Your own ID for the inbox. If an inbox with this client ID exists, it is returned instead of a new one."
                  },
                  "pod_id": {
                    "type": "string",
                    "description": "Put the inbox in this pod."
                  },
                  "metadata": {
                    "type": "object",
                    "description": "Any JSON object to keep with the inbox."
                  }
                }
              },
              "example": {
                "username": "support",
                "domain": "acme.com",
                "display_name": "Acme Support",
                "client_id": "support-inbox-1"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "pod_id": {
                      "type": "string"
                    },
                    "inbox_id": {
                      "type": "string"
                    },
                    "email": {
                      "type": "string"
                    },
                    "display_name": {
                      "type": "string"
                    },
                    "client_id": {
                      "type": "string"
                    },
                    "metadata": {
                      "type": "object"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "credentials": {
                      "type": "object",
                      "properties": {
                        "username": {
                          "type": "string"
                        },
                        "password": {
                          "type": "string"
                        },
                        "imap": {
                          "type": "object",
                          "properties": {
                            "host": {
                              "type": "string"
                            },
                            "port": {
                              "type": "number"
                            },
                            "security": {
                              "type": "string"
                            }
                          }
                        },
                        "smtp": {
                          "type": "object",
                          "properties": {
                            "host": {
                              "type": "string"
                            },
                            "port": {
                              "type": "number"
                            },
                            "security": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "pod_id": "default",
                  "inbox_id": "support@acme.com",
                  "email": "support@acme.com",
                  "display_name": "Acme Support",
                  "client_id": "support-inbox-1",
                  "metadata": {},
                  "created_at": "2026-10-01T09:12:44.512Z",
                  "updated_at": "2026-10-01T09:12:44.512Z",
                  "credentials": {
                    "username": "support@acme.com",
                    "password": "sk_live_9f8e7d6c5b4a3f2e1d0c9b8a",
                    "imap": {
                      "host": "imap.send.io",
                      "port": 993,
                      "security": "ssl"
                    },
                    "smtp": {
                      "host": "smtp.send.io",
                      "port": 587,
                      "security": "starttls"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/inboxes/search": {
      "get": {
        "operationId": "amSearchInboxes",
        "summary": "Search inboxes",
        "description": "Lists inboxes whose address, display name or client ID contains the search text.\n\n- send.io extension.",
        "tags": [
          "Inboxes (Agent inboxes)"
        ],
        "x-docs-ids": [
          "am-search-inboxes"
        ],
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Text to look for (case-insensitive). `query` is accepted as an alias.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Items per page, 1 to 100. Default 50. Other values answer 422.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "required": false,
            "description": "The `next_page_token` from the previous page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "number"
                    },
                    "limit": {
                      "type": "number"
                    },
                    "inboxes": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "pod_id": {
                            "type": "string"
                          },
                          "inbox_id": {
                            "type": "string"
                          },
                          "email": {
                            "type": "string"
                          },
                          "display_name": {
                            "type": "string"
                          },
                          "client_id": {
                            "type": "string"
                          },
                          "metadata": {
                            "type": "object",
                            "properties": {
                              "team": {
                                "type": "string"
                              }
                            }
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updated_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "count": 1,
                  "limit": 50,
                  "inboxes": [
                    {
                      "pod_id": "default",
                      "inbox_id": "support@acme.com",
                      "email": "support@acme.com",
                      "display_name": "Acme Support",
                      "client_id": "support-inbox-1",
                      "metadata": {
                        "team": "support"
                      },
                      "created_at": "2026-10-01T09:12:44.512Z",
                      "updated_at": "2026-10-01T09:12:44.512Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/inboxes/{inbox_id}": {
      "get": {
        "operationId": "amGetInbox",
        "summary": "Get inbox",
        "description": "Gets one inbox.",
        "tags": [
          "Inboxes (Agent inboxes)"
        ],
        "x-docs-ids": [
          "am-get-inbox"
        ],
        "parameters": [
          {
            "name": "inbox_id",
            "in": "path",
            "required": true,
            "description": "The inbox's email address (for example support@acme.com). The inbox's send.io UUID also works.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "pod_id": {
                      "type": "string"
                    },
                    "inbox_id": {
                      "type": "string"
                    },
                    "email": {
                      "type": "string"
                    },
                    "display_name": {
                      "type": "string"
                    },
                    "client_id": {
                      "type": "string"
                    },
                    "metadata": {
                      "type": "object",
                      "properties": {
                        "team": {
                          "type": "string"
                        }
                      }
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "pod_id": "default",
                  "inbox_id": "support@acme.com",
                  "email": "support@acme.com",
                  "display_name": "Acme Support",
                  "client_id": "support-inbox-1",
                  "metadata": {
                    "team": "support"
                  },
                  "created_at": "2026-10-01T09:12:44.512Z",
                  "updated_at": "2026-10-01T09:12:44.512Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "patch": {
        "operationId": "amUpdateInbox",
        "summary": "Update inbox",
        "description": "Changes an inbox's display name, metadata or message retention.\n\n- `metadata` is merged with what is stored, not replaced.\n\n- send.io extension: `message_ttl_hours`.",
        "tags": [
          "Inboxes (Agent inboxes)"
        ],
        "x-docs-ids": [
          "am-update-inbox"
        ],
        "parameters": [
          {
            "name": "inbox_id",
            "in": "path",
            "required": true,
            "description": "The inbox's email address (for example support@acme.com). The inbox's send.io UUID also works.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "display_name": {
                    "type": "string",
                    "description": "New sender name. Up to 100 characters, no quotes, angle brackets or line breaks."
                  },
                  "metadata": {
                    "type": "object",
                    "description": "Keys to merge into the inbox's metadata.",
                    "properties": {
                      "tier": {
                        "type": "string"
                      }
                    }
                  },
                  "message_ttl_hours": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "description": "Delete messages after this many hours (1 to 8760). Send 0 or null to keep them forever."
                  }
                }
              },
              "example": {
                "display_name": "Acme Help Desk",
                "metadata": {
                  "tier": "priority"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "pod_id": {
                      "type": "string"
                    },
                    "inbox_id": {
                      "type": "string"
                    },
                    "email": {
                      "type": "string"
                    },
                    "display_name": {
                      "type": "string"
                    },
                    "client_id": {
                      "type": "string"
                    },
                    "metadata": {
                      "type": "object",
                      "properties": {
                        "team": {
                          "type": "string"
                        },
                        "tier": {
                          "type": "string"
                        }
                      }
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "pod_id": "default",
                  "inbox_id": "support@acme.com",
                  "email": "support@acme.com",
                  "display_name": "Acme Help Desk",
                  "client_id": "support-inbox-1",
                  "metadata": {
                    "team": "support",
                    "tier": "priority"
                  },
                  "created_at": "2026-10-01T09:12:44.512Z",
                  "updated_at": "2026-10-01T09:12:44.512Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "delete": {
        "operationId": "amDeleteInbox",
        "summary": "Delete inbox",
        "description": "Deletes an inbox. The address stops receiving mail and pending drafts are discarded. Existing threads stay readable.",
        "tags": [
          "Inboxes (Agent inboxes)"
        ],
        "x-docs-ids": [
          "am-delete-inbox"
        ],
        "parameters": [
          {
            "name": "inbox_id",
            "in": "path",
            "required": true,
            "description": "The inbox's email address (for example support@acme.com). The inbox's send.io UUID also works.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "keep_mailbox",
            "in": "query",
            "required": false,
            "description": "send.io extension: keep the address as a plain mailbox (IMAP/SMTP still work). Not allowed for addresses on the shared agent domain.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {}
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/inboxes/{inbox_id}/authorize": {
      "post": {
        "operationId": "amAuthorizeSignIn",
        "summary": "Approve sign-in",
        "description": "Approves a \"Sign in with AgentID\" request for this inbox, so the agent can log in to a third-party app with its email address.\n\n- Part of AgentID (sign in with an agent identity).\n\n- Returns 404 when the sign-in does not exist, expired or was already approved. Any key that can reach the inbox may approve; no permission is needed.",
        "tags": [
          "Inboxes (Agent inboxes)"
        ],
        "x-docs-ids": [
          "am-authorize-sign-in"
        ],
        "parameters": [
          {
            "name": "inbox_id",
            "in": "path",
            "required": true,
            "description": "The inbox's email address (for example support@acme.com). The inbox's send.io UUID also works.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "auth_token": {
                    "type": "string",
                    "description": "The sign-in token the app gave the agent."
                  },
                  "accept_disclosure": {
                    "type": "boolean",
                    "description": "Must be true when the app asks for the owner's name or email."
                  }
                },
                "required": [
                  "auth_token"
                ]
              },
              "example": {
                "auth_token": "atk_4f9b2c7e1d8a6b3c5e0f"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "client": {
                      "type": "object",
                      "properties": {
                        "client_id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        }
                      }
                    },
                    "scope": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "status": "approved",
                  "client": {
                    "client_id": "app_7c2e9b4f",
                    "name": "Northwind CRM"
                  },
                  "scope": "openid email profile"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/inboxes/{inbox_id}/id-jag": {
      "post": {
        "operationId": "amIdJag",
        "summary": "Get an ID-JAG",
        "description": "Mints a 5 minute identity assertion (ID-JAG) for another auth.md service, so this agent can register there without a sign-up form. The service must trust send.io's issuer.\n\n- send.io extension (AgentID as an auth.md agent provider). Send assertion to identity_endpoint as type identity_assertion.\n\n- Claims: sub is the agent, email and email_verified are its verified human, auth_time is when the human last signed in to send.io or verified the agent. Signed RS256 with the AgentID keys (/v0/jwks.json).\n\n- 403 when the agent has no verified human. 422 when the audience has no auth.md discovery. 60 per hour per inbox. Any key that can reach the inbox may call it.",
        "tags": [
          "Inboxes (Agent inboxes)"
        ],
        "x-docs-ids": [
          "am-id-jag"
        ],
        "parameters": [
          {
            "name": "inbox_id",
            "in": "path",
            "required": true,
            "description": "The inbox's email address (for example support@acme.com). The inbox's send.io UUID also works.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "audience": {
                    "type": "string",
                    "description": "The service's issuer, from its /.well-known/oauth-authorization-server. send.io reads that document and refuses services without auth.md registration."
                  },
                  "client_id": {
                    "type": "string",
                    "description": "Your client id at the service, when you have one. Default: the agent's opaque id."
                  }
                },
                "required": [
                  "audience"
                ]
              },
              "example": {
                "audience": "https://auth.example.com"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "assertion": {
                      "type": "string"
                    },
                    "assertion_type": {
                      "type": "string"
                    },
                    "expires_in": {
                      "type": "number"
                    },
                    "audience": {
                      "type": "string"
                    },
                    "identity_endpoint": {
                      "type": "string"
                    },
                    "sub": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "assertion": "eyJhbGciOiJSUzI1NiIsInR5cCI6Im9hdXRoLWlkLWphZytqd3QiLCJraWQiOiJhaWQtMWE...",
                  "assertion_type": "urn:ietf:params:oauth:token-type:id-jag",
                  "expires_in": 300,
                  "audience": "https://auth.example.com",
                  "identity_endpoint": "https://auth.example.com/agent/identity",
                  "sub": "Qm9vdHN0cmFwcGVkLWFnZW50LWlkLWV4YW1wbGU"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "delete": {
        "operationId": "amIdJagRevoke",
        "summary": "End ID-JAG delegations",
        "description": "Tells every service this agent registered at with an ID-JAG that the delegation ended (a Security Event Token to each service's events endpoint), and forgets them. Deleting the inbox does the same.\n\n- services counts the services the agent had assertions for; notified counts those that accepted the event.",
        "tags": [
          "Inboxes (Agent inboxes)"
        ],
        "x-docs-ids": [
          "am-id-jag-revoke"
        ],
        "parameters": [
          {
            "name": "inbox_id",
            "in": "path",
            "required": true,
            "description": "The inbox's email address (for example support@acme.com). The inbox's send.io UUID also works.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "services": {
                      "type": "number"
                    },
                    "notified": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "services": 2,
                  "notified": 2
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/inboxes/{inbox_id}/messages": {
      "get": {
        "operationId": "amListMessages",
        "summary": "List messages",
        "description": "Lists the inbox's sent and received messages, newest first. Bodies are left out; get one message for them.\n\n- System labels (`received`, `sent`, `unread`, `spam`, `trash`, `delivered`, `bounced`, `complained`, `failed`, `opened`) are worked out from the message state. Custom labels are stored as given.\n\n- Covers the newest 2,000 messages of the inbox.\n\n- `bcc` is always an empty list in listed messages.",
        "tags": [
          "Messages"
        ],
        "x-docs-ids": [
          "am-list-messages"
        ],
        "parameters": [
          {
            "name": "inbox_id",
            "in": "path",
            "required": true,
            "description": "The inbox's email address (for example support@acme.com). The inbox's send.io UUID also works.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Items per page, 1 to 100. Default 50. Other values answer 422.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "required": false,
            "description": "The `next_page_token` from the previous page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "labels",
            "in": "query",
            "required": false,
            "description": "Only items that have all of these labels. Send a JSON array (labels=[\"unread\"]), a comma list, or repeat the parameter.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "description": "Only items before this RFC 3339 time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "Only items after this RFC 3339 time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ascending",
            "in": "query",
            "required": false,
            "description": "Oldest first when true. Default is newest first.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "include_spam",
            "in": "query",
            "required": false,
            "description": "Include spam. Hidden by default unless you ask for the spam label.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "include_trash",
            "in": "query",
            "required": false,
            "description": "Include trash. Hidden by default unless you ask for the trash label.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "send.io extension: only messages whose sender contains this text.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "send.io extension: only messages whose To or CC contains this text.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subject",
            "in": "query",
            "required": false,
            "description": "send.io extension: only messages whose subject contains this text.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "number"
                    },
                    "limit": {
                      "type": "number"
                    },
                    "next_page_token": {
                      "type": "string"
                    },
                    "messages": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "inbox_id": {
                            "type": "string"
                          },
                          "thread_id": {
                            "type": "string"
                          },
                          "message_id": {
                            "type": "string"
                          },
                          "labels": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "timestamp": {
                            "type": "string"
                          },
                          "from": {
                            "type": "string"
                          },
                          "to": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "cc": {
                            "type": "array"
                          },
                          "bcc": {
                            "type": "array"
                          },
                          "reply_to": {
                            "type": "array"
                          },
                          "subject": {
                            "type": "string"
                          },
                          "preview": {
                            "type": "string"
                          },
                          "attachments": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "attachment_id": {
                                  "type": "string"
                                },
                                "filename": {
                                  "type": "string"
                                },
                                "size": {
                                  "type": "number"
                                },
                                "content_type": {
                                  "type": "string"
                                },
                                "content_disposition": {
                                  "type": "string"
                                },
                                "content_id": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                }
                              }
                            }
                          },
                          "size": {
                            "type": "number"
                          },
                          "in_reply_to": {},
                          "references": {
                            "type": "array"
                          },
                          "smtp_id": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updated_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "extracted_text": {
                            "type": "string"
                          },
                          "extracted_html": {},
                          "headers": {
                            "type": "object"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "count": 1,
                  "limit": 50,
                  "next_page_token": "NTA",
                  "messages": [
                    {
                      "inbox_id": "support@acme.com",
                      "thread_id": "0b6f1d2e-58c4-4e0a-9d61-7f3a2c9e4b10",
                      "message_id": "8d2c4a91-3f7e-4b6d-a0c2-5e1f9b7d3a64",
                      "labels": [
                        "received",
                        "unread"
                      ],
                      "timestamp": "2026-10-06T14:03:21.118Z",
                      "from": "Dana Lee <dana@northwind.io>",
                      "to": [
                        "support@acme.com"
                      ],
                      "cc": [],
                      "bcc": [],
                      "reply_to": [],
                      "subject": "Invoice #4821 is wrong",
                      "preview": "Hi, the invoice you sent on Friday lists 12 seats but we only have 10...",
                      "attachments": [
                        {
                          "attachment_id": "f3a9c2d1-7b4e-4c8a-9e05-2d6b1a8f7c33",
                          "filename": "invoice-4821.pdf",
                          "size": 48213,
                          "content_type": "application/pdf",
                          "content_disposition": "attachment",
                          "content_id": null
                        }
                      ],
                      "size": 61840,
                      "in_reply_to": null,
                      "references": [],
                      "smtp_id": "<CAF8z1x2@mail.northwind.io>",
                      "created_at": "2026-10-06T14:03:21.118Z",
                      "updated_at": "2026-10-06T14:03:21.118Z",
                      "extracted_text": "Hi, the invoice you sent on Friday lists 12 seats but we only have 10. Can you fix it?",
                      "extracted_html": null,
                      "headers": {}
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/inboxes/{inbox_id}/messages/search": {
      "get": {
        "operationId": "amSearchMessages",
        "summary": "Search messages",
        "description": "Same as List messages, but only messages whose subject, preview, sender, recipients or extracted text contain the search text.\n\n- send.io extension: a simple case-insensitive text match.",
        "tags": [
          "Messages"
        ],
        "x-docs-ids": [
          "am-search-messages"
        ],
        "parameters": [
          {
            "name": "inbox_id",
            "in": "path",
            "required": true,
            "description": "The inbox's email address (for example support@acme.com). The inbox's send.io UUID also works.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Text to look for (case-insensitive). `query` is accepted as an alias.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Items per page, 1 to 100. Default 50. Other values answer 422.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "required": false,
            "description": "The `next_page_token` from the previous page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "labels",
            "in": "query",
            "required": false,
            "description": "Only items that have all of these labels. Send a JSON array (labels=[\"unread\"]), a comma list, or repeat the parameter.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "description": "Only items before this RFC 3339 time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "Only items after this RFC 3339 time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ascending",
            "in": "query",
            "required": false,
            "description": "Oldest first when true. Default is newest first.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "include_spam",
            "in": "query",
            "required": false,
            "description": "Include spam. Hidden by default unless you ask for the spam label.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "include_trash",
            "in": "query",
            "required": false,
            "description": "Include trash. Hidden by default unless you ask for the trash label.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "number"
                    },
                    "limit": {
                      "type": "number"
                    },
                    "messages": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "inbox_id": {
                            "type": "string"
                          },
                          "thread_id": {
                            "type": "string"
                          },
                          "message_id": {
                            "type": "string"
                          },
                          "labels": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "timestamp": {
                            "type": "string"
                          },
                          "from": {
                            "type": "string"
                          },
                          "to": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "cc": {
                            "type": "array"
                          },
                          "bcc": {
                            "type": "array"
                          },
                          "reply_to": {
                            "type": "array"
                          },
                          "subject": {
                            "type": "string"
                          },
                          "preview": {
                            "type": "string"
                          },
                          "attachments": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "attachment_id": {
                                  "type": "string"
                                },
                                "filename": {
                                  "type": "string"
                                },
                                "size": {
                                  "type": "number"
                                },
                                "content_type": {
                                  "type": "string"
                                },
                                "content_disposition": {
                                  "type": "string"
                                },
                                "content_id": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                }
                              }
                            }
                          },
                          "size": {
                            "type": "number"
                          },
                          "in_reply_to": {},
                          "references": {
                            "type": "array"
                          },
                          "smtp_id": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updated_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "extracted_text": {
                            "type": "string"
                          },
                          "extracted_html": {},
                          "headers": {
                            "type": "object"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "count": 1,
                  "limit": 50,
                  "messages": [
                    {
                      "inbox_id": "support@acme.com",
                      "thread_id": "0b6f1d2e-58c4-4e0a-9d61-7f3a2c9e4b10",
                      "message_id": "8d2c4a91-3f7e-4b6d-a0c2-5e1f9b7d3a64",
                      "labels": [
                        "received",
                        "unread"
                      ],
                      "timestamp": "2026-10-06T14:03:21.118Z",
                      "from": "Dana Lee <dana@northwind.io>",
                      "to": [
                        "support@acme.com"
                      ],
                      "cc": [],
                      "bcc": [],
                      "reply_to": [],
                      "subject": "Invoice #4821 is wrong",
                      "preview": "Hi, the invoice you sent on Friday lists 12 seats but we only have 10...",
                      "attachments": [
                        {
                          "attachment_id": "f3a9c2d1-7b4e-4c8a-9e05-2d6b1a8f7c33",
                          "filename": "invoice-4821.pdf",
                          "size": 48213,
                          "content_type": "application/pdf",
                          "content_disposition": "attachment",
                          "content_id": null
                        }
                      ],
                      "size": 61840,
                      "in_reply_to": null,
                      "references": [],
                      "smtp_id": "<CAF8z1x2@mail.northwind.io>",
                      "created_at": "2026-10-06T14:03:21.118Z",
                      "updated_at": "2026-10-06T14:03:21.118Z",
                      "extracted_text": "Hi, the invoice you sent on Friday lists 12 seats but we only have 10. Can you fix it?",
                      "extracted_html": null,
                      "headers": {}
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/inboxes/{inbox_id}/messages/send": {
      "post": {
        "operationId": "amSendMessage",
        "summary": "Send message",
        "description": "Sends a new message from the inbox. It starts a new thread.\n\n- Send an `Idempotency-Key` header (1 to 256 characters) to make retries safe: the same key and body within 24 hours returns the first response.\n\n- Returns 403 `message_rejected` when a recipient is blocked by the inbox's send list.",
        "tags": [
          "Messages"
        ],
        "x-docs-ids": [
          "am-send-message"
        ],
        "parameters": [
          {
            "name": "inbox_id",
            "in": "path",
            "required": true,
            "description": "The inbox's email address (for example support@acme.com). The inbox's send.io UUID also works.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Makes a retry safe: the same key and body within 24 hours returns the first response instead of doing the work again. A key still in use by a request that has not finished, or reused with a different body, answers 409.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "to": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "Recipient addresses."
                  },
                  "cc": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "CC addresses."
                  },
                  "bcc": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "BCC addresses."
                  },
                  "subject": {
                    "type": "string",
                    "description": "The subject line."
                  },
                  "text": {
                    "type": "string",
                    "description": "Plain-text body."
                  },
                  "html": {
                    "type": "string",
                    "description": "HTML body."
                  },
                  "reply_to": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "Reply-To addresses."
                  },
                  "headers": {
                    "type": "object",
                    "description": "Extra email headers as name/value pairs."
                  },
                  "labels": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Labels to put on the new thread (1 to 64 characters each, lowercased)."
                  },
                  "attachments": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "filename": {
                          "type": "string",
                          "description": "The file name."
                        },
                        "content": {
                          "type": "string",
                          "description": "The file as base64. Use this or `url`."
                        },
                        "url": {
                          "type": "string",
                          "description": "A public URL send.io downloads the file from."
                        },
                        "content_type": {
                          "type": "string",
                          "description": "MIME type of the file."
                        }
                      }
                    },
                    "description": "Files to attach."
                  }
                },
                "required": [
                  "to",
                  "subject"
                ]
              },
              "example": {
                "to": [
                  "dana@northwind.io"
                ],
                "subject": "Your new invoice",
                "text": "Hi Dana, your corrected invoice is attached.",
                "labels": [
                  "billing"
                ],
                "attachments": [
                  {
                    "filename": "invoice-4821.pdf",
                    "content": "JVBERi0xLjQKJ..."
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message_id": {
                      "type": "string"
                    },
                    "thread_id": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "message_id": "2e9f7b3c-6a1d-4c58-b0e4-9d3f2a7c1b65",
                  "thread_id": "6a3d9f1b-2c4e-4b7a-8e0d-5f1a3c7b9d24"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/inboxes/{inbox_id}/messages/batch-get": {
      "post": {
        "operationId": "amBatchGetMessages",
        "summary": "Batch get messages",
        "description": "Gets up to 100 messages with their bodies in one call. IDs that are not found are skipped.\n\n- send.io extension.",
        "tags": [
          "Messages"
        ],
        "x-docs-ids": [
          "am-batch-get-messages"
        ],
        "parameters": [
          {
            "name": "inbox_id",
            "in": "path",
            "required": true,
            "description": "The inbox's email address (for example support@acme.com). The inbox's send.io UUID also works.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "message_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Up to 100 message IDs."
                  }
                },
                "required": [
                  "message_ids"
                ]
              },
              "example": {
                "message_ids": [
                  "8d2c4a91-3f7e-4b6d-a0c2-5e1f9b7d3a64",
                  "2e9f7b3c-6a1d-4c58-b0e4-9d3f2a7c1b65"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "number"
                    },
                    "messages": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "inbox_id": {
                            "type": "string"
                          },
                          "thread_id": {
                            "type": "string"
                          },
                          "message_id": {
                            "type": "string"
                          },
                          "labels": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "timestamp": {
                            "type": "string"
                          },
                          "from": {
                            "type": "string"
                          },
                          "to": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "cc": {
                            "type": "array"
                          },
                          "bcc": {
                            "type": "array"
                          },
                          "reply_to": {
                            "type": "array"
                          },
                          "subject": {
                            "type": "string"
                          },
                          "preview": {
                            "type": "string"
                          },
                          "attachments": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "attachment_id": {
                                  "type": "string"
                                },
                                "filename": {
                                  "type": "string"
                                },
                                "size": {
                                  "type": "number"
                                },
                                "content_type": {
                                  "type": "string"
                                },
                                "content_disposition": {
                                  "type": "string"
                                },
                                "content_id": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                }
                              }
                            }
                          },
                          "size": {
                            "type": "number"
                          },
                          "in_reply_to": {},
                          "references": {
                            "type": "array"
                          },
                          "smtp_id": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updated_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "extracted_text": {
                            "type": "string"
                          },
                          "extracted_html": {},
                          "headers": {
                            "type": "object"
                          },
                          "text": {
                            "type": "string"
                          },
                          "html": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "count": 1,
                  "messages": [
                    {
                      "inbox_id": "support@acme.com",
                      "thread_id": "0b6f1d2e-58c4-4e0a-9d61-7f3a2c9e4b10",
                      "message_id": "8d2c4a91-3f7e-4b6d-a0c2-5e1f9b7d3a64",
                      "labels": [
                        "received",
                        "unread"
                      ],
                      "timestamp": "2026-10-06T14:03:21.118Z",
                      "from": "Dana Lee <dana@northwind.io>",
                      "to": [
                        "support@acme.com"
                      ],
                      "cc": [],
                      "bcc": [],
                      "reply_to": [],
                      "subject": "Invoice #4821 is wrong",
                      "preview": "Hi, the invoice you sent on Friday lists 12 seats but we only have 10...",
                      "attachments": [
                        {
                          "attachment_id": "f3a9c2d1-7b4e-4c8a-9e05-2d6b1a8f7c33",
                          "filename": "invoice-4821.pdf",
                          "size": 48213,
                          "content_type": "application/pdf",
                          "content_disposition": "attachment",
                          "content_id": null
                        }
                      ],
                      "size": 61840,
                      "in_reply_to": null,
                      "references": [],
                      "smtp_id": "<CAF8z1x2@mail.northwind.io>",
                      "created_at": "2026-10-06T14:03:21.118Z",
                      "updated_at": "2026-10-06T14:03:21.118Z",
                      "extracted_text": "Hi, the invoice you sent on Friday lists 12 seats but we only have 10. Can you fix it?",
                      "extracted_html": null,
                      "headers": {},
                      "text": "Hi, the invoice you sent on Friday lists 12 seats but we only have 10. Can you fix it?\n\nThanks,\nDana",
                      "html": "<p>Hi, the invoice you sent on Friday lists 12 seats but we only have 10. Can you fix it?</p><p>Thanks,<br>Dana</p>"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/inboxes/{inbox_id}/messages/batch": {
      "patch": {
        "operationId": "amBatchUpdateMessages",
        "summary": "Batch update messages",
        "description": "Adds and removes labels on up to 100 messages at once.\n\n- send.io extension. Labels work the same as in Update message.",
        "tags": [
          "Messages"
        ],
        "x-docs-ids": [
          "am-batch-update-messages"
        ],
        "parameters": [
          {
            "name": "inbox_id",
            "in": "path",
            "required": true,
            "description": "The inbox's email address (for example support@acme.com). The inbox's send.io UUID also works.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "message_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Up to 100 message IDs."
                  },
                  "add_labels": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Labels to add."
                  },
                  "remove_labels": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Labels to remove."
                  }
                },
                "required": [
                  "message_ids"
                ]
              },
              "example": {
                "message_ids": [
                  "8d2c4a91-3f7e-4b6d-a0c2-5e1f9b7d3a64"
                ],
                "add_labels": [
                  "read",
                  "billing"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "number"
                    },
                    "messages": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "message_id": {
                            "type": "string"
                          },
                          "labels": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "count": 1,
                  "messages": [
                    {
                      "message_id": "8d2c4a91-3f7e-4b6d-a0c2-5e1f9b7d3a64",
                      "labels": [
                        "received",
                        "billing"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/inboxes/{inbox_id}/messages/{message_id}": {
      "get": {
        "operationId": "amGetMessage",
        "summary": "Get message",
        "description": "Gets one message with its text and HTML bodies.\n\n- `extracted_text` and `extracted_html` (the new reply without the quoted history) are set on received messages only.\n\n- `html` and `extracted_html` are the sender's HTML exactly as received, scripts and event attributes included. Treat them as untrusted: sanitize before you show them in a browser, or use `text`.\n\n- `smtp_id`, `in_reply_to` and `references` are Message-IDs in header form, with angle brackets (<id@host>), so you can compare them as they are.",
        "tags": [
          "Messages"
        ],
        "x-docs-ids": [
          "am-get-message"
        ],
        "parameters": [
          {
            "name": "inbox_id",
            "in": "path",
            "required": true,
            "description": "The inbox's email address (for example support@acme.com). The inbox's send.io UUID also works.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "message_id",
            "in": "path",
            "required": true,
            "description": "The message ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "inbox_id": {
                      "type": "string"
                    },
                    "thread_id": {
                      "type": "string"
                    },
                    "message_id": {
                      "type": "string"
                    },
                    "labels": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "timestamp": {
                      "type": "string"
                    },
                    "from": {
                      "type": "string"
                    },
                    "to": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "cc": {
                      "type": "array"
                    },
                    "bcc": {
                      "type": "array"
                    },
                    "reply_to": {
                      "type": "array"
                    },
                    "subject": {
                      "type": "string"
                    },
                    "preview": {
                      "type": "string"
                    },
                    "attachments": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "attachment_id": {
                            "type": "string"
                          },
                          "filename": {
                            "type": "string"
                          },
                          "size": {
                            "type": "number"
                          },
                          "content_type": {
                            "type": "string"
                          },
                          "content_disposition": {
                            "type": "string"
                          },
                          "content_id": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        }
                      }
                    },
                    "size": {
                      "type": "number"
                    },
                    "in_reply_to": {},
                    "references": {
                      "type": "array"
                    },
                    "smtp_id": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "extracted_text": {
                      "type": "string"
                    },
                    "extracted_html": {},
                    "headers": {
                      "type": "object"
                    },
                    "text": {
                      "type": "string"
                    },
                    "html": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "inbox_id": "support@acme.com",
                  "thread_id": "0b6f1d2e-58c4-4e0a-9d61-7f3a2c9e4b10",
                  "message_id": "8d2c4a91-3f7e-4b6d-a0c2-5e1f9b7d3a64",
                  "labels": [
                    "received",
                    "unread"
                  ],
                  "timestamp": "2026-10-06T14:03:21.118Z",
                  "from": "Dana Lee <dana@northwind.io>",
                  "to": [
                    "support@acme.com"
                  ],
                  "cc": [],
                  "bcc": [],
                  "reply_to": [],
                  "subject": "Invoice #4821 is wrong",
                  "preview": "Hi, the invoice you sent on Friday lists 12 seats but we only have 10...",
                  "attachments": [
                    {
                      "attachment_id": "f3a9c2d1-7b4e-4c8a-9e05-2d6b1a8f7c33",
                      "filename": "invoice-4821.pdf",
                      "size": 48213,
                      "content_type": "application/pdf",
                      "content_disposition": "attachment",
                      "content_id": null
                    }
                  ],
                  "size": 61840,
                  "in_reply_to": null,
                  "references": [],
                  "smtp_id": "<CAF8z1x2@mail.northwind.io>",
                  "created_at": "2026-10-06T14:03:21.118Z",
                  "updated_at": "2026-10-06T14:03:21.118Z",
                  "extracted_text": "Hi, the invoice you sent on Friday lists 12 seats but we only have 10. Can you fix it?",
                  "extracted_html": null,
                  "headers": {},
                  "text": "Hi, the invoice you sent on Friday lists 12 seats but we only have 10. Can you fix it?\n\nThanks,\nDana",
                  "html": "<p>Hi, the invoice you sent on Friday lists 12 seats but we only have 10. Can you fix it?</p><p>Thanks,<br>Dana</p>"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "patch": {
        "operationId": "amUpdateMessage",
        "summary": "Update message",
        "description": "Adds and removes labels on a message.\n\n- Adding `read` (or removing `unread`) marks the message read; adding `unread` marks it unread. Adding `trash` moves it to trash; removing `trash` restores it.\n\n- Other system labels (`received`, `sent`, `spam`, delivery states) cannot be set and are ignored.\n\n- The response is only the message ID and its new labels, not the full message.",
        "tags": [
          "Messages"
        ],
        "x-docs-ids": [
          "am-update-message"
        ],
        "parameters": [
          {
            "name": "inbox_id",
            "in": "path",
            "required": true,
            "description": "The inbox's email address (for example support@acme.com). The inbox's send.io UUID also works.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "message_id",
            "in": "path",
            "required": true,
            "description": "The message ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "add_labels": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Labels to add."
                  },
                  "remove_labels": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Labels to remove."
                  }
                }
              },
              "example": {
                "add_labels": [
                  "read",
                  "billing"
                ],
                "remove_labels": [
                  "needs-reply"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message_id": {
                      "type": "string"
                    },
                    "labels": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": {
                  "message_id": "8d2c4a91-3f7e-4b6d-a0c2-5e1f9b7d3a64",
                  "labels": [
                    "received",
                    "billing"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "delete": {
        "operationId": "amDeleteMessage",
        "summary": "Delete message",
        "description": "Moves the message to trash. Deleting a message that is already in trash removes it for good.\n\n- A deleted sent message is only removed from the inbox; the send record stays in your email logs and still counts in the inbox's metrics.",
        "tags": [
          "Messages"
        ],
        "x-docs-ids": [
          "am-delete-message"
        ],
        "parameters": [
          {
            "name": "inbox_id",
            "in": "path",
            "required": true,
            "description": "The inbox's email address (for example support@acme.com). The inbox's send.io UUID also works.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "message_id",
            "in": "path",
            "required": true,
            "description": "The message ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {}
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/inboxes/{inbox_id}/messages/{message_id}/raw": {
      "get": {
        "operationId": "amGetRawMessage",
        "summary": "Get raw message",
        "description": "Gets the original RFC 822 source of a received message.\n\n- The source comes back inline as JSON (`raw`), not as a download link.\n\n- Only received messages keep their raw source; sent messages return 404.",
        "tags": [
          "Messages"
        ],
        "x-docs-ids": [
          "am-get-raw-message"
        ],
        "parameters": [
          {
            "name": "inbox_id",
            "in": "path",
            "required": true,
            "description": "The inbox's email address (for example support@acme.com). The inbox's send.io UUID also works.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "message_id",
            "in": "path",
            "required": true,
            "description": "The message ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message_id": {
                      "type": "string"
                    },
                    "content_type": {
                      "type": "string"
                    },
                    "size": {
                      "type": "number"
                    },
                    "raw": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "message_id": "8d2c4a91-3f7e-4b6d-a0c2-5e1f9b7d3a64",
                  "content_type": "message/rfc822",
                  "size": 61840,
                  "raw": "Return-Path: <dana@northwind.io>\r\nFrom: Dana Lee <dana@northwind.io>\r\nTo: support@acme.com\r\nSubject: Invoice #4821 is wrong\r\n..."
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/inboxes/{inbox_id}/messages/{message_id}/reply": {
      "post": {
        "operationId": "amReplyToMessage",
        "summary": "Reply to message",
        "description": "Sends a reply in the message's thread. It goes to the sender (or its Reply-To) with the right In-Reply-To and References headers.\n\n- Send an `Idempotency-Key` header (1 to 256 characters) to make retries safe: the same key and body within 24 hours returns the first response.\n\n- The reply answers the newest received message in the thread, and the subject is always \"Re: \" plus the thread subject.\n\n- `attachments`, `reply_to`, `headers` and `tags` work as on Send message; the thread's In-Reply-To and References always win over your headers.\n\n- Returns 403 `message_rejected` when the inbox's reply list blocks the sender.",
        "tags": [
          "Messages"
        ],
        "x-docs-ids": [
          "am-reply-to-message"
        ],
        "parameters": [
          {
            "name": "inbox_id",
            "in": "path",
            "required": true,
            "description": "The inbox's email address (for example support@acme.com). The inbox's send.io UUID also works.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "message_id",
            "in": "path",
            "required": true,
            "description": "The message ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Makes a retry safe: the same key and body within 24 hours returns the first response instead of doing the work again. A key still in use by a request that has not finished, or reused with a different body, answers 409.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "text": {
                    "type": "string",
                    "description": "Plain-text body. `text` or `html` is required."
                  },
                  "html": {
                    "type": "string",
                    "description": "HTML body."
                  },
                  "to": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "Override the recipients. Default is the original sender (or its Reply-To)."
                  },
                  "cc": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "CC addresses."
                  },
                  "bcc": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "BCC addresses."
                  },
                  "labels": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Labels to put on the sent reply."
                  },
                  "attachments": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    },
                    "description": "Files to attach, same shape as Send message."
                  },
                  "reply_to": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "Reply-To addresses."
                  }
                }
              },
              "example": {
                "text": "Hi Dana, sorry about that. The corrected invoice is on its way.",
                "labels": [
                  "billing"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message_id": {
                      "type": "string"
                    },
                    "thread_id": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "message_id": "2e9f7b3c-6a1d-4c58-b0e4-9d3f2a7c1b65",
                  "thread_id": "0b6f1d2e-58c4-4e0a-9d61-7f3a2c9e4b10"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/inboxes/{inbox_id}/messages/{message_id}/reply-all": {
      "post": {
        "operationId": "amReplyAllMessage",
        "summary": "Reply all to message",
        "description": "Like Reply to message, but also copies everyone else on the original To and CC lines (except this inbox).\n\n- Send an `Idempotency-Key` header (1 to 256 characters) to make retries safe: the same key and body within 24 hours returns the first response.\n\n- When you send `cc` yourself, it replaces the automatic CC list.",
        "tags": [
          "Messages"
        ],
        "x-docs-ids": [
          "am-reply-all-message"
        ],
        "parameters": [
          {
            "name": "inbox_id",
            "in": "path",
            "required": true,
            "description": "The inbox's email address (for example support@acme.com). The inbox's send.io UUID also works.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "message_id",
            "in": "path",
            "required": true,
            "description": "The message ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Makes a retry safe: the same key and body within 24 hours returns the first response instead of doing the work again. A key still in use by a request that has not finished, or reused with a different body, answers 409.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "text": {
                    "type": "string",
                    "description": "Plain-text body. `text` or `html` is required."
                  },
                  "html": {
                    "type": "string",
                    "description": "HTML body."
                  },
                  "to": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "Override the recipients. Default is the original sender (or its Reply-To)."
                  },
                  "cc": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "CC addresses."
                  },
                  "bcc": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "BCC addresses."
                  },
                  "labels": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Labels to put on the sent reply."
                  },
                  "attachments": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    },
                    "description": "Files to attach, same shape as Send message."
                  },
                  "reply_to": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "Reply-To addresses."
                  }
                }
              },
              "example": {
                "text": "Thanks all, we have fixed the invoice."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message_id": {
                      "type": "string"
                    },
                    "thread_id": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "message_id": "2e9f7b3c-6a1d-4c58-b0e4-9d3f2a7c1b65",
                  "thread_id": "0b6f1d2e-58c4-4e0a-9d61-7f3a2c9e4b10"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/inboxes/{inbox_id}/messages/{message_id}/forward": {
      "post": {
        "operationId": "amForwardMessage",
        "summary": "Forward message",
        "description": "Forwards the message to new recipients. The original is quoted below your text, and the subject gets a \"Fwd: \" prefix.\n\n- Send an `Idempotency-Key` header (1 to 256 characters) to make retries safe: the same key and body within 24 hours returns the first response.\n\n- The forward is sent as plain text; any `html` is dropped. The original's attachments are not copied.\n\n- The forward starts a new thread.",
        "tags": [
          "Messages"
        ],
        "x-docs-ids": [
          "am-forward-message"
        ],
        "parameters": [
          {
            "name": "inbox_id",
            "in": "path",
            "required": true,
            "description": "The inbox's email address (for example support@acme.com). The inbox's send.io UUID also works.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "message_id",
            "in": "path",
            "required": true,
            "description": "The message ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Makes a retry safe: the same key and body within 24 hours returns the first response instead of doing the work again. A key still in use by a request that has not finished, or reused with a different body, answers 409.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "to": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "Recipient addresses."
                  },
                  "cc": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "CC addresses."
                  },
                  "bcc": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "BCC addresses."
                  },
                  "subject": {
                    "type": "string",
                    "description": "Default is \"Fwd: \" plus the original subject."
                  },
                  "text": {
                    "type": "string",
                    "description": "Your note above the forwarded message."
                  },
                  "attachments": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    },
                    "description": "Files to attach, same shape as Send message."
                  },
                  "labels": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Labels for the new thread."
                  }
                },
                "required": [
                  "to"
                ]
              },
              "example": {
                "to": [
                  "billing@acme.com"
                ],
                "text": "Can you look at this one?"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message_id": {
                      "type": "string"
                    },
                    "thread_id": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "message_id": "4b1d8e2f-7c3a-4f96-a5d0-3e8b2c6f1a97",
                  "thread_id": "9e2c5a7d-1b3f-4d68-b0a4-6c8e1f3a5d72"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/inboxes/{inbox_id}/messages/{message_id}/attachments/{attachment_id}": {
      "get": {
        "operationId": "amGetMessageAttachment",
        "summary": "Get attachment",
        "description": "Gets an attachment's details and a signed download link that works for one hour.\n\n- send.io extension: `text_url` (the attachment's extracted text) is present when text could be extracted.",
        "tags": [
          "Messages"
        ],
        "x-docs-ids": [
          "am-get-message-attachment"
        ],
        "parameters": [
          {
            "name": "inbox_id",
            "in": "path",
            "required": true,
            "description": "The inbox's email address (for example support@acme.com). The inbox's send.io UUID also works.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "message_id",
            "in": "path",
            "required": true,
            "description": "The message ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "attachment_id",
            "in": "path",
            "required": true,
            "description": "The attachment ID, from the message's `attachments[].attachment_id`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "attachment_id": {
                      "type": "string"
                    },
                    "filename": {
                      "type": "string"
                    },
                    "size": {
                      "type": "number"
                    },
                    "content_type": {
                      "type": "string"
                    },
                    "content_disposition": {
                      "type": "string"
                    },
                    "content_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "download_url": {
                      "type": "string"
                    },
                    "expires_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "text_url": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "attachment_id": "f3a9c2d1-7b4e-4c8a-9e05-2d6b1a8f7c33",
                  "filename": "invoice-4821.pdf",
                  "size": 48213,
                  "content_type": "application/pdf",
                  "content_disposition": "attachment",
                  "content_id": null,
                  "download_url": "https://api.send.io/download/eyJ0IjoiYXR0YWNobWVudCJ9.k3Jd9sQ",
                  "expires_at": "2026-10-06T15:20:00Z",
                  "text_url": "https://api.send.io/download/eyJ0IjoiYXR0YWNobWVudCJ9.k3Jd9sQ?format=text"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/inboxes/{inbox_id}/threads": {
      "get": {
        "operationId": "amListInboxThreads",
        "summary": "List threads",
        "description": "Lists the inbox's threads, most recent activity first.\n\n- Thread labels: `unread`, `spam` and `trash` are worked out from state; the rest are custom labels. Archived threads are not listed.",
        "tags": [
          "Threads"
        ],
        "x-docs-ids": [
          "am-list-inbox-threads"
        ],
        "parameters": [
          {
            "name": "inbox_id",
            "in": "path",
            "required": true,
            "description": "The inbox's email address (for example support@acme.com). The inbox's send.io UUID also works.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Items per page, 1 to 100. Default 50. Other values answer 422.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "required": false,
            "description": "The `next_page_token` from the previous page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "labels",
            "in": "query",
            "required": false,
            "description": "Only items that have all of these labels. Send a JSON array (labels=[\"unread\"]), a comma list, or repeat the parameter.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "description": "Only items before this RFC 3339 time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "Only items after this RFC 3339 time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ascending",
            "in": "query",
            "required": false,
            "description": "Oldest first when true. Default is newest first.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "include_spam",
            "in": "query",
            "required": false,
            "description": "Include spam. Hidden by default unless you ask for the spam label.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "include_trash",
            "in": "query",
            "required": false,
            "description": "Include trash. Hidden by default unless you ask for the trash label.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "number"
                    },
                    "limit": {
                      "type": "number"
                    },
                    "threads": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "inbox_id": {
                            "type": "string"
                          },
                          "thread_id": {
                            "type": "string"
                          },
                          "labels": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "timestamp": {
                            "type": "string"
                          },
                          "senders": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "recipients": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "message_count": {
                            "type": "number"
                          },
                          "subject": {
                            "type": "string"
                          },
                          "preview": {
                            "type": "string"
                          },
                          "size": {
                            "type": "number"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updated_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "count": 1,
                  "limit": 50,
                  "threads": [
                    {
                      "inbox_id": "support@acme.com",
                      "thread_id": "0b6f1d2e-58c4-4e0a-9d61-7f3a2c9e4b10",
                      "labels": [
                        "unread",
                        "billing"
                      ],
                      "timestamp": "2026-10-06T14:03:21.118Z",
                      "senders": [
                        "dana@northwind.io"
                      ],
                      "recipients": [
                        "support@acme.com"
                      ],
                      "message_count": 1,
                      "subject": "Invoice #4821 is wrong",
                      "preview": "Hi, the invoice you sent on Friday lists 12 seats but we only have 10...",
                      "size": 0,
                      "created_at": "2026-10-06T14:03:21.118Z",
                      "updated_at": "2026-10-06T14:03:21.118Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/inboxes/{inbox_id}/threads/search": {
      "get": {
        "operationId": "amSearchInboxThreads",
        "summary": "Search threads",
        "description": "Lists the inbox's threads whose subject, preview, senders or recipients contain the search text.\n\n- send.io extension.",
        "tags": [
          "Threads"
        ],
        "x-docs-ids": [
          "am-search-inbox-threads"
        ],
        "parameters": [
          {
            "name": "inbox_id",
            "in": "path",
            "required": true,
            "description": "The inbox's email address (for example support@acme.com). The inbox's send.io UUID also works.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Text to look for (case-insensitive). `query` is accepted as an alias.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Items per page, 1 to 100. Default 50. Other values answer 422.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "required": false,
            "description": "The `next_page_token` from the previous page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "labels",
            "in": "query",
            "required": false,
            "description": "Only items that have all of these labels. Send a JSON array (labels=[\"unread\"]), a comma list, or repeat the parameter.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "description": "Only items before this RFC 3339 time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "Only items after this RFC 3339 time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ascending",
            "in": "query",
            "required": false,
            "description": "Oldest first when true. Default is newest first.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "include_spam",
            "in": "query",
            "required": false,
            "description": "Include spam. Hidden by default unless you ask for the spam label.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "include_trash",
            "in": "query",
            "required": false,
            "description": "Include trash. Hidden by default unless you ask for the trash label.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "number"
                    },
                    "limit": {
                      "type": "number"
                    },
                    "threads": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "inbox_id": {
                            "type": "string"
                          },
                          "thread_id": {
                            "type": "string"
                          },
                          "labels": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "timestamp": {
                            "type": "string"
                          },
                          "senders": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "recipients": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "message_count": {
                            "type": "number"
                          },
                          "subject": {
                            "type": "string"
                          },
                          "preview": {
                            "type": "string"
                          },
                          "size": {
                            "type": "number"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updated_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "count": 1,
                  "limit": 50,
                  "threads": [
                    {
                      "inbox_id": "support@acme.com",
                      "thread_id": "0b6f1d2e-58c4-4e0a-9d61-7f3a2c9e4b10",
                      "labels": [
                        "unread",
                        "billing"
                      ],
                      "timestamp": "2026-10-06T14:03:21.118Z",
                      "senders": [
                        "dana@northwind.io"
                      ],
                      "recipients": [
                        "support@acme.com"
                      ],
                      "message_count": 1,
                      "subject": "Invoice #4821 is wrong",
                      "preview": "Hi, the invoice you sent on Friday lists 12 seats but we only have 10...",
                      "size": 0,
                      "created_at": "2026-10-06T14:03:21.118Z",
                      "updated_at": "2026-10-06T14:03:21.118Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/inboxes/{inbox_id}/threads/{thread_id}": {
      "get": {
        "operationId": "amGetInboxThread",
        "summary": "Get thread",
        "description": "Gets a thread with all its messages, oldest first, including bodies.",
        "tags": [
          "Threads"
        ],
        "x-docs-ids": [
          "am-get-inbox-thread"
        ],
        "parameters": [
          {
            "name": "inbox_id",
            "in": "path",
            "required": true,
            "description": "The inbox's email address (for example support@acme.com). The inbox's send.io UUID also works.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "thread_id",
            "in": "path",
            "required": true,
            "description": "The thread ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include_trash",
            "in": "query",
            "required": false,
            "description": "Include messages that are in trash.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "inbox_id": {
                      "type": "string"
                    },
                    "thread_id": {
                      "type": "string"
                    },
                    "labels": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "timestamp": {
                      "type": "string"
                    },
                    "senders": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "recipients": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "message_count": {
                      "type": "number"
                    },
                    "subject": {
                      "type": "string"
                    },
                    "preview": {
                      "type": "string"
                    },
                    "size": {
                      "type": "number"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "messages": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "inbox_id": {
                            "type": "string"
                          },
                          "thread_id": {
                            "type": "string"
                          },
                          "message_id": {
                            "type": "string"
                          },
                          "labels": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "timestamp": {
                            "type": "string"
                          },
                          "from": {
                            "type": "string"
                          },
                          "to": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "cc": {
                            "type": "array"
                          },
                          "bcc": {
                            "type": "array"
                          },
                          "reply_to": {
                            "type": "array"
                          },
                          "subject": {
                            "type": "string"
                          },
                          "preview": {
                            "type": "string"
                          },
                          "attachments": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "attachment_id": {
                                  "type": "string"
                                },
                                "filename": {
                                  "type": "string"
                                },
                                "size": {
                                  "type": "number"
                                },
                                "content_type": {
                                  "type": "string"
                                },
                                "content_disposition": {
                                  "type": "string"
                                },
                                "content_id": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                }
                              }
                            }
                          },
                          "size": {
                            "type": "number"
                          },
                          "in_reply_to": {},
                          "references": {
                            "type": "array"
                          },
                          "smtp_id": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updated_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "extracted_text": {
                            "type": "string"
                          },
                          "extracted_html": {},
                          "headers": {
                            "type": "object"
                          },
                          "text": {
                            "type": "string"
                          },
                          "html": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "last_message_id": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "inbox_id": "support@acme.com",
                  "thread_id": "0b6f1d2e-58c4-4e0a-9d61-7f3a2c9e4b10",
                  "labels": [
                    "unread",
                    "billing"
                  ],
                  "timestamp": "2026-10-06T14:03:21.118Z",
                  "senders": [
                    "dana@northwind.io"
                  ],
                  "recipients": [
                    "support@acme.com"
                  ],
                  "message_count": 1,
                  "subject": "Invoice #4821 is wrong",
                  "preview": "Hi, the invoice you sent on Friday lists 12 seats but we only have 10...",
                  "size": 0,
                  "created_at": "2026-10-06T14:03:21.118Z",
                  "updated_at": "2026-10-06T14:03:21.118Z",
                  "messages": [
                    {
                      "inbox_id": "support@acme.com",
                      "thread_id": "0b6f1d2e-58c4-4e0a-9d61-7f3a2c9e4b10",
                      "message_id": "8d2c4a91-3f7e-4b6d-a0c2-5e1f9b7d3a64",
                      "labels": [
                        "received",
                        "unread"
                      ],
                      "timestamp": "2026-10-06T14:03:21.118Z",
                      "from": "Dana Lee <dana@northwind.io>",
                      "to": [
                        "support@acme.com"
                      ],
                      "cc": [],
                      "bcc": [],
                      "reply_to": [],
                      "subject": "Invoice #4821 is wrong",
                      "preview": "Hi, the invoice you sent on Friday lists 12 seats but we only have 10...",
                      "attachments": [
                        {
                          "attachment_id": "f3a9c2d1-7b4e-4c8a-9e05-2d6b1a8f7c33",
                          "filename": "invoice-4821.pdf",
                          "size": 48213,
                          "content_type": "application/pdf",
                          "content_disposition": "attachment",
                          "content_id": null
                        }
                      ],
                      "size": 61840,
                      "in_reply_to": null,
                      "references": [],
                      "smtp_id": "<CAF8z1x2@mail.northwind.io>",
                      "created_at": "2026-10-06T14:03:21.118Z",
                      "updated_at": "2026-10-06T14:03:21.118Z",
                      "extracted_text": "Hi, the invoice you sent on Friday lists 12 seats but we only have 10. Can you fix it?",
                      "extracted_html": null,
                      "headers": {},
                      "text": "Hi, the invoice you sent on Friday lists 12 seats but we only have 10. Can you fix it?\n\nThanks,\nDana",
                      "html": "<p>Hi, the invoice you sent on Friday lists 12 seats but we only have 10. Can you fix it?</p><p>Thanks,<br>Dana</p>"
                    }
                  ],
                  "last_message_id": "8d2c4a91-3f7e-4b6d-a0c2-5e1f9b7d3a64"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "patch": {
        "operationId": "amUpdateInboxThread",
        "summary": "Update thread",
        "description": "Adds and removes labels on a thread.\n\n- Adding `read` (or removing `unread`) marks every message in the thread read. Adding `trash` moves the thread to trash; removing it restores it.\n\n- `spam`, `received` and `sent` cannot be set and are ignored.",
        "tags": [
          "Threads"
        ],
        "x-docs-ids": [
          "am-update-inbox-thread"
        ],
        "parameters": [
          {
            "name": "inbox_id",
            "in": "path",
            "required": true,
            "description": "The inbox's email address (for example support@acme.com). The inbox's send.io UUID also works.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "thread_id",
            "in": "path",
            "required": true,
            "description": "The thread ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "add_labels": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Labels to add."
                  },
                  "remove_labels": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Labels to remove."
                  }
                }
              },
              "example": {
                "add_labels": [
                  "read",
                  "resolved"
                ],
                "remove_labels": [
                  "needs-reply"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "inbox_id": {
                      "type": "string"
                    },
                    "thread_id": {
                      "type": "string"
                    },
                    "labels": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "timestamp": {
                      "type": "string"
                    },
                    "senders": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "recipients": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "message_count": {
                      "type": "number"
                    },
                    "subject": {
                      "type": "string"
                    },
                    "preview": {
                      "type": "string"
                    },
                    "size": {
                      "type": "number"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "inbox_id": "support@acme.com",
                  "thread_id": "0b6f1d2e-58c4-4e0a-9d61-7f3a2c9e4b10",
                  "labels": [
                    "billing",
                    "resolved"
                  ],
                  "timestamp": "2026-10-06T14:03:21.118Z",
                  "senders": [
                    "dana@northwind.io"
                  ],
                  "recipients": [
                    "support@acme.com"
                  ],
                  "message_count": 1,
                  "subject": "Invoice #4821 is wrong",
                  "preview": "Hi, the invoice you sent on Friday lists 12 seats but we only have 10...",
                  "size": 0,
                  "created_at": "2026-10-06T14:03:21.118Z",
                  "updated_at": "2026-10-06T14:03:21.118Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "delete": {
        "operationId": "amDeleteInboxThread",
        "summary": "Delete thread",
        "description": "Moves the thread to trash. Deleting a thread that is already in trash removes it and its messages for good.",
        "tags": [
          "Threads"
        ],
        "x-docs-ids": [
          "am-delete-inbox-thread"
        ],
        "parameters": [
          {
            "name": "inbox_id",
            "in": "path",
            "required": true,
            "description": "The inbox's email address (for example support@acme.com). The inbox's send.io UUID also works.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "thread_id",
            "in": "path",
            "required": true,
            "description": "The thread ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {}
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/inboxes/{inbox_id}/threads/{thread_id}/attachments/{attachment_id}": {
      "get": {
        "operationId": "amGetInboxThreadAttachment",
        "summary": "Get thread attachment",
        "description": "Gets an attachment from any message in the thread, with a signed download link that works for one hour.",
        "tags": [
          "Threads"
        ],
        "x-docs-ids": [
          "am-get-inbox-thread-attachment"
        ],
        "parameters": [
          {
            "name": "inbox_id",
            "in": "path",
            "required": true,
            "description": "The inbox's email address (for example support@acme.com). The inbox's send.io UUID also works.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "thread_id",
            "in": "path",
            "required": true,
            "description": "The thread ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "attachment_id",
            "in": "path",
            "required": true,
            "description": "The attachment ID, from the message's `attachments[].attachment_id`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "attachment_id": {
                      "type": "string"
                    },
                    "filename": {
                      "type": "string"
                    },
                    "size": {
                      "type": "number"
                    },
                    "content_type": {
                      "type": "string"
                    },
                    "content_disposition": {
                      "type": "string"
                    },
                    "content_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "download_url": {
                      "type": "string"
                    },
                    "expires_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "text_url": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "attachment_id": "f3a9c2d1-7b4e-4c8a-9e05-2d6b1a8f7c33",
                  "filename": "invoice-4821.pdf",
                  "size": 48213,
                  "content_type": "application/pdf",
                  "content_disposition": "attachment",
                  "content_id": null,
                  "download_url": "https://api.send.io/download/eyJ0IjoiYXR0YWNobWVudCJ9.k3Jd9sQ",
                  "expires_at": "2026-10-06T15:20:00Z",
                  "text_url": "https://api.send.io/download/eyJ0IjoiYXR0YWNobWVudCJ9.k3Jd9sQ?format=text"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/threads": {
      "get": {
        "operationId": "amListThreads",
        "summary": "List threads (organization)",
        "description": "Lists threads across every inbox in the organization, most recent activity first.\n\n- A scoped key only sees threads in its inbox or pod.",
        "tags": [
          "Threads"
        ],
        "x-docs-ids": [
          "am-list-threads"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Items per page, 1 to 100. Default 50. Other values answer 422.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "required": false,
            "description": "The `next_page_token` from the previous page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "labels",
            "in": "query",
            "required": false,
            "description": "Only items that have all of these labels. Send a JSON array (labels=[\"unread\"]), a comma list, or repeat the parameter.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "description": "Only items before this RFC 3339 time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "Only items after this RFC 3339 time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ascending",
            "in": "query",
            "required": false,
            "description": "Oldest first when true. Default is newest first.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "include_spam",
            "in": "query",
            "required": false,
            "description": "Include spam. Hidden by default unless you ask for the spam label.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "include_trash",
            "in": "query",
            "required": false,
            "description": "Include trash. Hidden by default unless you ask for the trash label.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "number"
                    },
                    "limit": {
                      "type": "number"
                    },
                    "threads": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "inbox_id": {
                            "type": "string"
                          },
                          "thread_id": {
                            "type": "string"
                          },
                          "labels": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "timestamp": {
                            "type": "string"
                          },
                          "senders": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "recipients": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "message_count": {
                            "type": "number"
                          },
                          "subject": {
                            "type": "string"
                          },
                          "preview": {
                            "type": "string"
                          },
                          "size": {
                            "type": "number"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updated_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "count": 1,
                  "limit": 50,
                  "threads": [
                    {
                      "inbox_id": "support@acme.com",
                      "thread_id": "0b6f1d2e-58c4-4e0a-9d61-7f3a2c9e4b10",
                      "labels": [
                        "unread",
                        "billing"
                      ],
                      "timestamp": "2026-10-06T14:03:21.118Z",
                      "senders": [
                        "dana@northwind.io"
                      ],
                      "recipients": [
                        "support@acme.com"
                      ],
                      "message_count": 1,
                      "subject": "Invoice #4821 is wrong",
                      "preview": "Hi, the invoice you sent on Friday lists 12 seats but we only have 10...",
                      "size": 0,
                      "created_at": "2026-10-06T14:03:21.118Z",
                      "updated_at": "2026-10-06T14:03:21.118Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/threads/search": {
      "get": {
        "operationId": "amSearchThreads",
        "summary": "Search threads (organization)",
        "description": "Searches threads across every inbox by subject, preview, senders and recipients.\n\n- send.io extension.",
        "tags": [
          "Threads"
        ],
        "x-docs-ids": [
          "am-search-threads"
        ],
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Text to look for (case-insensitive). `query` is accepted as an alias.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Items per page, 1 to 100. Default 50. Other values answer 422.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "required": false,
            "description": "The `next_page_token` from the previous page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "labels",
            "in": "query",
            "required": false,
            "description": "Only items that have all of these labels. Send a JSON array (labels=[\"unread\"]), a comma list, or repeat the parameter.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "description": "Only items before this RFC 3339 time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "Only items after this RFC 3339 time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ascending",
            "in": "query",
            "required": false,
            "description": "Oldest first when true. Default is newest first.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "include_spam",
            "in": "query",
            "required": false,
            "description": "Include spam. Hidden by default unless you ask for the spam label.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "include_trash",
            "in": "query",
            "required": false,
            "description": "Include trash. Hidden by default unless you ask for the trash label.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "number"
                    },
                    "limit": {
                      "type": "number"
                    },
                    "threads": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "inbox_id": {
                            "type": "string"
                          },
                          "thread_id": {
                            "type": "string"
                          },
                          "labels": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "timestamp": {
                            "type": "string"
                          },
                          "senders": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "recipients": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "message_count": {
                            "type": "number"
                          },
                          "subject": {
                            "type": "string"
                          },
                          "preview": {
                            "type": "string"
                          },
                          "size": {
                            "type": "number"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updated_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "count": 1,
                  "limit": 50,
                  "threads": [
                    {
                      "inbox_id": "support@acme.com",
                      "thread_id": "0b6f1d2e-58c4-4e0a-9d61-7f3a2c9e4b10",
                      "labels": [
                        "unread",
                        "billing"
                      ],
                      "timestamp": "2026-10-06T14:03:21.118Z",
                      "senders": [
                        "dana@northwind.io"
                      ],
                      "recipients": [
                        "support@acme.com"
                      ],
                      "message_count": 1,
                      "subject": "Invoice #4821 is wrong",
                      "preview": "Hi, the invoice you sent on Friday lists 12 seats but we only have 10...",
                      "size": 0,
                      "created_at": "2026-10-06T14:03:21.118Z",
                      "updated_at": "2026-10-06T14:03:21.118Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/threads/{thread_id}": {
      "get": {
        "operationId": "amGetThread",
        "summary": "Get thread (organization)",
        "description": "Gets a thread by ID without knowing its inbox, with all its messages.",
        "tags": [
          "Threads"
        ],
        "x-docs-ids": [
          "am-get-thread"
        ],
        "parameters": [
          {
            "name": "thread_id",
            "in": "path",
            "required": true,
            "description": "The thread ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include_trash",
            "in": "query",
            "required": false,
            "description": "Include messages that are in trash.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "inbox_id": {
                      "type": "string"
                    },
                    "thread_id": {
                      "type": "string"
                    },
                    "labels": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "timestamp": {
                      "type": "string"
                    },
                    "senders": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "recipients": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "message_count": {
                      "type": "number"
                    },
                    "subject": {
                      "type": "string"
                    },
                    "preview": {
                      "type": "string"
                    },
                    "size": {
                      "type": "number"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "messages": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "inbox_id": {
                            "type": "string"
                          },
                          "thread_id": {
                            "type": "string"
                          },
                          "message_id": {
                            "type": "string"
                          },
                          "labels": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "timestamp": {
                            "type": "string"
                          },
                          "from": {
                            "type": "string"
                          },
                          "to": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "cc": {
                            "type": "array"
                          },
                          "bcc": {
                            "type": "array"
                          },
                          "reply_to": {
                            "type": "array"
                          },
                          "subject": {
                            "type": "string"
                          },
                          "preview": {
                            "type": "string"
                          },
                          "attachments": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "attachment_id": {
                                  "type": "string"
                                },
                                "filename": {
                                  "type": "string"
                                },
                                "size": {
                                  "type": "number"
                                },
                                "content_type": {
                                  "type": "string"
                                },
                                "content_disposition": {
                                  "type": "string"
                                },
                                "content_id": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                }
                              }
                            }
                          },
                          "size": {
                            "type": "number"
                          },
                          "in_reply_to": {},
                          "references": {
                            "type": "array"
                          },
                          "smtp_id": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updated_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "extracted_text": {
                            "type": "string"
                          },
                          "extracted_html": {},
                          "headers": {
                            "type": "object"
                          },
                          "text": {
                            "type": "string"
                          },
                          "html": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "last_message_id": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "inbox_id": "support@acme.com",
                  "thread_id": "0b6f1d2e-58c4-4e0a-9d61-7f3a2c9e4b10",
                  "labels": [
                    "unread",
                    "billing"
                  ],
                  "timestamp": "2026-10-06T14:03:21.118Z",
                  "senders": [
                    "dana@northwind.io"
                  ],
                  "recipients": [
                    "support@acme.com"
                  ],
                  "message_count": 1,
                  "subject": "Invoice #4821 is wrong",
                  "preview": "Hi, the invoice you sent on Friday lists 12 seats but we only have 10...",
                  "size": 0,
                  "created_at": "2026-10-06T14:03:21.118Z",
                  "updated_at": "2026-10-06T14:03:21.118Z",
                  "messages": [
                    {
                      "inbox_id": "support@acme.com",
                      "thread_id": "0b6f1d2e-58c4-4e0a-9d61-7f3a2c9e4b10",
                      "message_id": "8d2c4a91-3f7e-4b6d-a0c2-5e1f9b7d3a64",
                      "labels": [
                        "received",
                        "unread"
                      ],
                      "timestamp": "2026-10-06T14:03:21.118Z",
                      "from": "Dana Lee <dana@northwind.io>",
                      "to": [
                        "support@acme.com"
                      ],
                      "cc": [],
                      "bcc": [],
                      "reply_to": [],
                      "subject": "Invoice #4821 is wrong",
                      "preview": "Hi, the invoice you sent on Friday lists 12 seats but we only have 10...",
                      "attachments": [
                        {
                          "attachment_id": "f3a9c2d1-7b4e-4c8a-9e05-2d6b1a8f7c33",
                          "filename": "invoice-4821.pdf",
                          "size": 48213,
                          "content_type": "application/pdf",
                          "content_disposition": "attachment",
                          "content_id": null
                        }
                      ],
                      "size": 61840,
                      "in_reply_to": null,
                      "references": [],
                      "smtp_id": "<CAF8z1x2@mail.northwind.io>",
                      "created_at": "2026-10-06T14:03:21.118Z",
                      "updated_at": "2026-10-06T14:03:21.118Z",
                      "extracted_text": "Hi, the invoice you sent on Friday lists 12 seats but we only have 10. Can you fix it?",
                      "extracted_html": null,
                      "headers": {},
                      "text": "Hi, the invoice you sent on Friday lists 12 seats but we only have 10. Can you fix it?\n\nThanks,\nDana",
                      "html": "<p>Hi, the invoice you sent on Friday lists 12 seats but we only have 10. Can you fix it?</p><p>Thanks,<br>Dana</p>"
                    }
                  ],
                  "last_message_id": "8d2c4a91-3f7e-4b6d-a0c2-5e1f9b7d3a64"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "patch": {
        "operationId": "amUpdateThread",
        "summary": "Update thread (organization)",
        "description": "Adds and removes labels on a thread by ID. Works like the inbox route.",
        "tags": [
          "Threads"
        ],
        "x-docs-ids": [
          "am-update-thread"
        ],
        "parameters": [
          {
            "name": "thread_id",
            "in": "path",
            "required": true,
            "description": "The thread ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "add_labels": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Labels to add."
                  },
                  "remove_labels": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Labels to remove."
                  }
                }
              },
              "example": {
                "add_labels": [
                  "resolved"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "inbox_id": {
                      "type": "string"
                    },
                    "thread_id": {
                      "type": "string"
                    },
                    "labels": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "timestamp": {
                      "type": "string"
                    },
                    "senders": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "recipients": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "message_count": {
                      "type": "number"
                    },
                    "subject": {
                      "type": "string"
                    },
                    "preview": {
                      "type": "string"
                    },
                    "size": {
                      "type": "number"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "inbox_id": "support@acme.com",
                  "thread_id": "0b6f1d2e-58c4-4e0a-9d61-7f3a2c9e4b10",
                  "labels": [
                    "unread",
                    "billing",
                    "resolved"
                  ],
                  "timestamp": "2026-10-06T14:03:21.118Z",
                  "senders": [
                    "dana@northwind.io"
                  ],
                  "recipients": [
                    "support@acme.com"
                  ],
                  "message_count": 1,
                  "subject": "Invoice #4821 is wrong",
                  "preview": "Hi, the invoice you sent on Friday lists 12 seats but we only have 10...",
                  "size": 0,
                  "created_at": "2026-10-06T14:03:21.118Z",
                  "updated_at": "2026-10-06T14:03:21.118Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "delete": {
        "operationId": "amDeleteThread",
        "summary": "Delete thread (organization)",
        "description": "Moves the thread to trash, or removes it for good when it is already in trash.",
        "tags": [
          "Threads"
        ],
        "x-docs-ids": [
          "am-delete-thread"
        ],
        "parameters": [
          {
            "name": "thread_id",
            "in": "path",
            "required": true,
            "description": "The thread ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {}
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/threads/{thread_id}/attachments/{attachment_id}": {
      "get": {
        "operationId": "amGetThreadAttachment",
        "summary": "Get thread attachment (organization)",
        "description": "Gets an attachment from a thread by ID, with a signed download link that works for one hour.",
        "tags": [
          "Threads"
        ],
        "x-docs-ids": [
          "am-get-thread-attachment"
        ],
        "parameters": [
          {
            "name": "thread_id",
            "in": "path",
            "required": true,
            "description": "The thread ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "attachment_id",
            "in": "path",
            "required": true,
            "description": "The attachment ID, from the message's `attachments[].attachment_id`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "attachment_id": {
                      "type": "string"
                    },
                    "filename": {
                      "type": "string"
                    },
                    "size": {
                      "type": "number"
                    },
                    "content_type": {
                      "type": "string"
                    },
                    "content_disposition": {
                      "type": "string"
                    },
                    "content_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "download_url": {
                      "type": "string"
                    },
                    "expires_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "text_url": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "attachment_id": "f3a9c2d1-7b4e-4c8a-9e05-2d6b1a8f7c33",
                  "filename": "invoice-4821.pdf",
                  "size": 48213,
                  "content_type": "application/pdf",
                  "content_disposition": "attachment",
                  "content_id": null,
                  "download_url": "https://api.send.io/download/eyJ0IjoiYXR0YWNobWVudCJ9.k3Jd9sQ",
                  "expires_at": "2026-10-06T15:20:00Z",
                  "text_url": "https://api.send.io/download/eyJ0IjoiYXR0YWNobWVudCJ9.k3Jd9sQ?format=text"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/inboxes/{inbox_id}/drafts": {
      "get": {
        "operationId": "amListInboxDrafts",
        "summary": "List drafts",
        "description": "Lists the inbox's unsent drafts (pending, sending or failed), newest first.\n\n- Sent and discarded drafts are not listed.",
        "tags": [
          "Drafts"
        ],
        "x-docs-ids": [
          "am-list-inbox-drafts"
        ],
        "parameters": [
          {
            "name": "inbox_id",
            "in": "path",
            "required": true,
            "description": "The inbox's email address (for example support@acme.com). The inbox's send.io UUID also works.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Items per page, 1 to 100. Default 50. Other values answer 422.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "required": false,
            "description": "The `next_page_token` from the previous page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "labels",
            "in": "query",
            "required": false,
            "description": "Only items that have all of these labels. Send a JSON array (labels=[\"unread\"]), a comma list, or repeat the parameter.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "drafts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "send_status": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "`scheduled`: pending, with a `send_at` time. `sending`: a scheduled send is going out. `failed`: a scheduled send failed; change the draft or send it again. `null`: pending with no `send_at`, and also once the draft was sent (Get draft still returns a sent draft, the lists do not). A deleted draft is never returned: 404."
                          },
                          "inbox_id": {
                            "type": "string"
                          },
                          "draft_id": {
                            "type": "string"
                          },
                          "client_id": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "labels": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "to": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "cc": {
                            "type": "array"
                          },
                          "bcc": {
                            "type": "array"
                          },
                          "reply_to": {
                            "type": "array"
                          },
                          "subject": {
                            "type": "string"
                          },
                          "preview": {
                            "type": "string"
                          },
                          "text": {
                            "type": "string"
                          },
                          "html": {},
                          "attachments": {
                            "type": "array"
                          },
                          "thread_id": {
                            "type": "string"
                          },
                          "in_reply_to": {
                            "type": "string"
                          },
                          "forward_of": {},
                          "send_at": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date-time"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updated_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    },
                    "count": {
                      "type": "number"
                    },
                    "limit": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "count": 1,
                  "limit": 50,
                  "drafts": [
                    {
                      "inbox_id": "support@acme.com",
                      "draft_id": "5c7e2a10-9b3d-4f61-8e2a-1d4c6b9f0e87",
                      "client_id": null,
                      "labels": [
                        "needs-review"
                      ],
                      "to": [
                        "dana@northwind.io"
                      ],
                      "cc": [],
                      "bcc": [],
                      "reply_to": [],
                      "subject": "Re: Invoice #4821 is wrong",
                      "preview": "Hi Dana, sorry about that. I've corrected the invoice to 10 seats...",
                      "text": "Hi Dana, sorry about that. I've corrected the invoice to 10 seats and attached the new copy.",
                      "html": null,
                      "attachments": [],
                      "thread_id": "0b6f1d2e-58c4-4e0a-9d61-7f3a2c9e4b10",
                      "in_reply_to": "8d2c4a91-3f7e-4b6d-a0c2-5e1f9b7d3a64",
                      "forward_of": null,
                      "send_status": null,
                      "send_at": null,
                      "created_at": "2026-10-06T14:10:02.331Z",
                      "updated_at": "2026-10-06T14:10:02.331Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "post": {
        "operationId": "amCreateDraft",
        "summary": "Create draft",
        "description": "Creates a draft. Set `in_reply_to` to draft a reply in that message's thread, or `forward_of` to draft a forward.\n\n- `send_status` on every draft route. `scheduled`: pending, with a `send_at` time. `sending`: a scheduled send is going out. `failed`: a scheduled send failed; change the draft or send it again. `null`: pending with no `send_at`, and also once the draft was sent (Get draft still returns a sent draft, the lists do not). A deleted draft is never returned: 404.\n\n- Recipients are checked when the draft is saved, as on send: an address that is not valid answers 422, and so does emptying `to` on a draft that is not a reply.",
        "tags": [
          "Drafts"
        ],
        "x-docs-ids": [
          "am-create-draft"
        ],
        "parameters": [
          {
            "name": "inbox_id",
            "in": "path",
            "required": true,
            "description": "The inbox's email address (for example support@acme.com). The inbox's send.io UUID also works.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "to": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "Recipients. Required unless `in_reply_to` is set; a reply draft is saved with the address it will go to (the message's Reply-To, else its sender)."
                  },
                  "cc": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "CC addresses."
                  },
                  "bcc": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "BCC addresses."
                  },
                  "reply_to": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "Reply-To addresses."
                  },
                  "subject": {
                    "type": "string",
                    "description": "Subject. For a reply, default is \"Re: \" plus the thread subject; for a forward, \"Fwd: \" plus the message's subject."
                  },
                  "text": {
                    "type": "string",
                    "description": "Plain-text body. `text` or `html` is required (except for a forward)."
                  },
                  "html": {
                    "type": "string",
                    "description": "HTML body."
                  },
                  "labels": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Labels on the draft."
                  },
                  "attachments": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    },
                    "description": "Files to attach, same shape as Send message."
                  },
                  "in_reply_to": {
                    "type": "string",
                    "description": "A message ID in this inbox. The draft becomes a reply in its thread."
                  },
                  "forward_of": {
                    "type": "string",
                    "description": "A message ID in this inbox to forward."
                  },
                  "send_at": {
                    "type": "string",
                    "description": "RFC 3339 time to send the draft automatically. Must not be in the past. Leave out to wait for a send call."
                  },
                  "client_id": {
                    "type": "string",
                    "description": "Your own ID. If a draft with this client ID exists in the inbox, it is returned instead."
                  }
                }
              },
              "example": {
                "in_reply_to": "8d2c4a91-3f7e-4b6d-a0c2-5e1f9b7d3a64",
                "text": "Hi Dana, sorry about that. I've corrected the invoice to 10 seats and attached the new copy.",
                "labels": [
                  "needs-review"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "send_status": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "`scheduled`: pending, with a `send_at` time. `sending`: a scheduled send is going out. `failed`: a scheduled send failed; change the draft or send it again. `null`: pending with no `send_at`, and also once the draft was sent (Get draft still returns a sent draft, the lists do not). A deleted draft is never returned: 404."
                    },
                    "inbox_id": {
                      "type": "string"
                    },
                    "draft_id": {
                      "type": "string"
                    },
                    "client_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "labels": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "to": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "cc": {
                      "type": "array"
                    },
                    "bcc": {
                      "type": "array"
                    },
                    "reply_to": {
                      "type": "array"
                    },
                    "subject": {
                      "type": "string"
                    },
                    "preview": {
                      "type": "string"
                    },
                    "text": {
                      "type": "string"
                    },
                    "html": {},
                    "attachments": {
                      "type": "array"
                    },
                    "thread_id": {
                      "type": "string"
                    },
                    "in_reply_to": {
                      "type": "string"
                    },
                    "forward_of": {},
                    "send_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "inbox_id": "support@acme.com",
                  "draft_id": "5c7e2a10-9b3d-4f61-8e2a-1d4c6b9f0e87",
                  "client_id": null,
                  "labels": [
                    "needs-review"
                  ],
                  "to": [
                    "dana@northwind.io"
                  ],
                  "cc": [],
                  "bcc": [],
                  "reply_to": [],
                  "subject": "Re: Invoice #4821 is wrong",
                  "preview": "Hi Dana, sorry about that. I've corrected the invoice to 10 seats...",
                  "text": "Hi Dana, sorry about that. I've corrected the invoice to 10 seats and attached the new copy.",
                  "html": null,
                  "attachments": [],
                  "thread_id": "0b6f1d2e-58c4-4e0a-9d61-7f3a2c9e4b10",
                  "in_reply_to": "8d2c4a91-3f7e-4b6d-a0c2-5e1f9b7d3a64",
                  "forward_of": null,
                  "send_status": null,
                  "send_at": null,
                  "created_at": "2026-10-06T14:10:02.331Z",
                  "updated_at": "2026-10-06T14:10:02.331Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/inboxes/{inbox_id}/drafts/{draft_id}": {
      "get": {
        "operationId": "amGetInboxDraft",
        "summary": "Get draft",
        "description": "Gets one draft.\n\n- A sent draft is still returned, with `send_status` null. A deleted draft answers 404.",
        "tags": [
          "Drafts"
        ],
        "x-docs-ids": [
          "am-get-inbox-draft"
        ],
        "parameters": [
          {
            "name": "inbox_id",
            "in": "path",
            "required": true,
            "description": "The inbox's email address (for example support@acme.com). The inbox's send.io UUID also works.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "draft_id",
            "in": "path",
            "required": true,
            "description": "The draft ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "send_status": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "`scheduled`: pending, with a `send_at` time. `sending`: a scheduled send is going out. `failed`: a scheduled send failed; change the draft or send it again. `null`: pending with no `send_at`, and also once the draft was sent (Get draft still returns a sent draft, the lists do not). A deleted draft is never returned: 404."
                    },
                    "inbox_id": {
                      "type": "string"
                    },
                    "draft_id": {
                      "type": "string"
                    },
                    "client_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "labels": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "to": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "cc": {
                      "type": "array"
                    },
                    "bcc": {
                      "type": "array"
                    },
                    "reply_to": {
                      "type": "array"
                    },
                    "subject": {
                      "type": "string"
                    },
                    "preview": {
                      "type": "string"
                    },
                    "text": {
                      "type": "string"
                    },
                    "html": {},
                    "attachments": {
                      "type": "array"
                    },
                    "thread_id": {
                      "type": "string"
                    },
                    "in_reply_to": {
                      "type": "string"
                    },
                    "forward_of": {},
                    "send_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "inbox_id": "support@acme.com",
                  "draft_id": "5c7e2a10-9b3d-4f61-8e2a-1d4c6b9f0e87",
                  "client_id": null,
                  "labels": [
                    "needs-review"
                  ],
                  "to": [
                    "dana@northwind.io"
                  ],
                  "cc": [],
                  "bcc": [],
                  "reply_to": [],
                  "subject": "Re: Invoice #4821 is wrong",
                  "preview": "Hi Dana, sorry about that. I've corrected the invoice to 10 seats...",
                  "text": "Hi Dana, sorry about that. I've corrected the invoice to 10 seats and attached the new copy.",
                  "html": null,
                  "attachments": [],
                  "thread_id": "0b6f1d2e-58c4-4e0a-9d61-7f3a2c9e4b10",
                  "in_reply_to": "8d2c4a91-3f7e-4b6d-a0c2-5e1f9b7d3a64",
                  "forward_of": null,
                  "send_status": null,
                  "send_at": null,
                  "created_at": "2026-10-06T14:10:02.331Z",
                  "updated_at": "2026-10-06T14:10:02.331Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "patch": {
        "operationId": "amUpdateDraft",
        "summary": "Update draft",
        "description": "Changes a pending draft. Only the fields you send are changed.\n\n- Only a pending or failed draft can be changed. Any other answers 409 `validation_error` with \"Only a pending or failed draft can be changed.\"",
        "tags": [
          "Drafts"
        ],
        "x-docs-ids": [
          "am-update-draft"
        ],
        "parameters": [
          {
            "name": "inbox_id",
            "in": "path",
            "required": true,
            "description": "The inbox's email address (for example support@acme.com). The inbox's send.io UUID also works.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "draft_id",
            "in": "path",
            "required": true,
            "description": "The draft ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "to": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "Recipients."
                  },
                  "cc": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "CC addresses."
                  },
                  "bcc": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "BCC addresses."
                  },
                  "reply_to": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "Reply-To addresses."
                  },
                  "subject": {
                    "type": "string",
                    "description": "Subject."
                  },
                  "text": {
                    "type": "string",
                    "description": "Plain-text body."
                  },
                  "html": {
                    "type": "string",
                    "description": "HTML body."
                  },
                  "labels": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Replaces the draft's labels."
                  },
                  "attachments": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    },
                    "description": "Replaces the draft's attachments."
                  },
                  "send_at": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "RFC 3339 send time, or null to unschedule."
                  }
                }
              },
              "example": {
                "text": "Hi Dana, the corrected invoice (10 seats) is attached. Sorry for the trouble!",
                "send_at": "2026-11-25T09:00:00Z"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "send_status": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "`scheduled`: pending, with a `send_at` time. `sending`: a scheduled send is going out. `failed`: a scheduled send failed; change the draft or send it again. `null`: pending with no `send_at`, and also once the draft was sent (Get draft still returns a sent draft, the lists do not). A deleted draft is never returned: 404."
                    },
                    "inbox_id": {
                      "type": "string"
                    },
                    "draft_id": {
                      "type": "string"
                    },
                    "client_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "labels": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "to": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "cc": {
                      "type": "array"
                    },
                    "bcc": {
                      "type": "array"
                    },
                    "reply_to": {
                      "type": "array"
                    },
                    "subject": {
                      "type": "string"
                    },
                    "preview": {
                      "type": "string"
                    },
                    "text": {
                      "type": "string"
                    },
                    "html": {},
                    "attachments": {
                      "type": "array"
                    },
                    "thread_id": {
                      "type": "string"
                    },
                    "in_reply_to": {
                      "type": "string"
                    },
                    "forward_of": {},
                    "send_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "inbox_id": "support@acme.com",
                  "draft_id": "5c7e2a10-9b3d-4f61-8e2a-1d4c6b9f0e87",
                  "client_id": null,
                  "labels": [
                    "needs-review"
                  ],
                  "to": [
                    "dana@northwind.io"
                  ],
                  "cc": [],
                  "bcc": [],
                  "reply_to": [],
                  "subject": "Re: Invoice #4821 is wrong",
                  "preview": "Hi Dana, sorry about that. I've corrected the invoice to 10 seats...",
                  "text": "Hi Dana, the corrected invoice (10 seats) is attached. Sorry for the trouble!",
                  "html": null,
                  "attachments": [],
                  "thread_id": "0b6f1d2e-58c4-4e0a-9d61-7f3a2c9e4b10",
                  "in_reply_to": "8d2c4a91-3f7e-4b6d-a0c2-5e1f9b7d3a64",
                  "forward_of": null,
                  "send_status": "scheduled",
                  "send_at": "2026-11-25T09:00:00Z",
                  "created_at": "2026-10-06T14:10:02.331Z",
                  "updated_at": "2026-10-06T14:10:02.331Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "delete": {
        "operationId": "amDeleteDraft",
        "summary": "Delete draft",
        "description": "Discards a pending draft so it is never sent.\n\n- Only a pending or failed draft can be discarded. Any other answers 409 `validation_error` with \"Only a pending or failed draft can be discarded.\"",
        "tags": [
          "Drafts"
        ],
        "x-docs-ids": [
          "am-delete-draft"
        ],
        "parameters": [
          {
            "name": "inbox_id",
            "in": "path",
            "required": true,
            "description": "The inbox's email address (for example support@acme.com). The inbox's send.io UUID also works.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "draft_id",
            "in": "path",
            "required": true,
            "description": "The draft ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {}
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/inboxes/{inbox_id}/drafts/{draft_id}/send": {
      "post": {
        "operationId": "amSendDraft",
        "summary": "Send draft",
        "description": "Sends a pending draft now. Use this when a human approves the agent's draft.\n\n- Send an `Idempotency-Key` header (1 to 256 characters) to make retries safe: the same key and body within 24 hours returns the first response.\n\n- Only a pending or failed draft can be sent. A draft that was already sent, is being sent or was discarded answers 409 `validation_error` with \"Only a pending or failed draft can be sent.\" No request body is needed.",
        "tags": [
          "Drafts"
        ],
        "x-docs-ids": [
          "am-send-draft"
        ],
        "parameters": [
          {
            "name": "inbox_id",
            "in": "path",
            "required": true,
            "description": "The inbox's email address (for example support@acme.com). The inbox's send.io UUID also works.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "draft_id",
            "in": "path",
            "required": true,
            "description": "The draft ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Makes a retry safe: the same key and body within 24 hours returns the first response instead of doing the work again. A key still in use by a request that has not finished, or reused with a different body, answers 409.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message_id": {
                      "type": "string"
                    },
                    "thread_id": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "message_id": "2e9f7b3c-6a1d-4c58-b0e4-9d3f2a7c1b65",
                  "thread_id": "0b6f1d2e-58c4-4e0a-9d61-7f3a2c9e4b10"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/drafts": {
      "get": {
        "operationId": "amListDrafts",
        "summary": "List drafts (organization)",
        "description": "Lists unsent drafts across every inbox in the organization, newest first.\n\n- A scoped key only sees drafts in its inbox or pod.",
        "tags": [
          "Drafts"
        ],
        "x-docs-ids": [
          "am-list-drafts"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Items per page, 1 to 100. Default 50. Other values answer 422.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "required": false,
            "description": "The `next_page_token` from the previous page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "labels",
            "in": "query",
            "required": false,
            "description": "Only items that have all of these labels. Send a JSON array (labels=[\"unread\"]), a comma list, or repeat the parameter.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "drafts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "send_status": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "`scheduled`: pending, with a `send_at` time. `sending`: a scheduled send is going out. `failed`: a scheduled send failed; change the draft or send it again. `null`: pending with no `send_at`, and also once the draft was sent (Get draft still returns a sent draft, the lists do not). A deleted draft is never returned: 404."
                          },
                          "inbox_id": {
                            "type": "string"
                          },
                          "draft_id": {
                            "type": "string"
                          },
                          "client_id": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "labels": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "to": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "cc": {
                            "type": "array"
                          },
                          "bcc": {
                            "type": "array"
                          },
                          "reply_to": {
                            "type": "array"
                          },
                          "subject": {
                            "type": "string"
                          },
                          "preview": {
                            "type": "string"
                          },
                          "text": {
                            "type": "string"
                          },
                          "html": {},
                          "attachments": {
                            "type": "array"
                          },
                          "thread_id": {
                            "type": "string"
                          },
                          "in_reply_to": {
                            "type": "string"
                          },
                          "forward_of": {},
                          "send_at": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date-time"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updated_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    },
                    "count": {
                      "type": "number"
                    },
                    "limit": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "count": 1,
                  "limit": 50,
                  "drafts": [
                    {
                      "inbox_id": "support@acme.com",
                      "draft_id": "5c7e2a10-9b3d-4f61-8e2a-1d4c6b9f0e87",
                      "client_id": null,
                      "labels": [
                        "needs-review"
                      ],
                      "to": [
                        "dana@northwind.io"
                      ],
                      "cc": [],
                      "bcc": [],
                      "reply_to": [],
                      "subject": "Re: Invoice #4821 is wrong",
                      "preview": "Hi Dana, sorry about that. I've corrected the invoice to 10 seats...",
                      "text": "Hi Dana, sorry about that. I've corrected the invoice to 10 seats and attached the new copy.",
                      "html": null,
                      "attachments": [],
                      "thread_id": "0b6f1d2e-58c4-4e0a-9d61-7f3a2c9e4b10",
                      "in_reply_to": "8d2c4a91-3f7e-4b6d-a0c2-5e1f9b7d3a64",
                      "forward_of": null,
                      "send_status": null,
                      "send_at": null,
                      "created_at": "2026-10-06T14:10:02.331Z",
                      "updated_at": "2026-10-06T14:10:02.331Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/drafts/{draft_id}": {
      "get": {
        "operationId": "amGetDraft",
        "summary": "Get draft (organization)",
        "description": "Gets a draft by ID without knowing its inbox.\n\n- A sent draft is still returned, with `send_status` null. A deleted draft answers 404.",
        "tags": [
          "Drafts"
        ],
        "x-docs-ids": [
          "am-get-draft"
        ],
        "parameters": [
          {
            "name": "draft_id",
            "in": "path",
            "required": true,
            "description": "The draft ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "send_status": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "`scheduled`: pending, with a `send_at` time. `sending`: a scheduled send is going out. `failed`: a scheduled send failed; change the draft or send it again. `null`: pending with no `send_at`, and also once the draft was sent (Get draft still returns a sent draft, the lists do not). A deleted draft is never returned: 404."
                    },
                    "inbox_id": {
                      "type": "string"
                    },
                    "draft_id": {
                      "type": "string"
                    },
                    "client_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "labels": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "to": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "cc": {
                      "type": "array"
                    },
                    "bcc": {
                      "type": "array"
                    },
                    "reply_to": {
                      "type": "array"
                    },
                    "subject": {
                      "type": "string"
                    },
                    "preview": {
                      "type": "string"
                    },
                    "text": {
                      "type": "string"
                    },
                    "html": {},
                    "attachments": {
                      "type": "array"
                    },
                    "thread_id": {
                      "type": "string"
                    },
                    "in_reply_to": {
                      "type": "string"
                    },
                    "forward_of": {},
                    "send_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "inbox_id": "support@acme.com",
                  "draft_id": "5c7e2a10-9b3d-4f61-8e2a-1d4c6b9f0e87",
                  "client_id": null,
                  "labels": [
                    "needs-review"
                  ],
                  "to": [
                    "dana@northwind.io"
                  ],
                  "cc": [],
                  "bcc": [],
                  "reply_to": [],
                  "subject": "Re: Invoice #4821 is wrong",
                  "preview": "Hi Dana, sorry about that. I've corrected the invoice to 10 seats...",
                  "text": "Hi Dana, sorry about that. I've corrected the invoice to 10 seats and attached the new copy.",
                  "html": null,
                  "attachments": [],
                  "thread_id": "0b6f1d2e-58c4-4e0a-9d61-7f3a2c9e4b10",
                  "in_reply_to": "8d2c4a91-3f7e-4b6d-a0c2-5e1f9b7d3a64",
                  "forward_of": null,
                  "send_status": null,
                  "send_at": null,
                  "created_at": "2026-10-06T14:10:02.331Z",
                  "updated_at": "2026-10-06T14:10:02.331Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/inboxes/{inbox_id}/lists/{direction}/{type}": {
      "get": {
        "operationId": "amListInboxListEntries",
        "summary": "List entries",
        "description": "Lists the entries on one of the inbox's lists, sorted by entry.",
        "tags": [
          "Inbox lists (Agent inboxes)"
        ],
        "x-docs-ids": [
          "am-list-inbox-list-entries"
        ],
        "parameters": [
          {
            "name": "inbox_id",
            "in": "path",
            "required": true,
            "description": "The inbox's email address (for example support@acme.com). The inbox's send.io UUID also works.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "direction",
            "in": "path",
            "required": true,
            "description": "`send`, `receive` or `reply`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "path",
            "required": true,
            "description": "`allow` or `block`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Items per page, 1 to 100. Default 50. Other values answer 422.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "required": false,
            "description": "The `next_page_token` from the previous page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "number"
                    },
                    "limit": {
                      "type": "number"
                    },
                    "entries": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "entry": {
                            "type": "string"
                          },
                          "entry_type": {
                            "type": "string"
                          },
                          "list_type": {
                            "type": "string"
                          },
                          "direction": {
                            "type": "string"
                          },
                          "inbox_id": {
                            "type": "string"
                          },
                          "pod_id": {
                            "type": "string"
                          },
                          "organization_id": {
                            "type": "string"
                          },
                          "reason": {
                            "type": "string"
                          },
                          "read_only": {
                            "type": "boolean"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "count": 1,
                  "limit": 50,
                  "entries": [
                    {
                      "entry": "northwind.io",
                      "entry_type": "domain",
                      "list_type": "allow",
                      "direction": "receive",
                      "inbox_id": "support@acme.com",
                      "pod_id": "default",
                      "organization_id": "3c9a1e7b-5d2f-4b8a-a6c0-8e4d2f1b9a73",
                      "reason": "Key customer",
                      "read_only": false,
                      "created_at": "2026-10-04T10:15:00.000Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "post": {
        "operationId": "amCreateInboxListEntry",
        "summary": "Create entry",
        "description": "Adds an email address or domain to the list. Adding an existing entry updates its reason.\n\n- `entry_type` is `email` when the entry has an @, otherwise `domain`.",
        "tags": [
          "Inbox lists (Agent inboxes)"
        ],
        "x-docs-ids": [
          "am-create-inbox-list-entry"
        ],
        "parameters": [
          {
            "name": "inbox_id",
            "in": "path",
            "required": true,
            "description": "The inbox's email address (for example support@acme.com). The inbox's send.io UUID also works.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "direction",
            "in": "path",
            "required": true,
            "description": "`send`, `receive` or `reply`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "path",
            "required": true,
            "description": "`allow` or `block`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "entry": {
                    "type": "string",
                    "description": "An email address or a domain. Stored lowercased."
                  },
                  "reason": {
                    "type": "string",
                    "description": "Why it is on the list."
                  }
                },
                "required": [
                  "entry"
                ]
              },
              "example": {
                "entry": "northwind.io",
                "reason": "Key customer"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "entry": {
                      "type": "string"
                    },
                    "entry_type": {
                      "type": "string"
                    },
                    "list_type": {
                      "type": "string"
                    },
                    "direction": {
                      "type": "string"
                    },
                    "inbox_id": {
                      "type": "string"
                    },
                    "pod_id": {
                      "type": "string"
                    },
                    "organization_id": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    },
                    "read_only": {
                      "type": "boolean"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "entry": "northwind.io",
                  "entry_type": "domain",
                  "list_type": "allow",
                  "direction": "receive",
                  "inbox_id": "support@acme.com",
                  "pod_id": "default",
                  "organization_id": "3c9a1e7b-5d2f-4b8a-a6c0-8e4d2f1b9a73",
                  "reason": "Key customer",
                  "read_only": false,
                  "created_at": "2026-10-04T10:15:00.000Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/inboxes/{inbox_id}/lists/{direction}/{type}/{entry}": {
      "get": {
        "operationId": "amGetInboxListEntry",
        "summary": "Get entry",
        "description": "Gets one entry from the list.",
        "tags": [
          "Inbox lists (Agent inboxes)"
        ],
        "x-docs-ids": [
          "am-get-inbox-list-entry"
        ],
        "parameters": [
          {
            "name": "inbox_id",
            "in": "path",
            "required": true,
            "description": "The inbox's email address (for example support@acme.com). The inbox's send.io UUID also works.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "direction",
            "in": "path",
            "required": true,
            "description": "`send`, `receive` or `reply`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "path",
            "required": true,
            "description": "`allow` or `block`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "entry",
            "in": "path",
            "required": true,
            "description": "The email address or domain.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "entry": {
                      "type": "string"
                    },
                    "entry_type": {
                      "type": "string"
                    },
                    "list_type": {
                      "type": "string"
                    },
                    "direction": {
                      "type": "string"
                    },
                    "inbox_id": {
                      "type": "string"
                    },
                    "pod_id": {
                      "type": "string"
                    },
                    "organization_id": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    },
                    "read_only": {
                      "type": "boolean"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "entry": "northwind.io",
                  "entry_type": "domain",
                  "list_type": "allow",
                  "direction": "receive",
                  "inbox_id": "support@acme.com",
                  "pod_id": "default",
                  "organization_id": "3c9a1e7b-5d2f-4b8a-a6c0-8e4d2f1b9a73",
                  "reason": "Key customer",
                  "read_only": false,
                  "created_at": "2026-10-04T10:15:00.000Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "delete": {
        "operationId": "amDeleteInboxListEntry",
        "summary": "Delete entry",
        "description": "Removes an entry from the list.",
        "tags": [
          "Inbox lists (Agent inboxes)"
        ],
        "x-docs-ids": [
          "am-delete-inbox-list-entry"
        ],
        "parameters": [
          {
            "name": "inbox_id",
            "in": "path",
            "required": true,
            "description": "The inbox's email address (for example support@acme.com). The inbox's send.io UUID also works.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "direction",
            "in": "path",
            "required": true,
            "description": "`send`, `receive` or `reply`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "path",
            "required": true,
            "description": "`allow` or `block`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "entry",
            "in": "path",
            "required": true,
            "description": "The email address or domain.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {}
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/inboxes/{inbox_id}/webhooks": {
      "get": {
        "operationId": "amListInboxWebhooks",
        "summary": "List webhooks",
        "description": "Lists the webhooks that cover this inbox, newest first.",
        "tags": [
          "Inbox webhooks"
        ],
        "x-docs-ids": [
          "am-list-inbox-webhooks"
        ],
        "parameters": [
          {
            "name": "inbox_id",
            "in": "path",
            "required": true,
            "description": "The inbox's email address (for example support@acme.com). The inbox's send.io UUID also works.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Items per page, 1 to 100. Default 50. Other values answer 422.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "required": false,
            "description": "The `next_page_token` from the previous page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "number"
                    },
                    "limit": {
                      "type": "number"
                    },
                    "webhooks": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "webhook_id": {
                            "type": "string"
                          },
                          "id": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string"
                          },
                          "event_types": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "enabled": {
                            "type": "boolean"
                          },
                          "client_id": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "inbox_ids": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "pod_ids": {
                            "type": "array"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updated_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "count": 1,
                  "limit": 50,
                  "webhooks": [
                    {
                      "webhook_id": "a4b8c2d6-1e3f-4a5b-9c7d-0e2f4a6b8c1d",
                      "id": "a4b8c2d6-1e3f-4a5b-9c7d-0e2f4a6b8c1d",
                      "url": "https://hooks.acme.com/agent",
                      "event_types": [
                        "message.received",
                        "message.bounced"
                      ],
                      "enabled": true,
                      "client_id": null,
                      "inbox_ids": [
                        "support@acme.com"
                      ],
                      "pod_ids": [],
                      "created_at": "2026-10-02T11:00:00.000Z",
                      "updated_at": "2026-10-02T11:00:00.000Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "post": {
        "operationId": "amCreateInboxWebhook",
        "summary": "Create webhook",
        "description": "Creates a webhook for this inbox. The response includes the signing `secret`. This API shows it only here; lost it? Rotate it with Rotate webhook secret.\n\n- Inbox webhooks are team webhooks limited to inboxes or pods, so the team API manages the same webhook by the same ID: GET /webhooks/{id} (an admin's dashboard session or a full-access key) also returns its `signing_secret`, with `endpoint`, `events` and `status` for `url`, `event_types` and `enabled`.",
        "tags": [
          "Inbox webhooks"
        ],
        "x-docs-ids": [
          "am-create-inbox-webhook"
        ],
        "parameters": [
          {
            "name": "inbox_id",
            "in": "path",
            "required": true,
            "description": "The inbox's email address (for example support@acme.com). The inbox's send.io UUID also works.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "The HTTPS URL to post events to."
                  },
                  "event_types": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Events to send: `message.received`, `message.received.spam`, `message.sent`, `message.delivered`, `message.bounced`, `message.complained`, `message.rejected`, `message.opened`. Default `[\"message.received\"]`. Any other type answers 422: an inbox webhook only receives this inbox's message events (`domain.verified` needs a team webhook)."
                  },
                  "inbox_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "More inboxes (addresses or IDs) the webhook covers."
                  },
                  "pod_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Pods the webhook covers."
                  },
                  "client_id": {
                    "type": "string",
                    "description": "Your own ID. If a webhook with this client ID exists, it is returned instead."
                  }
                },
                "required": [
                  "url"
                ]
              },
              "example": {
                "url": "https://hooks.acme.com/agent",
                "event_types": [
                  "message.received",
                  "message.bounced"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "webhook_id": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "event_types": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "enabled": {
                      "type": "boolean"
                    },
                    "client_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "inbox_ids": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "pod_ids": {
                      "type": "array"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "secret": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "webhook_id": "a4b8c2d6-1e3f-4a5b-9c7d-0e2f4a6b8c1d",
                  "id": "a4b8c2d6-1e3f-4a5b-9c7d-0e2f4a6b8c1d",
                  "url": "https://hooks.acme.com/agent",
                  "event_types": [
                    "message.received",
                    "message.bounced"
                  ],
                  "enabled": true,
                  "client_id": null,
                  "inbox_ids": [
                    "support@acme.com"
                  ],
                  "pod_ids": [],
                  "created_at": "2026-10-02T11:00:00.000Z",
                  "updated_at": "2026-10-02T11:00:00.000Z",
                  "secret": "whsec_c2VuZGlvLXdlYmhvb2stc2VjcmV0LWV4YW1wbGU="
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/inboxes/{inbox_id}/webhooks/{webhook_id}": {
      "get": {
        "operationId": "amGetInboxWebhook",
        "summary": "Get webhook",
        "description": "Gets one webhook that covers this inbox.",
        "tags": [
          "Inbox webhooks"
        ],
        "x-docs-ids": [
          "am-get-inbox-webhook"
        ],
        "parameters": [
          {
            "name": "inbox_id",
            "in": "path",
            "required": true,
            "description": "The inbox's email address (for example support@acme.com). The inbox's send.io UUID also works.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook_id",
            "in": "path",
            "required": true,
            "description": "The webhook ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "webhook_id": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "event_types": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "enabled": {
                      "type": "boolean"
                    },
                    "client_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "inbox_ids": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "pod_ids": {
                      "type": "array"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "webhook_id": "a4b8c2d6-1e3f-4a5b-9c7d-0e2f4a6b8c1d",
                  "id": "a4b8c2d6-1e3f-4a5b-9c7d-0e2f4a6b8c1d",
                  "url": "https://hooks.acme.com/agent",
                  "event_types": [
                    "message.received",
                    "message.bounced"
                  ],
                  "enabled": true,
                  "client_id": null,
                  "inbox_ids": [
                    "support@acme.com"
                  ],
                  "pod_ids": [],
                  "created_at": "2026-10-02T11:00:00.000Z",
                  "updated_at": "2026-10-02T11:00:00.000Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "patch": {
        "operationId": "amUpdateInboxWebhook",
        "summary": "Update webhook",
        "description": "Changes a webhook's URL, events, on/off state or the inboxes and pods it covers.",
        "tags": [
          "Inbox webhooks"
        ],
        "x-docs-ids": [
          "am-update-inbox-webhook"
        ],
        "parameters": [
          {
            "name": "inbox_id",
            "in": "path",
            "required": true,
            "description": "The inbox's email address (for example support@acme.com). The inbox's send.io UUID also works.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook_id",
            "in": "path",
            "required": true,
            "description": "The webhook ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "New URL."
                  },
                  "event_types": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Replaces the event list."
                  },
                  "enabled": {
                    "type": "boolean",
                    "description": "Turn the webhook on or off."
                  },
                  "add_inbox_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Inboxes to add."
                  },
                  "remove_inbox_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Inboxes to remove."
                  },
                  "add_pod_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Pods to add."
                  },
                  "remove_pod_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Pods to remove."
                  }
                }
              },
              "example": {
                "enabled": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "webhook_id": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "event_types": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "enabled": {
                      "type": "boolean"
                    },
                    "client_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "inbox_ids": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "pod_ids": {
                      "type": "array"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "webhook_id": "a4b8c2d6-1e3f-4a5b-9c7d-0e2f4a6b8c1d",
                  "id": "a4b8c2d6-1e3f-4a5b-9c7d-0e2f4a6b8c1d",
                  "url": "https://hooks.acme.com/agent",
                  "event_types": [
                    "message.received",
                    "message.bounced"
                  ],
                  "enabled": false,
                  "client_id": null,
                  "inbox_ids": [
                    "support@acme.com"
                  ],
                  "pod_ids": [],
                  "created_at": "2026-10-02T11:00:00.000Z",
                  "updated_at": "2026-10-06T16:45:00.000Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "delete": {
        "operationId": "amDeleteInboxWebhook",
        "summary": "Delete webhook",
        "description": "Deletes the webhook. No more events are sent to it.",
        "tags": [
          "Inbox webhooks"
        ],
        "x-docs-ids": [
          "am-delete-inbox-webhook"
        ],
        "parameters": [
          {
            "name": "inbox_id",
            "in": "path",
            "required": true,
            "description": "The inbox's email address (for example support@acme.com). The inbox's send.io UUID also works.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook_id",
            "in": "path",
            "required": true,
            "description": "The webhook ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "deleted": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "object": "webhook",
                  "id": "a4b8c2d6-1e3f-4a5b-9c7d-0e2f4a6b8c1d",
                  "deleted": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/inboxes/{inbox_id}/webhooks/{webhook_id}/rotate-secret": {
      "post": {
        "operationId": "amRotateInboxWebhookSecret",
        "summary": "Rotate webhook secret",
        "description": "Gives the webhook a new signing secret, returned once in `secret`. The previous secret keeps signing for 24 hours, so you can switch your receiver over.\n\n- send.io extension. Also at POST /webhooks/{webhook_id}/rotate-secret and POST /pods/{pod_id}/webhooks/{webhook_id}/rotate-secret.\n\n- A second rotation within 24 hours replaces only the current secret; the older secret keeps its original 24 hours. A key with a permission list needs `webhook_update`.",
        "tags": [
          "Inbox webhooks"
        ],
        "x-docs-ids": [
          "am-rotate-inbox-webhook-secret"
        ],
        "parameters": [
          {
            "name": "inbox_id",
            "in": "path",
            "required": true,
            "description": "The inbox's email address (for example support@acme.com). The inbox's send.io UUID also works.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook_id",
            "in": "path",
            "required": true,
            "description": "The webhook ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "webhook_id": {
                      "type": "string"
                    },
                    "secret": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "webhook_id": "a4b8c2d6-1e3f-4a5b-9c7d-0e2f4a6b8c1d",
                  "secret": "whsec_c2VuZGlvLXdlYmhvb2stc2VjcmV0LWV4YW1wbGU="
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/inboxes/{inbox_id}/webhooks/{webhook_id}/headers": {
      "get": {
        "operationId": "amGetInboxWebhookHeaders",
        "summary": "Get webhook headers",
        "description": "Gets the custom headers send.io adds to every request to this webhook.\n\n- send.io extension.",
        "tags": [
          "Inbox webhooks"
        ],
        "x-docs-ids": [
          "am-get-inbox-webhook-headers"
        ],
        "parameters": [
          {
            "name": "inbox_id",
            "in": "path",
            "required": true,
            "description": "The inbox's email address (for example support@acme.com). The inbox's send.io UUID also works.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook_id",
            "in": "path",
            "required": true,
            "description": "The webhook ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "webhook_id": {
                      "type": "string"
                    },
                    "headers": {
                      "type": "object",
                      "properties": {
                        "X-Acme-Token": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "webhook_id": "a4b8c2d6-1e3f-4a5b-9c7d-0e2f4a6b8c1d",
                  "headers": {
                    "X-Acme-Token": "t0k3n-4821"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "patch": {
        "operationId": "amUpdateInboxWebhookHeaders",
        "summary": "Update webhook headers",
        "description": "Sets or removes custom headers. A header with a null value is removed.\n\n- send.io extension.\n\n- `svix-*`, `Content-Type`, `Content-Length`, `Host` and `User-Agent` cannot be set.",
        "tags": [
          "Inbox webhooks"
        ],
        "x-docs-ids": [
          "am-update-inbox-webhook-headers"
        ],
        "parameters": [
          {
            "name": "inbox_id",
            "in": "path",
            "required": true,
            "description": "The inbox's email address (for example support@acme.com). The inbox's send.io UUID also works.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook_id",
            "in": "path",
            "required": true,
            "description": "The webhook ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "headers": {
                    "type": "object",
                    "description": "Header names and values. null removes a header.",
                    "properties": {
                      "X-Acme-Token": {
                        "type": "string"
                      },
                      "X-Old-Header": {}
                    }
                  }
                },
                "required": [
                  "headers"
                ]
              },
              "example": {
                "headers": {
                  "X-Acme-Token": "t0k3n-4821",
                  "X-Old-Header": null
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "webhook_id": {
                      "type": "string"
                    },
                    "headers": {
                      "type": "object",
                      "properties": {
                        "X-Acme-Token": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "webhook_id": "a4b8c2d6-1e3f-4a5b-9c7d-0e2f4a6b8c1d",
                  "headers": {
                    "X-Acme-Token": "t0k3n-4821"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/inboxes/{inbox_id}/api-keys": {
      "get": {
        "operationId": "amListInboxApiKeys",
        "summary": "List API keys",
        "description": "Lists the active API keys scoped to this inbox, newest first.",
        "tags": [
          "Inbox API keys"
        ],
        "x-docs-ids": [
          "am-list-inbox-api-keys"
        ],
        "parameters": [
          {
            "name": "inbox_id",
            "in": "path",
            "required": true,
            "description": "The inbox's email address (for example support@acme.com). The inbox's send.io UUID also works.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Items per page, 1 to 100. Default 50. Other values answer 422.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "required": false,
            "description": "The `next_page_token` from the previous page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "number"
                    },
                    "limit": {
                      "type": "number"
                    },
                    "api_keys": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "api_key_id": {
                            "type": "string"
                          },
                          "prefix": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "inbox_id": {
                            "type": "string"
                          },
                          "pod_id": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "permissions": {
                            "type": "object",
                            "properties": {
                              "message_read": {
                                "type": "boolean"
                              },
                              "message_reply": {
                                "type": "boolean"
                              },
                              "draft_create": {
                                "type": "boolean"
                              }
                            }
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "used_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "count": 1,
                  "limit": 50,
                  "api_keys": [
                    {
                      "api_key_id": "7f1e3d5c-9b2a-4c6e-8d0f-1a3b5c7d9e2f",
                      "prefix": "sk_live_a1b2",
                      "name": "support agent",
                      "inbox_id": "support@acme.com",
                      "pod_id": null,
                      "permissions": {
                        "message_read": true,
                        "message_reply": true,
                        "draft_create": true
                      },
                      "created_at": "2026-10-03T08:30:00.000Z",
                      "used_at": "2026-10-06T14:04:10.000Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "post": {
        "operationId": "amCreateInboxApiKey",
        "summary": "Create API key",
        "description": "Creates a key that only works for this inbox. The full key is in `api_key` and is shown only once.\n\n- Permissions: `inbox_*`, `message_read`, `message_send`, `message_reply`, `message_update`, `message_delete`, `draft_*` (including `draft_send`), `webhook_*`, `list_entry_*`, `metrics_read`, `api_key_*`, `label_spam_read`, `label_trash_read` and more.\n\n- Needs an admin key. A restricted key can only create keys with permissions it holds itself.",
        "tags": [
          "Inbox API keys"
        ],
        "x-docs-ids": [
          "am-create-inbox-api-key"
        ],
        "parameters": [
          {
            "name": "inbox_id",
            "in": "path",
            "required": true,
            "description": "The inbox's email address (for example support@acme.com). The inbox's send.io UUID also works.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "A name for the key, up to 50 characters. Default \"agent key\"."
                  },
                  "permissions": {
                    "type": "object",
                    "description": "Permission names set to true, for example `{\"message_read\": true, \"message_reply\": true}`. Leave out for every permission on the inbox.",
                    "properties": {
                      "message_read": {
                        "type": "boolean"
                      },
                      "message_reply": {
                        "type": "boolean"
                      },
                      "draft_create": {
                        "type": "boolean"
                      }
                    }
                  }
                }
              },
              "example": {
                "name": "support agent",
                "permissions": {
                  "message_read": true,
                  "message_reply": true,
                  "draft_create": true
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "api_key_id": {
                      "type": "string"
                    },
                    "prefix": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "inbox_id": {
                      "type": "string"
                    },
                    "pod_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "permissions": {
                      "type": "object",
                      "properties": {
                        "message_read": {
                          "type": "boolean"
                        },
                        "message_reply": {
                          "type": "boolean"
                        },
                        "draft_create": {
                          "type": "boolean"
                        }
                      }
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "used_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    },
                    "api_key": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "api_key_id": "7f1e3d5c-9b2a-4c6e-8d0f-1a3b5c7d9e2f",
                  "prefix": "sk_live_a1b2",
                  "name": "support agent",
                  "inbox_id": "support@acme.com",
                  "pod_id": null,
                  "permissions": {
                    "message_read": true,
                    "message_reply": true,
                    "draft_create": true
                  },
                  "created_at": "2026-10-03T08:30:00.000Z",
                  "used_at": null,
                  "api_key": "sk_live_a1b2c3d4e5f6g7h8i9j0k1l2m3n4"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/inboxes/{inbox_id}/api-keys/{key_id}": {
      "patch": {
        "operationId": "amUpdateInboxApiKey",
        "summary": "Update API key",
        "description": "Renames a key or changes its permissions.\n\n- send.io extension.",
        "tags": [
          "Inbox API keys"
        ],
        "x-docs-ids": [
          "am-update-inbox-api-key"
        ],
        "parameters": [
          {
            "name": "inbox_id",
            "in": "path",
            "required": true,
            "description": "The inbox's email address (for example support@acme.com). The inbox's send.io UUID also works.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "key_id",
            "in": "path",
            "required": true,
            "description": "The API key ID (`api_key_id`).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "New name."
                  },
                  "permissions": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "description": "Replaces the permission list. null removes the list (every permission on the inbox).",
                    "properties": {
                      "message_read": {
                        "type": "boolean"
                      },
                      "draft_create": {
                        "type": "boolean"
                      }
                    }
                  }
                }
              },
              "example": {
                "permissions": {
                  "message_read": true,
                  "draft_create": true
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "api_key_id": {
                      "type": "string"
                    },
                    "prefix": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "inbox_id": {
                      "type": "string"
                    },
                    "pod_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "permissions": {
                      "type": "object",
                      "properties": {
                        "message_read": {
                          "type": "boolean"
                        },
                        "draft_create": {
                          "type": "boolean"
                        }
                      }
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "used_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "api_key_id": "7f1e3d5c-9b2a-4c6e-8d0f-1a3b5c7d9e2f",
                  "prefix": "sk_live_a1b2",
                  "name": "support agent",
                  "inbox_id": "support@acme.com",
                  "pod_id": null,
                  "permissions": {
                    "message_read": true,
                    "draft_create": true
                  },
                  "created_at": "2026-10-03T08:30:00.000Z",
                  "used_at": "2026-10-06T14:04:10.000Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "delete": {
        "operationId": "amDeleteInboxApiKey",
        "summary": "Delete API key",
        "description": "Revokes the key. Requests with it fail from now on.\n\n- A key cannot delete itself.",
        "tags": [
          "Inbox API keys"
        ],
        "x-docs-ids": [
          "am-delete-inbox-api-key"
        ],
        "parameters": [
          {
            "name": "inbox_id",
            "in": "path",
            "required": true,
            "description": "The inbox's email address (for example support@acme.com). The inbox's send.io UUID also works.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "key_id",
            "in": "path",
            "required": true,
            "description": "The API key ID (`api_key_id`).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {}
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/inboxes/{inbox_id}/metrics/events": {
      "get": {
        "operationId": "amInboxMetricsEvents",
        "summary": "List events",
        "description": "Lists message events for the inbox (received, sent, delivered, bounced, complained, opened, rejected), newest first.\n\n- Covers the newest 1,000 events in the window.",
        "tags": [
          "Inbox metrics"
        ],
        "x-docs-ids": [
          "am-inbox-metrics-events"
        ],
        "parameters": [
          {
            "name": "inbox_id",
            "in": "path",
            "required": true,
            "description": "The inbox's email address (for example support@acme.com). The inbox's send.io UUID also works.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "description": "RFC 3339 start time. Default 30 days ago. `start_timestamp` and `after` also work.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "description": "RFC 3339 end time. Default now. `end_timestamp` and `before` also work.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "event_types",
            "in": "query",
            "required": false,
            "description": "Only these event types, for example `message.bounced`.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Items per page, 1 to 100. Default 50. Other values answer 422.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "required": false,
            "description": "The `next_page_token` from the previous page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "number"
                    },
                    "limit": {
                      "type": "number"
                    },
                    "events": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "event_type": {
                            "type": "string"
                          },
                          "timestamp": {
                            "type": "string"
                          },
                          "message_id": {
                            "type": "string"
                          },
                          "thread_id": {
                            "type": "string"
                          },
                          "recipient": {
                            "type": "string"
                          },
                          "inbox_id": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "count": 2,
                  "limit": 50,
                  "events": [
                    {
                      "event_type": "message.delivered",
                      "timestamp": "2026-10-06T14:20:05.412Z",
                      "message_id": "2e9f7b3c-6a1d-4c58-b0e4-9d3f2a7c1b65",
                      "thread_id": "0b6f1d2e-58c4-4e0a-9d61-7f3a2c9e4b10",
                      "recipient": "dana@northwind.io",
                      "inbox_id": "support@acme.com"
                    },
                    {
                      "event_type": "message.received",
                      "timestamp": "2026-10-06T14:03:21.118Z",
                      "message_id": "8d2c4a91-3f7e-4b6d-a0c2-5e1f9b7d3a64",
                      "thread_id": "0b6f1d2e-58c4-4e0a-9d61-7f3a2c9e4b10",
                      "inbox_id": "support@acme.com"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/inboxes/{inbox_id}/events": {
      "get": {
        "operationId": "amInboxEvents",
        "summary": "List events (alias)",
        "description": "Same as List events under /metrics/events.",
        "tags": [
          "Inbox metrics"
        ],
        "x-docs-ids": [
          "am-inbox-events"
        ],
        "parameters": [
          {
            "name": "inbox_id",
            "in": "path",
            "required": true,
            "description": "The inbox's email address (for example support@acme.com). The inbox's send.io UUID also works.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "description": "RFC 3339 start time. Default 30 days ago.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "description": "RFC 3339 end time. Default now.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "event_types",
            "in": "query",
            "required": false,
            "description": "Only these event types.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Items per page, 1 to 100. Default 50. Other values answer 422.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "required": false,
            "description": "The `next_page_token` from the previous page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "number"
                    },
                    "limit": {
                      "type": "number"
                    },
                    "events": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "event_type": {
                            "type": "string"
                          },
                          "timestamp": {
                            "type": "string"
                          },
                          "message_id": {
                            "type": "string"
                          },
                          "thread_id": {
                            "type": "string"
                          },
                          "inbox_id": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "count": 1,
                  "limit": 50,
                  "events": [
                    {
                      "event_type": "message.received",
                      "timestamp": "2026-10-06T14:03:21.118Z",
                      "message_id": "8d2c4a91-3f7e-4b6d-a0c2-5e1f9b7d3a64",
                      "thread_id": "0b6f1d2e-58c4-4e0a-9d61-7f3a2c9e4b10",
                      "inbox_id": "support@acme.com"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/inboxes/{inbox_id}/metrics/usage": {
      "get": {
        "operationId": "amInboxMetricsUsage",
        "summary": "Get usage",
        "description": "Counts of messages received, sent and by delivery outcome in the window.\n\n- send.io extension. Outcomes count each sent message by its latest state.\n\n- Deleting mail does not change past numbers: a deleted sent message still counts for the inbox it was sent from. `received` counts received messages still in the inbox; a permanently deleted or expired message is no longer counted.",
        "tags": [
          "Inbox metrics"
        ],
        "x-docs-ids": [
          "am-inbox-metrics-usage"
        ],
        "parameters": [
          {
            "name": "inbox_id",
            "in": "path",
            "required": true,
            "description": "The inbox's email address (for example support@acme.com). The inbox's send.io UUID also works.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "description": "RFC 3339 start time. Default 30 days ago.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "description": "RFC 3339 end time. Default now.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "received": {
                      "type": "number"
                    },
                    "sent": {
                      "type": "number"
                    },
                    "delivered": {
                      "type": "number"
                    },
                    "bounced": {
                      "type": "number"
                    },
                    "complained": {
                      "type": "number"
                    },
                    "rejected": {
                      "type": "number"
                    },
                    "opened": {
                      "type": "number"
                    },
                    "inboxes": {
                      "type": "number"
                    },
                    "start": {
                      "type": "string"
                    },
                    "end": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "received": 412,
                  "sent": 386,
                  "delivered": 371,
                  "bounced": 9,
                  "complained": 1,
                  "rejected": 2,
                  "opened": 204,
                  "inboxes": 1,
                  "start": "2026-09-06T14:30:00Z",
                  "end": "2026-10-06T14:30:00Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/inboxes/{inbox_id}/metrics/rates": {
      "get": {
        "operationId": "amInboxMetricsRates",
        "summary": "Get rates",
        "description": "Delivery, bounce, complaint, rejection and open rates for sent messages in the window, from 0 to 1.\n\n- send.io extension. Rates are 0 when nothing was sent.",
        "tags": [
          "Inbox metrics"
        ],
        "x-docs-ids": [
          "am-inbox-metrics-rates"
        ],
        "parameters": [
          {
            "name": "inbox_id",
            "in": "path",
            "required": true,
            "description": "The inbox's email address (for example support@acme.com). The inbox's send.io UUID also works.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "description": "RFC 3339 start time. Default 30 days ago.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "description": "RFC 3339 end time. Default now.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "start": {
                      "type": "string"
                    },
                    "end": {
                      "type": "string"
                    },
                    "sent": {
                      "type": "number"
                    },
                    "delivery_rate": {
                      "type": "number"
                    },
                    "bounce_rate": {
                      "type": "number"
                    },
                    "complaint_rate": {
                      "type": "number"
                    },
                    "rejection_rate": {
                      "type": "number"
                    },
                    "open_rate": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "start": "2026-09-06T14:30:00Z",
                  "end": "2026-10-06T14:30:00Z",
                  "sent": 386,
                  "delivery_rate": 0.9611,
                  "bounce_rate": 0.0233,
                  "complaint_rate": 0.0025,
                  "rejection_rate": 0.0051,
                  "open_rate": 0.5284
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/pods": {
      "get": {
        "operationId": "amListPods",
        "summary": "List Pods",
        "description": "Lists your pods, newest first. A pod-scoped API key sees only its own pod.",
        "tags": [
          "Pods (Agent inboxes)"
        ],
        "x-docs-ids": [
          "am-list-pods"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Items per page, 1 to 100. Default 50. Other values answer 422.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "required": false,
            "description": "The next_page_token from the previous page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "number"
                    },
                    "limit": {
                      "type": "number"
                    },
                    "pods": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "pod_id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "client_id": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updated_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "count": 1,
                  "limit": 50,
                  "pods": [
                    {
                      "pod_id": "3f6c1e0a-8b2d-4c55-9a1e-6d7f2b9c0e41",
                      "name": "Support agents",
                      "client_id": "support-pod",
                      "created_at": "2026-10-07T09:14:22.381Z",
                      "updated_at": "2026-10-07T09:14:22.381Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "post": {
        "operationId": "amCreatePod",
        "summary": "Create Pod",
        "description": "Creates a pod. Send a client_id to make the call safe to retry.\n\n- Inbox-scoped API keys cannot create pods.\n\n- An agent that signed up by itself must be verified by its human first (see Agent sign-up).",
        "tags": [
          "Pods (Agent inboxes)"
        ],
        "x-docs-ids": [
          "am-create-pod"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "A name for the pod, at most 100 characters."
                  },
                  "client_id": {
                    "type": "string",
                    "description": "Your own ID for idempotency. If a pod with this client_id exists, it is returned instead of a new one."
                  }
                }
              },
              "example": {
                "name": "Support agents",
                "client_id": "support-pod"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "pod_id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "client_id": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "pod_id": "3f6c1e0a-8b2d-4c55-9a1e-6d7f2b9c0e41",
                  "name": "Support agents",
                  "client_id": "support-pod",
                  "created_at": "2026-10-07T09:14:22.381Z",
                  "updated_at": "2026-10-07T09:14:22.381Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/pods/{pod_id}": {
      "get": {
        "operationId": "amGetPod",
        "summary": "Get Pod",
        "description": "Gets one pod.",
        "tags": [
          "Pods (Agent inboxes)"
        ],
        "x-docs-ids": [
          "am-get-pod"
        ],
        "parameters": [
          {
            "name": "pod_id",
            "in": "path",
            "required": true,
            "description": "The pod's ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "pod_id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "client_id": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "pod_id": "3f6c1e0a-8b2d-4c55-9a1e-6d7f2b9c0e41",
                  "name": "Support agents",
                  "client_id": "support-pod",
                  "created_at": "2026-10-07T09:14:22.381Z",
                  "updated_at": "2026-10-07T09:14:22.381Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "delete": {
        "operationId": "amDeletePod",
        "summary": "Delete Pod",
        "description": "Deletes a pod. The pod must be empty: delete its inboxes first.\n\n- Returns 409 if the pod still has inboxes.",
        "tags": [
          "Pods (Agent inboxes)"
        ],
        "x-docs-ids": [
          "am-delete-pod"
        ],
        "parameters": [
          {
            "name": "pod_id",
            "in": "path",
            "required": true,
            "description": "The pod's ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {}
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/pods/{pod_id}/inboxes": {
      "get": {
        "operationId": "amPodListInboxes",
        "summary": "List Inboxes",
        "description": "Lists the pod's inboxes, newest first.",
        "tags": [
          "Pod Inboxes"
        ],
        "x-docs-ids": [
          "am-pod-list-inboxes"
        ],
        "parameters": [
          {
            "name": "pod_id",
            "in": "path",
            "required": true,
            "description": "The pod's ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Items per page, 1 to 100. Default 50. Other values answer 422.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "required": false,
            "description": "The next_page_token from the previous page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "number"
                    },
                    "limit": {
                      "type": "number"
                    },
                    "inboxes": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "pod_id": {
                            "type": "string"
                          },
                          "inbox_id": {
                            "type": "string"
                          },
                          "email": {
                            "type": "string"
                          },
                          "display_name": {
                            "type": "string"
                          },
                          "client_id": {
                            "type": "string"
                          },
                          "metadata": {
                            "type": "object",
                            "properties": {
                              "team": {
                                "type": "string"
                              }
                            }
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updated_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "count": 1,
                  "limit": 50,
                  "inboxes": [
                    {
                      "pod_id": "3f6c1e0a-8b2d-4c55-9a1e-6d7f2b9c0e41",
                      "inbox_id": "research-bot@agents.send.io",
                      "email": "research-bot@agents.send.io",
                      "display_name": "Research Bot",
                      "client_id": "research-bot-1",
                      "metadata": {
                        "team": "growth"
                      },
                      "created_at": "2026-10-07T09:14:22.381Z",
                      "updated_at": "2026-10-07T09:14:22.381Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "post": {
        "operationId": "amPodCreateInbox",
        "summary": "Create Inbox",
        "description": "Creates an inbox in the pod. Leave out username for a random name, and domain for a free mailbox on your workspace's sendiomail.com address.\n\n- Returns 409 if the address is taken, and 403 if your own domain is not verified.\n\n- metadata is not set by this route; set it afterwards with Update Inbox.\n\n- An inbox on your own domain or agents.send.io comes with `credentials`, an IMAP/SMTP login shown only once. A free mailbox has no IMAP or SMTP login.\n\n- Which free domain is which: name@<org>.sendiomail.com is your workspace's free mailbox, made here when you give no domain (GET https://api.send.io/agent-domain returns it as `free_mailbox_domain`). name@org.sendioinbox.com is the no-signup agent mailbox (/docs/agent-mailbox), made with no account and sealed to its key; claimed into a workspace it keeps its sendioinbox.com address and counts as one of the workspace's free mailboxes.",
        "tags": [
          "Pod Inboxes"
        ],
        "x-docs-ids": [
          "am-pod-create-inbox"
        ],
        "parameters": [
          {
            "name": "pod_id",
            "in": "path",
            "required": true,
            "description": "The pod's ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "username": {
                    "type": "string",
                    "description": "On a free mailbox (the default, no `domain` given): a-z, 0-9, dot and dash, 2 to 32 characters, not starting or ending with a dot or dash. On your own domain or the shared agent domain: a-z, 0-9, dot, dash, underscore and plus, 1 to 64 characters. Random when left out."
                  },
                  "domain": {
                    "type": "string",
                    "description": "Leave it out for a free mailbox at name@<org>.sendiomail.com (no IMAP or SMTP login). Or give agents.send.io, a company subdomain (acme.agents.send.io), or your own domain once it is verified for sending."
                  },
                  "display_name": {
                    "type": "string",
                    "description": "The sender name shown to recipients."
                  },
                  "client_id": {
                    "type": "string",
                    "description": "Your own ID for idempotency. If an inbox with this client_id exists, it is returned instead of a new one."
                  }
                }
              },
              "example": {
                "username": "research-bot",
                "display_name": "Research Bot",
                "client_id": "research-bot-1"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "pod_id": {
                      "type": "string"
                    },
                    "inbox_id": {
                      "type": "string"
                    },
                    "email": {
                      "type": "string"
                    },
                    "display_name": {
                      "type": "string"
                    },
                    "client_id": {
                      "type": "string"
                    },
                    "metadata": {
                      "type": "object"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "pod_id": "3f6c1e0a-8b2d-4c55-9a1e-6d7f2b9c0e41",
                  "inbox_id": "research-bot@agents.send.io",
                  "email": "research-bot@agents.send.io",
                  "display_name": "Research Bot",
                  "client_id": "research-bot-1",
                  "metadata": {},
                  "created_at": "2026-10-07T09:14:22.381Z",
                  "updated_at": "2026-10-07T09:14:22.381Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/pods/{pod_id}/inboxes/search": {
      "get": {
        "operationId": "amPodSearchInboxes",
        "summary": "Search Inboxes",
        "description": "Finds the pod's inboxes whose address, display name or client_id contains the search text.\n\n- send.io extension.",
        "tags": [
          "Pod Inboxes"
        ],
        "x-docs-ids": [
          "am-pod-search-inboxes"
        ],
        "parameters": [
          {
            "name": "pod_id",
            "in": "path",
            "required": true,
            "description": "The pod's ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Text to search for (not case sensitive). query is accepted as an alias.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Items per page, 1 to 100. Default 50. Other values answer 422.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "required": false,
            "description": "The next_page_token from the previous page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "number"
                    },
                    "limit": {
                      "type": "number"
                    },
                    "inboxes": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "pod_id": {
                            "type": "string"
                          },
                          "inbox_id": {
                            "type": "string"
                          },
                          "email": {
                            "type": "string"
                          },
                          "display_name": {
                            "type": "string"
                          },
                          "client_id": {
                            "type": "string"
                          },
                          "metadata": {
                            "type": "object",
                            "properties": {
                              "team": {
                                "type": "string"
                              }
                            }
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updated_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "count": 1,
                  "limit": 50,
                  "inboxes": [
                    {
                      "pod_id": "3f6c1e0a-8b2d-4c55-9a1e-6d7f2b9c0e41",
                      "inbox_id": "research-bot@agents.send.io",
                      "email": "research-bot@agents.send.io",
                      "display_name": "Research Bot",
                      "client_id": "research-bot-1",
                      "metadata": {
                        "team": "growth"
                      },
                      "created_at": "2026-10-07T09:14:22.381Z",
                      "updated_at": "2026-10-07T09:14:22.381Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/pods/{pod_id}/inboxes/{inbox_id}": {
      "get": {
        "operationId": "amPodGetInbox",
        "summary": "Get Inbox",
        "description": "Gets one inbox in the pod.",
        "tags": [
          "Pod Inboxes"
        ],
        "x-docs-ids": [
          "am-pod-get-inbox"
        ],
        "parameters": [
          {
            "name": "pod_id",
            "in": "path",
            "required": true,
            "description": "The pod's ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "inbox_id",
            "in": "path",
            "required": true,
            "description": "The inbox's email address (the inbox's UUID also works). The inbox must belong to the pod.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "pod_id": {
                      "type": "string"
                    },
                    "inbox_id": {
                      "type": "string"
                    },
                    "email": {
                      "type": "string"
                    },
                    "display_name": {
                      "type": "string"
                    },
                    "client_id": {
                      "type": "string"
                    },
                    "metadata": {
                      "type": "object",
                      "properties": {
                        "team": {
                          "type": "string"
                        }
                      }
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "pod_id": "3f6c1e0a-8b2d-4c55-9a1e-6d7f2b9c0e41",
                  "inbox_id": "research-bot@agents.send.io",
                  "email": "research-bot@agents.send.io",
                  "display_name": "Research Bot",
                  "client_id": "research-bot-1",
                  "metadata": {
                    "team": "growth"
                  },
                  "created_at": "2026-10-07T09:14:22.381Z",
                  "updated_at": "2026-10-07T09:14:22.381Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "patch": {
        "operationId": "amPodUpdateInbox",
        "summary": "Update Inbox",
        "description": "Changes an inbox's display name, metadata or message retention.\n\n- message_ttl_hours is a send.io addition.",
        "tags": [
          "Pod Inboxes"
        ],
        "x-docs-ids": [
          "am-pod-update-inbox"
        ],
        "parameters": [
          {
            "name": "pod_id",
            "in": "path",
            "required": true,
            "description": "The pod's ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "inbox_id",
            "in": "path",
            "required": true,
            "description": "The inbox's email address (the inbox's UUID also works). The inbox must belong to the pod.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "display_name": {
                    "type": "string",
                    "description": "A new sender name, at most 100 characters, without quotes, angle brackets or line breaks."
                  },
                  "metadata": {
                    "type": "object",
                    "description": "Keys to merge into the inbox's metadata.",
                    "properties": {
                      "tier": {
                        "type": "string"
                      }
                    }
                  },
                  "message_ttl_hours": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "description": "Delete messages after this many hours (1 to 8760). null or 0 keeps them."
                  }
                }
              },
              "example": {
                "display_name": "Research Assistant",
                "metadata": {
                  "tier": "pro"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "pod_id": {
                      "type": "string"
                    },
                    "inbox_id": {
                      "type": "string"
                    },
                    "email": {
                      "type": "string"
                    },
                    "display_name": {
                      "type": "string"
                    },
                    "client_id": {
                      "type": "string"
                    },
                    "metadata": {
                      "type": "object",
                      "properties": {
                        "team": {
                          "type": "string"
                        },
                        "tier": {
                          "type": "string"
                        }
                      }
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "pod_id": "3f6c1e0a-8b2d-4c55-9a1e-6d7f2b9c0e41",
                  "inbox_id": "research-bot@agents.send.io",
                  "email": "research-bot@agents.send.io",
                  "display_name": "Research Assistant",
                  "client_id": "research-bot-1",
                  "metadata": {
                    "team": "growth",
                    "tier": "pro"
                  },
                  "created_at": "2026-10-07T09:14:22.381Z",
                  "updated_at": "2026-10-07T09:14:22.381Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "delete": {
        "operationId": "amPodDeleteInbox",
        "summary": "Delete Inbox",
        "description": "Deletes an inbox. The address stops receiving and pending drafts are discarded.\n\n- keep_mailbox is a send.io addition.",
        "tags": [
          "Pod Inboxes"
        ],
        "x-docs-ids": [
          "am-pod-delete-inbox"
        ],
        "parameters": [
          {
            "name": "pod_id",
            "in": "path",
            "required": true,
            "description": "The pod's ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "inbox_id",
            "in": "path",
            "required": true,
            "description": "The inbox's email address (the inbox's UUID also works). The inbox must belong to the pod.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "keep_mailbox",
            "in": "query",
            "required": false,
            "description": "true keeps the address as a plain mailbox on your own domain. Not allowed on the shared agents domain.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {}
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/pods/{pod_id}/threads": {
      "get": {
        "operationId": "amPodListThreads",
        "summary": "List Threads",
        "description": "Lists threads in the pod's inboxes, newest first.",
        "tags": [
          "Pod Threads"
        ],
        "x-docs-ids": [
          "am-pod-list-threads"
        ],
        "parameters": [
          {
            "name": "pod_id",
            "in": "path",
            "required": true,
            "description": "The pod's ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Items per page, 1 to 100. Default 50. Other values answer 422.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "required": false,
            "description": "The next_page_token from the previous page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "labels",
            "in": "query",
            "required": false,
            "description": "Only threads that have all these labels. Send repeated, comma-separated or as a JSON array (labels=[\"unread\"]).",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "description": "Only threads whose last message is before this time (RFC 3339).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "Only threads whose last message is after this time (RFC 3339).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ascending",
            "in": "query",
            "required": false,
            "description": "Oldest first when true. Default false (newest first).",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "include_spam",
            "in": "query",
            "required": false,
            "description": "Include spam threads. Default false.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "include_trash",
            "in": "query",
            "required": false,
            "description": "Include threads in the trash. Default false.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "number"
                    },
                    "limit": {
                      "type": "number"
                    },
                    "threads": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "inbox_id": {
                            "type": "string"
                          },
                          "thread_id": {
                            "type": "string"
                          },
                          "labels": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "timestamp": {
                            "type": "string"
                          },
                          "senders": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "recipients": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "message_count": {
                            "type": "number"
                          },
                          "subject": {
                            "type": "string"
                          },
                          "preview": {
                            "type": "string"
                          },
                          "size": {
                            "type": "number"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updated_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "count": 1,
                  "limit": 50,
                  "threads": [
                    {
                      "inbox_id": "research-bot@agents.send.io",
                      "thread_id": "8e3b5a71-2f4c-4d1e-9b6a-7c0d2e4f1a93",
                      "labels": [
                        "unread"
                      ],
                      "timestamp": "2026-10-07T09:14:22.381Z",
                      "senders": [
                        "Dana Lee <dana@acme.com>"
                      ],
                      "recipients": [
                        "research-bot@agents.send.io"
                      ],
                      "message_count": 2,
                      "subject": "Pricing question",
                      "preview": "Hi, could you send me the pricing for 50 seats?",
                      "size": 0,
                      "created_at": "2026-10-07T09:14:22.381Z",
                      "updated_at": "2026-10-07T09:14:22.381Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/pods/{pod_id}/threads/search": {
      "get": {
        "operationId": "amPodSearchThreads",
        "summary": "Search Threads",
        "description": "Finds threads whose subject, preview, senders or recipients contain the search text.",
        "tags": [
          "Pod Threads"
        ],
        "x-docs-ids": [
          "am-pod-search-threads"
        ],
        "parameters": [
          {
            "name": "pod_id",
            "in": "path",
            "required": true,
            "description": "The pod's ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Text to search for (not case sensitive). query is accepted as an alias.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Items per page, 1 to 100. Default 50. Other values answer 422.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "required": false,
            "description": "The next_page_token from the previous page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "labels",
            "in": "query",
            "required": false,
            "description": "Only threads that have all these labels. Send repeated, comma-separated or as a JSON array (labels=[\"unread\"]).",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "description": "Only threads whose last message is before this time (RFC 3339).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "Only threads whose last message is after this time (RFC 3339).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ascending",
            "in": "query",
            "required": false,
            "description": "Oldest first when true. Default false (newest first).",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "include_spam",
            "in": "query",
            "required": false,
            "description": "Include spam threads. Default false.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "include_trash",
            "in": "query",
            "required": false,
            "description": "Include threads in the trash. Default false.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "number"
                    },
                    "limit": {
                      "type": "number"
                    },
                    "threads": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "inbox_id": {
                            "type": "string"
                          },
                          "thread_id": {
                            "type": "string"
                          },
                          "labels": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "timestamp": {
                            "type": "string"
                          },
                          "senders": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "recipients": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "message_count": {
                            "type": "number"
                          },
                          "subject": {
                            "type": "string"
                          },
                          "preview": {
                            "type": "string"
                          },
                          "size": {
                            "type": "number"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updated_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "count": 1,
                  "limit": 50,
                  "threads": [
                    {
                      "inbox_id": "research-bot@agents.send.io",
                      "thread_id": "8e3b5a71-2f4c-4d1e-9b6a-7c0d2e4f1a93",
                      "labels": [
                        "unread"
                      ],
                      "timestamp": "2026-10-07T09:14:22.381Z",
                      "senders": [
                        "Dana Lee <dana@acme.com>"
                      ],
                      "recipients": [
                        "research-bot@agents.send.io"
                      ],
                      "message_count": 2,
                      "subject": "Pricing question",
                      "preview": "Hi, could you send me the pricing for 50 seats?",
                      "size": 0,
                      "created_at": "2026-10-07T09:14:22.381Z",
                      "updated_at": "2026-10-07T09:14:22.381Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/pods/{pod_id}/threads/{thread_id}": {
      "get": {
        "operationId": "amPodGetThread",
        "summary": "Get Thread",
        "description": "Gets a thread with all its messages, oldest first.",
        "tags": [
          "Pod Threads"
        ],
        "x-docs-ids": [
          "am-pod-get-thread"
        ],
        "parameters": [
          {
            "name": "pod_id",
            "in": "path",
            "required": true,
            "description": "The pod's ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "thread_id",
            "in": "path",
            "required": true,
            "description": "The thread's ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include_trash",
            "in": "query",
            "required": false,
            "description": "Include messages in the trash. Default false.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "inbox_id": {
                      "type": "string"
                    },
                    "thread_id": {
                      "type": "string"
                    },
                    "labels": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "timestamp": {
                      "type": "string"
                    },
                    "senders": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "recipients": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "message_count": {
                      "type": "number"
                    },
                    "subject": {
                      "type": "string"
                    },
                    "preview": {
                      "type": "string"
                    },
                    "size": {
                      "type": "number"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "messages": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "inbox_id": {
                            "type": "string"
                          },
                          "thread_id": {
                            "type": "string"
                          },
                          "message_id": {
                            "type": "string"
                          },
                          "labels": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "timestamp": {
                            "type": "string"
                          },
                          "from": {
                            "type": "string"
                          },
                          "to": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "cc": {
                            "type": "array"
                          },
                          "bcc": {
                            "type": "array"
                          },
                          "reply_to": {
                            "type": "array"
                          },
                          "subject": {
                            "type": "string"
                          },
                          "preview": {
                            "type": "string"
                          },
                          "text": {
                            "type": "string"
                          },
                          "html": {
                            "type": "string"
                          },
                          "extracted_text": {
                            "type": "string"
                          },
                          "extracted_html": {
                            "type": "string"
                          },
                          "attachments": {
                            "type": "array"
                          },
                          "size": {
                            "type": "number"
                          },
                          "in_reply_to": {},
                          "references": {
                            "type": "array"
                          },
                          "smtp_id": {
                            "type": "string"
                          },
                          "headers": {
                            "type": "object"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updated_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    },
                    "last_message_id": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "inbox_id": "research-bot@agents.send.io",
                  "thread_id": "8e3b5a71-2f4c-4d1e-9b6a-7c0d2e4f1a93",
                  "labels": [
                    "unread"
                  ],
                  "timestamp": "2026-10-07T09:14:22.381Z",
                  "senders": [
                    "Dana Lee <dana@acme.com>"
                  ],
                  "recipients": [
                    "research-bot@agents.send.io"
                  ],
                  "message_count": 2,
                  "subject": "Pricing question",
                  "preview": "Hi, could you send me the pricing for 50 seats?",
                  "size": 0,
                  "created_at": "2026-10-07T09:14:22.381Z",
                  "updated_at": "2026-10-07T09:14:22.381Z",
                  "messages": [
                    {
                      "inbox_id": "research-bot@agents.send.io",
                      "thread_id": "8e3b5a71-2f4c-4d1e-9b6a-7c0d2e4f1a93",
                      "message_id": "c41f9e20-6a3b-4f8d-b2e1-5d7a9c0b3e18",
                      "labels": [
                        "received",
                        "unread"
                      ],
                      "timestamp": "2026-10-07T09:14:22.381Z",
                      "from": "Dana Lee <dana@acme.com>",
                      "to": [
                        "research-bot@agents.send.io"
                      ],
                      "cc": [],
                      "bcc": [],
                      "reply_to": [],
                      "subject": "Pricing question",
                      "preview": "Hi, could you send me the pricing for 50 seats?",
                      "text": "Hi, could you send me the pricing for 50 seats?\n\nThanks,\nDana",
                      "html": "<p>Hi, could you send me the pricing for 50 seats?</p><p>Thanks,<br>Dana</p>",
                      "extracted_text": "Hi, could you send me the pricing for 50 seats?",
                      "extracted_html": "<p>Hi, could you send me the pricing for 50 seats?</p>",
                      "attachments": [],
                      "size": 4182,
                      "in_reply_to": null,
                      "references": [],
                      "smtp_id": "<CAF3k2=abc123@mail.acme.com>",
                      "headers": {},
                      "created_at": "2026-10-07T09:14:22.381Z",
                      "updated_at": "2026-10-07T09:14:22.381Z"
                    }
                  ],
                  "last_message_id": "c41f9e20-6a3b-4f8d-b2e1-5d7a9c0b3e18"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "patch": {
        "operationId": "amPodUpdateThread",
        "summary": "Update Thread",
        "description": "Adds or removes labels on a thread. The labels read, unread and trash change the thread's state; other labels are your own.\n\n- The system labels spam, received and sent cannot be changed and are ignored.",
        "tags": [
          "Pod Threads"
        ],
        "x-docs-ids": [
          "am-pod-update-thread"
        ],
        "parameters": [
          {
            "name": "pod_id",
            "in": "path",
            "required": true,
            "description": "The pod's ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "thread_id",
            "in": "path",
            "required": true,
            "description": "The thread's ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "add_labels": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Labels to add. read marks it read, trash moves it to the trash."
                  },
                  "remove_labels": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Labels to remove. unread marks it read, trash restores it."
                  }
                }
              },
              "example": {
                "add_labels": [
                  "read",
                  "follow-up"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "inbox_id": {
                      "type": "string"
                    },
                    "thread_id": {
                      "type": "string"
                    },
                    "labels": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "timestamp": {
                      "type": "string"
                    },
                    "senders": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "recipients": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "message_count": {
                      "type": "number"
                    },
                    "subject": {
                      "type": "string"
                    },
                    "preview": {
                      "type": "string"
                    },
                    "size": {
                      "type": "number"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "inbox_id": "research-bot@agents.send.io",
                  "thread_id": "8e3b5a71-2f4c-4d1e-9b6a-7c0d2e4f1a93",
                  "labels": [
                    "follow-up"
                  ],
                  "timestamp": "2026-10-07T09:14:22.381Z",
                  "senders": [
                    "Dana Lee <dana@acme.com>"
                  ],
                  "recipients": [
                    "research-bot@agents.send.io"
                  ],
                  "message_count": 2,
                  "subject": "Pricing question",
                  "preview": "Hi, could you send me the pricing for 50 seats?",
                  "size": 0,
                  "created_at": "2026-10-07T09:14:22.381Z",
                  "updated_at": "2026-10-07T09:14:22.381Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "delete": {
        "operationId": "amPodDeleteThread",
        "summary": "Delete Thread",
        "description": "Moves a thread to the trash. Deleting a thread that is already in the trash removes it for good.",
        "tags": [
          "Pod Threads"
        ],
        "x-docs-ids": [
          "am-pod-delete-thread"
        ],
        "parameters": [
          {
            "name": "pod_id",
            "in": "path",
            "required": true,
            "description": "The pod's ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "thread_id",
            "in": "path",
            "required": true,
            "description": "The thread's ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {}
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/pods/{pod_id}/threads/{thread_id}/attachments/{attachment_id}": {
      "get": {
        "operationId": "amPodGetThreadAttachment",
        "summary": "Get Attachment",
        "description": "Gets an attachment's details and a signed download link that works for one hour.\n\n- text_url (the attachment's extracted text) is a send.io addition, present when text could be extracted.",
        "tags": [
          "Pod Threads"
        ],
        "x-docs-ids": [
          "am-pod-get-thread-attachment"
        ],
        "parameters": [
          {
            "name": "pod_id",
            "in": "path",
            "required": true,
            "description": "The pod's ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "thread_id",
            "in": "path",
            "required": true,
            "description": "The thread's ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "attachment_id",
            "in": "path",
            "required": true,
            "description": "The attachment's ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "attachment_id": {
                      "type": "string"
                    },
                    "filename": {
                      "type": "string"
                    },
                    "size": {
                      "type": "number"
                    },
                    "content_type": {
                      "type": "string"
                    },
                    "content_disposition": {
                      "type": "string"
                    },
                    "content_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "download_url": {
                      "type": "string"
                    },
                    "expires_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "text_url": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "attachment_id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
                  "filename": "pricing.pdf",
                  "size": 48213,
                  "content_type": "application/pdf",
                  "content_disposition": "attachment",
                  "content_id": null,
                  "download_url": "https://api.send.io/download/eyJ0IjoiYXR0YWNobWVudCJ9.sig",
                  "expires_at": "2026-10-07T10:14:22Z",
                  "text_url": "https://api.send.io/download/eyJ0IjoiYXR0YWNobWVudCJ9.sig?format=text"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/pods/{pod_id}/drafts": {
      "get": {
        "operationId": "amPodListDrafts",
        "summary": "List Drafts",
        "description": "Lists the pod's pending, sending and failed drafts, newest first.",
        "tags": [
          "Pod Drafts"
        ],
        "x-docs-ids": [
          "am-pod-list-drafts"
        ],
        "parameters": [
          {
            "name": "pod_id",
            "in": "path",
            "required": true,
            "description": "The pod's ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Items per page, 1 to 100. Default 50. Other values answer 422.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "required": false,
            "description": "The next_page_token from the previous page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "labels",
            "in": "query",
            "required": false,
            "description": "Only drafts that have all these labels.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "drafts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "send_status": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "`scheduled`: pending, with a `send_at` time. `sending`: a scheduled send is going out. `failed`: a scheduled send failed; change the draft or send it again. `null`: pending with no `send_at`, and also once the draft was sent (Get draft still returns a sent draft, the lists do not). A deleted draft is never returned: 404."
                          },
                          "inbox_id": {
                            "type": "string"
                          },
                          "draft_id": {
                            "type": "string"
                          },
                          "client_id": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "labels": {
                            "type": "array"
                          },
                          "to": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "cc": {
                            "type": "array"
                          },
                          "bcc": {
                            "type": "array"
                          },
                          "reply_to": {
                            "type": "array"
                          },
                          "subject": {
                            "type": "string"
                          },
                          "preview": {
                            "type": "string"
                          },
                          "text": {
                            "type": "string"
                          },
                          "html": {},
                          "attachments": {
                            "type": "array"
                          },
                          "thread_id": {
                            "type": "string"
                          },
                          "in_reply_to": {
                            "type": "string"
                          },
                          "forward_of": {},
                          "send_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updated_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    },
                    "count": {
                      "type": "number"
                    },
                    "limit": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "count": 1,
                  "limit": 50,
                  "drafts": [
                    {
                      "inbox_id": "research-bot@agents.send.io",
                      "draft_id": "5b2e8d14-9c7a-4f30-a6e1-3d8f0b2c7e95",
                      "client_id": null,
                      "labels": [],
                      "to": [
                        "dana@acme.com"
                      ],
                      "cc": [],
                      "bcc": [],
                      "reply_to": [],
                      "subject": "Re: Pricing question",
                      "preview": "Hi Dana, here is our pricing for 50 seats.",
                      "text": "Hi Dana, here is our pricing for 50 seats.",
                      "html": null,
                      "attachments": [],
                      "thread_id": "8e3b5a71-2f4c-4d1e-9b6a-7c0d2e4f1a93",
                      "in_reply_to": "c41f9e20-6a3b-4f8d-b2e1-5d7a9c0b3e18",
                      "forward_of": null,
                      "send_status": "scheduled",
                      "send_at": "2026-10-08T15:00:00Z",
                      "created_at": "2026-10-07T09:14:22.381Z",
                      "updated_at": "2026-10-07T09:14:22.381Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/pods/{pod_id}/drafts/{draft_id}": {
      "get": {
        "operationId": "amPodGetDraft",
        "summary": "Get Draft",
        "description": "Gets one draft in the pod.\n\n- A sent draft is still returned, with `send_status` null. A deleted draft answers 404.",
        "tags": [
          "Pod Drafts"
        ],
        "x-docs-ids": [
          "am-pod-get-draft"
        ],
        "parameters": [
          {
            "name": "pod_id",
            "in": "path",
            "required": true,
            "description": "The pod's ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "draft_id",
            "in": "path",
            "required": true,
            "description": "The draft's ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "send_status": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "`scheduled`: pending, with a `send_at` time. `sending`: a scheduled send is going out. `failed`: a scheduled send failed; change the draft or send it again. `null`: pending with no `send_at`, and also once the draft was sent (Get draft still returns a sent draft, the lists do not). A deleted draft is never returned: 404."
                    },
                    "inbox_id": {
                      "type": "string"
                    },
                    "draft_id": {
                      "type": "string"
                    },
                    "client_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "labels": {
                      "type": "array"
                    },
                    "to": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "cc": {
                      "type": "array"
                    },
                    "bcc": {
                      "type": "array"
                    },
                    "reply_to": {
                      "type": "array"
                    },
                    "subject": {
                      "type": "string"
                    },
                    "preview": {
                      "type": "string"
                    },
                    "text": {
                      "type": "string"
                    },
                    "html": {},
                    "attachments": {
                      "type": "array"
                    },
                    "thread_id": {
                      "type": "string"
                    },
                    "in_reply_to": {
                      "type": "string"
                    },
                    "forward_of": {},
                    "send_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "inbox_id": "research-bot@agents.send.io",
                  "draft_id": "5b2e8d14-9c7a-4f30-a6e1-3d8f0b2c7e95",
                  "client_id": null,
                  "labels": [],
                  "to": [
                    "dana@acme.com"
                  ],
                  "cc": [],
                  "bcc": [],
                  "reply_to": [],
                  "subject": "Re: Pricing question",
                  "preview": "Hi Dana, here is our pricing for 50 seats.",
                  "text": "Hi Dana, here is our pricing for 50 seats.",
                  "html": null,
                  "attachments": [],
                  "thread_id": "8e3b5a71-2f4c-4d1e-9b6a-7c0d2e4f1a93",
                  "in_reply_to": "c41f9e20-6a3b-4f8d-b2e1-5d7a9c0b3e18",
                  "forward_of": null,
                  "send_status": "scheduled",
                  "send_at": "2026-10-08T15:00:00Z",
                  "created_at": "2026-10-07T09:14:22.381Z",
                  "updated_at": "2026-10-07T09:14:22.381Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/pods/{pod_id}/lists/{direction}/{type}": {
      "get": {
        "operationId": "amPodListEntries",
        "summary": "List Entries",
        "description": "Lists the entries on one of the pod's lists, sorted by entry.",
        "tags": [
          "Pod Lists"
        ],
        "x-docs-ids": [
          "am-pod-list-entries"
        ],
        "parameters": [
          {
            "name": "pod_id",
            "in": "path",
            "required": true,
            "description": "The pod's ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "direction",
            "in": "path",
            "required": true,
            "description": "Which mail the list applies to: send, receive or reply.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "path",
            "required": true,
            "description": "The list type: allow or block.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Items per page, 1 to 100. Default 50. Other values answer 422.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "required": false,
            "description": "The next_page_token from the previous page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "number"
                    },
                    "limit": {
                      "type": "number"
                    },
                    "entries": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "entry": {
                            "type": "string"
                          },
                          "entry_type": {
                            "type": "string"
                          },
                          "list_type": {
                            "type": "string"
                          },
                          "direction": {
                            "type": "string"
                          },
                          "inbox_id": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "pod_id": {
                            "type": "string"
                          },
                          "organization_id": {
                            "type": "string"
                          },
                          "reason": {
                            "type": "string"
                          },
                          "read_only": {
                            "type": "boolean"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "count": 1,
                  "limit": 50,
                  "entries": [
                    {
                      "entry": "spammy.example",
                      "entry_type": "domain",
                      "list_type": "block",
                      "direction": "receive",
                      "inbox_id": null,
                      "pod_id": "3f6c1e0a-8b2d-4c55-9a1e-6d7f2b9c0e41",
                      "organization_id": "a1d2c3b4-5e6f-4789-8abc-0d1e2f3a4b5c",
                      "reason": "Unwanted cold outreach",
                      "read_only": false,
                      "created_at": "2026-10-07T09:14:22.381Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "post": {
        "operationId": "amPodCreateListEntry",
        "summary": "Create List Entry",
        "description": "Adds an email address or domain to one of the pod's lists.",
        "tags": [
          "Pod Lists"
        ],
        "x-docs-ids": [
          "am-pod-create-list-entry"
        ],
        "parameters": [
          {
            "name": "pod_id",
            "in": "path",
            "required": true,
            "description": "The pod's ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "direction",
            "in": "path",
            "required": true,
            "description": "Which mail the list applies to: send, receive or reply.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "path",
            "required": true,
            "description": "The list type: allow or block.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "entry": {
                    "type": "string",
                    "description": "An email address (dana@acme.com) or a domain (acme.com)."
                  },
                  "reason": {
                    "type": "string",
                    "description": "Why the entry was added. Adding an existing entry updates its reason."
                  }
                },
                "required": [
                  "entry"
                ]
              },
              "example": {
                "entry": "spammy.example",
                "reason": "Unwanted cold outreach"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "entry": {
                      "type": "string"
                    },
                    "entry_type": {
                      "type": "string"
                    },
                    "list_type": {
                      "type": "string"
                    },
                    "direction": {
                      "type": "string"
                    },
                    "inbox_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "pod_id": {
                      "type": "string"
                    },
                    "organization_id": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    },
                    "read_only": {
                      "type": "boolean"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "entry": "spammy.example",
                  "entry_type": "domain",
                  "list_type": "block",
                  "direction": "receive",
                  "inbox_id": null,
                  "pod_id": "3f6c1e0a-8b2d-4c55-9a1e-6d7f2b9c0e41",
                  "organization_id": "a1d2c3b4-5e6f-4789-8abc-0d1e2f3a4b5c",
                  "reason": "Unwanted cold outreach",
                  "read_only": false,
                  "created_at": "2026-10-07T09:14:22.381Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/pods/{pod_id}/lists/{direction}/{type}/{entry}": {
      "get": {
        "operationId": "amPodGetListEntry",
        "summary": "Get List Entry",
        "description": "Gets one entry on one of the pod's lists.",
        "tags": [
          "Pod Lists"
        ],
        "x-docs-ids": [
          "am-pod-get-list-entry"
        ],
        "parameters": [
          {
            "name": "pod_id",
            "in": "path",
            "required": true,
            "description": "The pod's ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "direction",
            "in": "path",
            "required": true,
            "description": "Which mail the list applies to: send, receive or reply.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "path",
            "required": true,
            "description": "The list type: allow or block.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "entry",
            "in": "path",
            "required": true,
            "description": "The email address or domain on the list (case does not matter).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "entry": {
                      "type": "string"
                    },
                    "entry_type": {
                      "type": "string"
                    },
                    "list_type": {
                      "type": "string"
                    },
                    "direction": {
                      "type": "string"
                    },
                    "inbox_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "pod_id": {
                      "type": "string"
                    },
                    "organization_id": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    },
                    "read_only": {
                      "type": "boolean"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "entry": "spammy.example",
                  "entry_type": "domain",
                  "list_type": "block",
                  "direction": "receive",
                  "inbox_id": null,
                  "pod_id": "3f6c1e0a-8b2d-4c55-9a1e-6d7f2b9c0e41",
                  "organization_id": "a1d2c3b4-5e6f-4789-8abc-0d1e2f3a4b5c",
                  "reason": "Unwanted cold outreach",
                  "read_only": false,
                  "created_at": "2026-10-07T09:14:22.381Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "delete": {
        "operationId": "amPodDeleteListEntry",
        "summary": "Delete List Entry",
        "description": "Removes an entry from one of the pod's lists.",
        "tags": [
          "Pod Lists"
        ],
        "x-docs-ids": [
          "am-pod-delete-list-entry"
        ],
        "parameters": [
          {
            "name": "pod_id",
            "in": "path",
            "required": true,
            "description": "The pod's ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "direction",
            "in": "path",
            "required": true,
            "description": "Which mail the list applies to: send, receive or reply.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "path",
            "required": true,
            "description": "The list type: allow or block.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "entry",
            "in": "path",
            "required": true,
            "description": "The email address or domain on the list (case does not matter).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {}
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/pods/{pod_id}/webhooks": {
      "get": {
        "operationId": "amPodListWebhooks",
        "summary": "List Webhooks",
        "description": "Lists the webhooks scoped to this pod, newest first.",
        "tags": [
          "Pod Webhooks"
        ],
        "x-docs-ids": [
          "am-pod-list-webhooks"
        ],
        "parameters": [
          {
            "name": "pod_id",
            "in": "path",
            "required": true,
            "description": "The pod's ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Items per page, 1 to 100. Default 50. Other values answer 422.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "required": false,
            "description": "The next_page_token from the previous page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "number"
                    },
                    "limit": {
                      "type": "number"
                    },
                    "webhooks": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "webhook_id": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string"
                          },
                          "event_types": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "enabled": {
                            "type": "boolean"
                          },
                          "client_id": {
                            "type": "string"
                          },
                          "inbox_ids": {
                            "type": "array"
                          },
                          "pod_ids": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updated_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "count": 1,
                  "limit": 50,
                  "webhooks": [
                    {
                      "webhook_id": "e7a1c3f5-2b4d-4e6f-8a0c-1d3e5f7a9b2c",
                      "url": "https://example.com/hooks/sendio",
                      "event_types": [
                        "message.received",
                        "message.bounced"
                      ],
                      "enabled": true,
                      "client_id": "main-hook",
                      "inbox_ids": [],
                      "pod_ids": [
                        "3f6c1e0a-8b2d-4c55-9a1e-6d7f2b9c0e41"
                      ],
                      "created_at": "2026-10-07T09:14:22.381Z",
                      "updated_at": "2026-10-07T09:14:22.381Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "post": {
        "operationId": "amPodCreateWebhook",
        "summary": "Create Webhook",
        "description": "Creates a webhook scoped to this pod. The signing secret is returned only once.\n\n- The number of webhooks depends on your plan.",
        "tags": [
          "Pod Webhooks"
        ],
        "x-docs-ids": [
          "am-pod-create-webhook"
        ],
        "parameters": [
          {
            "name": "pod_id",
            "in": "path",
            "required": true,
            "description": "The pod's ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "The HTTPS URL that receives the events. endpoint is accepted as an alias."
                  },
                  "event_types": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Events to send: message.received, message.received.spam, message.sent, message.delivered, message.bounced, message.complained, message.rejected, message.opened, domain.verified. Default [\"message.received\"]. A webhook limited to inboxes or pods only receives the message events: any other type answers 422."
                  },
                  "inbox_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Limit the webhook to these inboxes (addresses or IDs)."
                  },
                  "pod_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Limit the webhook to these pods."
                  },
                  "client_id": {
                    "type": "string",
                    "description": "Your own ID for idempotency. If a webhook with this client_id exists with the same settings, it is returned instead of a new one; different settings answer 409."
                  }
                },
                "required": [
                  "url"
                ]
              },
              "example": {
                "url": "https://example.com/hooks/sendio",
                "event_types": [
                  "message.received",
                  "message.bounced"
                ],
                "client_id": "main-hook"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "webhook_id": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "event_types": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "enabled": {
                      "type": "boolean"
                    },
                    "client_id": {
                      "type": "string"
                    },
                    "inbox_ids": {
                      "type": "array"
                    },
                    "pod_ids": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "secret": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "webhook_id": "e7a1c3f5-2b4d-4e6f-8a0c-1d3e5f7a9b2c",
                  "url": "https://example.com/hooks/sendio",
                  "event_types": [
                    "message.received",
                    "message.bounced"
                  ],
                  "enabled": true,
                  "client_id": "main-hook",
                  "inbox_ids": [],
                  "pod_ids": [
                    "3f6c1e0a-8b2d-4c55-9a1e-6d7f2b9c0e41"
                  ],
                  "created_at": "2026-10-07T09:14:22.381Z",
                  "updated_at": "2026-10-07T09:14:22.381Z",
                  "secret": "whsec_c2VjcmV0LXNpZ25pbmcta2V5LWV4YW1wbGU="
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/pods/{pod_id}/webhooks/{webhook_id}": {
      "get": {
        "operationId": "amPodGetWebhook",
        "summary": "Get Webhook",
        "description": "Gets one webhook scoped to this pod.",
        "tags": [
          "Pod Webhooks"
        ],
        "x-docs-ids": [
          "am-pod-get-webhook"
        ],
        "parameters": [
          {
            "name": "pod_id",
            "in": "path",
            "required": true,
            "description": "The pod's ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook_id",
            "in": "path",
            "required": true,
            "description": "The webhook's ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "webhook_id": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "event_types": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "enabled": {
                      "type": "boolean"
                    },
                    "client_id": {
                      "type": "string"
                    },
                    "inbox_ids": {
                      "type": "array"
                    },
                    "pod_ids": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "webhook_id": "e7a1c3f5-2b4d-4e6f-8a0c-1d3e5f7a9b2c",
                  "url": "https://example.com/hooks/sendio",
                  "event_types": [
                    "message.received",
                    "message.bounced"
                  ],
                  "enabled": true,
                  "client_id": "main-hook",
                  "inbox_ids": [],
                  "pod_ids": [
                    "3f6c1e0a-8b2d-4c55-9a1e-6d7f2b9c0e41"
                  ],
                  "created_at": "2026-10-07T09:14:22.381Z",
                  "updated_at": "2026-10-07T09:14:22.381Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "patch": {
        "operationId": "amPodUpdateWebhook",
        "summary": "Update Webhook",
        "description": "Changes a webhook's URL, events, scope or whether it is enabled.",
        "tags": [
          "Pod Webhooks"
        ],
        "x-docs-ids": [
          "am-pod-update-webhook"
        ],
        "parameters": [
          {
            "name": "pod_id",
            "in": "path",
            "required": true,
            "description": "The pod's ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook_id",
            "in": "path",
            "required": true,
            "description": "The webhook's ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "A new HTTPS URL."
                  },
                  "event_types": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Replaces the list of events."
                  },
                  "enabled": {
                    "type": "boolean",
                    "description": "false pauses delivery; true resumes it."
                  },
                  "add_inbox_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Inboxes to add to the webhook's scope."
                  },
                  "remove_inbox_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Inboxes to remove from the webhook's scope."
                  },
                  "add_pod_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Pods to add to the webhook's scope."
                  },
                  "remove_pod_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Pods to remove from the webhook's scope."
                  }
                }
              },
              "example": {
                "enabled": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "webhook_id": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "event_types": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "enabled": {
                      "type": "boolean"
                    },
                    "client_id": {
                      "type": "string"
                    },
                    "inbox_ids": {
                      "type": "array"
                    },
                    "pod_ids": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "webhook_id": "e7a1c3f5-2b4d-4e6f-8a0c-1d3e5f7a9b2c",
                  "url": "https://example.com/hooks/sendio",
                  "event_types": [
                    "message.received",
                    "message.bounced"
                  ],
                  "enabled": false,
                  "client_id": "main-hook",
                  "inbox_ids": [],
                  "pod_ids": [
                    "3f6c1e0a-8b2d-4c55-9a1e-6d7f2b9c0e41"
                  ],
                  "created_at": "2026-10-07T09:14:22.381Z",
                  "updated_at": "2026-10-07T09:14:22.381Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "delete": {
        "operationId": "amPodDeleteWebhook",
        "summary": "Delete Webhook",
        "description": "Deletes a webhook scoped to this pod.",
        "tags": [
          "Pod Webhooks"
        ],
        "x-docs-ids": [
          "am-pod-delete-webhook"
        ],
        "parameters": [
          {
            "name": "pod_id",
            "in": "path",
            "required": true,
            "description": "The pod's ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook_id",
            "in": "path",
            "required": true,
            "description": "The webhook's ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {}
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/pods/{pod_id}/webhooks/{webhook_id}/headers": {
      "get": {
        "operationId": "amPodGetWebhookHeaders",
        "summary": "Get Webhook Headers",
        "description": "Gets the custom headers sent with every delivery of this webhook.\n\n- send.io addition.",
        "tags": [
          "Pod Webhooks"
        ],
        "x-docs-ids": [
          "am-pod-get-webhook-headers"
        ],
        "parameters": [
          {
            "name": "pod_id",
            "in": "path",
            "required": true,
            "description": "The pod's ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook_id",
            "in": "path",
            "required": true,
            "description": "The webhook's ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "webhook_id": {
                      "type": "string"
                    },
                    "headers": {
                      "type": "object",
                      "properties": {
                        "X-Auth-Token": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "webhook_id": "e7a1c3f5-2b4d-4e6f-8a0c-1d3e5f7a9b2c",
                  "headers": {
                    "X-Auth-Token": "s3cr3t"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "patch": {
        "operationId": "amPodUpdateWebhookHeaders",
        "summary": "Update Webhook Headers",
        "description": "Sets or removes custom headers on this webhook's deliveries.\n\n- send.io addition.",
        "tags": [
          "Pod Webhooks"
        ],
        "x-docs-ids": [
          "am-pod-update-webhook-headers"
        ],
        "parameters": [
          {
            "name": "pod_id",
            "in": "path",
            "required": true,
            "description": "The pod's ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook_id",
            "in": "path",
            "required": true,
            "description": "The webhook's ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "headers": {
                    "type": "object",
                    "description": "Header names mapped to values. A null value removes that header. Content-Type, Content-Length, Host, User-Agent and svix-* headers cannot be set.",
                    "properties": {
                      "X-Auth-Token": {
                        "type": "string"
                      },
                      "X-Old": {}
                    }
                  }
                },
                "required": [
                  "headers"
                ]
              },
              "example": {
                "headers": {
                  "X-Auth-Token": "s3cr3t",
                  "X-Old": null
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "webhook_id": {
                      "type": "string"
                    },
                    "headers": {
                      "type": "object",
                      "properties": {
                        "X-Auth-Token": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "webhook_id": "e7a1c3f5-2b4d-4e6f-8a0c-1d3e5f7a9b2c",
                  "headers": {
                    "X-Auth-Token": "s3cr3t"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/pods/{pod_id}/domains": {
      "get": {
        "operationId": "amPodListDomains",
        "summary": "List Domains",
        "description": "Lists your domains, newest first.\n\n- Domains belong to your organization, not to a pod, so this lists all of them.",
        "tags": [
          "Pod Domains"
        ],
        "x-docs-ids": [
          "am-pod-list-domains"
        ],
        "parameters": [
          {
            "name": "pod_id",
            "in": "path",
            "required": true,
            "description": "The pod's ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Items per page, 1 to 100. Default 50. Other values answer 422.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "required": false,
            "description": "The next_page_token from the previous page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "number"
                    },
                    "limit": {
                      "type": "number"
                    },
                    "domains": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "domain_id": {
                            "type": "string"
                          },
                          "domain": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "feedback_enabled": {
                            "type": "boolean"
                          },
                          "records": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                },
                                "value": {
                                  "type": "string"
                                },
                                "priority": {},
                                "status": {
                                  "type": "string"
                                }
                              }
                            }
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updated_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "count": 1,
                  "limit": 50,
                  "domains": [
                    {
                      "domain_id": "0c9d8e7f-6a5b-4c3d-2e1f-0a9b8c7d6e5f",
                      "domain": "acme.com",
                      "status": "PENDING",
                      "feedback_enabled": true,
                      "records": [
                        {
                          "type": "CNAME",
                          "name": "mx1._domainkey",
                          "value": "0028814c2802.dkim.send.io",
                          "priority": null,
                          "status": "PENDING"
                        },
                        {
                          "type": "CNAME",
                          "name": "send",
                          "value": "rp.send.io",
                          "priority": null,
                          "status": "PENDING"
                        },
                        {
                          "type": "TXT",
                          "name": "_dmarc",
                          "value": "v=DMARC1; p=none;",
                          "priority": null,
                          "status": "PENDING"
                        }
                      ],
                      "created_at": "2026-10-07T09:14:22.381Z",
                      "updated_at": "2026-10-07T09:14:22.381Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "post": {
        "operationId": "amPodCreateDomain",
        "summary": "Create Domain",
        "description": "Adds a domain and returns the DNS records to set up.\n\n- The domain is added to your organization, not only to this pod.",
        "tags": [
          "Pod Domains"
        ],
        "x-docs-ids": [
          "am-pod-create-domain"
        ],
        "parameters": [
          {
            "name": "pod_id",
            "in": "path",
            "required": true,
            "description": "The pod's ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "domain": {
                    "type": "string",
                    "description": "The domain name, for example acme.com. name is accepted as an alias."
                  },
                  "feedback_enabled": {
                    "type": "boolean",
                    "description": "Accepted for compatibility. Bounce and complaint feedback is always on."
                  }
                },
                "required": [
                  "domain"
                ]
              },
              "example": {
                "domain": "acme.com"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "domain_id": {
                      "type": "string"
                    },
                    "domain": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "feedback_enabled": {
                      "type": "boolean"
                    },
                    "records": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "value": {
                            "type": "string"
                          },
                          "priority": {},
                          "status": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "domain_id": "0c9d8e7f-6a5b-4c3d-2e1f-0a9b8c7d6e5f",
                  "domain": "acme.com",
                  "status": "PENDING",
                  "feedback_enabled": true,
                  "records": [
                    {
                      "type": "CNAME",
                      "name": "mx1._domainkey",
                      "value": "0028814c2802.dkim.send.io",
                      "priority": null,
                      "status": "PENDING"
                    },
                    {
                      "type": "CNAME",
                      "name": "send",
                      "value": "rp.send.io",
                      "priority": null,
                      "status": "PENDING"
                    },
                    {
                      "type": "TXT",
                      "name": "_dmarc",
                      "value": "v=DMARC1; p=none;",
                      "priority": null,
                      "status": "PENDING"
                    }
                  ],
                  "created_at": "2026-10-07T09:14:22.381Z",
                  "updated_at": "2026-10-07T09:14:22.381Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/pods/{pod_id}/domains/{domain_id}": {
      "get": {
        "operationId": "amPodGetDomain",
        "summary": "Get Domain",
        "description": "Gets a domain with its DNS records and their status.",
        "tags": [
          "Pod Domains"
        ],
        "x-docs-ids": [
          "am-pod-get-domain"
        ],
        "parameters": [
          {
            "name": "pod_id",
            "in": "path",
            "required": true,
            "description": "The pod's ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "domain_id",
            "in": "path",
            "required": true,
            "description": "The domain's ID, or the domain name itself (for example acme.com).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "domain_id": {
                      "type": "string"
                    },
                    "domain": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "feedback_enabled": {
                      "type": "boolean"
                    },
                    "records": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "value": {
                            "type": "string"
                          },
                          "priority": {},
                          "status": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "domain_id": "0c9d8e7f-6a5b-4c3d-2e1f-0a9b8c7d6e5f",
                  "domain": "acme.com",
                  "status": "PENDING",
                  "feedback_enabled": true,
                  "records": [
                    {
                      "type": "CNAME",
                      "name": "mx1._domainkey",
                      "value": "0028814c2802.dkim.send.io",
                      "priority": null,
                      "status": "PENDING"
                    },
                    {
                      "type": "CNAME",
                      "name": "send",
                      "value": "rp.send.io",
                      "priority": null,
                      "status": "PENDING"
                    },
                    {
                      "type": "TXT",
                      "name": "_dmarc",
                      "value": "v=DMARC1; p=none;",
                      "priority": null,
                      "status": "PENDING"
                    }
                  ],
                  "created_at": "2026-10-07T09:14:22.381Z",
                  "updated_at": "2026-10-07T09:14:22.381Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "patch": {
        "operationId": "amPodUpdateDomain",
        "summary": "Update Domain",
        "description": "Accepted for compatibility. Returns the domain unchanged.",
        "tags": [
          "Pod Domains"
        ],
        "x-docs-ids": [
          "am-pod-update-domain"
        ],
        "parameters": [
          {
            "name": "pod_id",
            "in": "path",
            "required": true,
            "description": "The pod's ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "domain_id",
            "in": "path",
            "required": true,
            "description": "The domain's ID, or the domain name itself (for example acme.com).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "feedback_enabled": {
                    "type": "boolean",
                    "description": "Ignored: feedback is always on."
                  }
                }
              },
              "example": {
                "feedback_enabled": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "domain_id": {
                      "type": "string"
                    },
                    "domain": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "feedback_enabled": {
                      "type": "boolean"
                    },
                    "records": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "value": {
                            "type": "string"
                          },
                          "priority": {},
                          "status": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "domain_id": "0c9d8e7f-6a5b-4c3d-2e1f-0a9b8c7d6e5f",
                  "domain": "acme.com",
                  "status": "PENDING",
                  "feedback_enabled": true,
                  "records": [
                    {
                      "type": "CNAME",
                      "name": "mx1._domainkey",
                      "value": "0028814c2802.dkim.send.io",
                      "priority": null,
                      "status": "PENDING"
                    },
                    {
                      "type": "CNAME",
                      "name": "send",
                      "value": "rp.send.io",
                      "priority": null,
                      "status": "PENDING"
                    },
                    {
                      "type": "TXT",
                      "name": "_dmarc",
                      "value": "v=DMARC1; p=none;",
                      "priority": null,
                      "status": "PENDING"
                    }
                  ],
                  "created_at": "2026-10-07T09:14:22.381Z",
                  "updated_at": "2026-10-07T09:14:22.381Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "delete": {
        "operationId": "amPodDeleteDomain",
        "summary": "Delete Domain",
        "description": "Deletes a domain.",
        "tags": [
          "Pod Domains"
        ],
        "x-docs-ids": [
          "am-pod-delete-domain"
        ],
        "parameters": [
          {
            "name": "pod_id",
            "in": "path",
            "required": true,
            "description": "The pod's ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "domain_id",
            "in": "path",
            "required": true,
            "description": "The domain's ID, or the domain name itself (for example acme.com).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {}
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/pods/{pod_id}/domains/{domain_id}/verify": {
      "post": {
        "operationId": "amPodVerifyDomain",
        "summary": "Verify Domain",
        "description": "Checks the domain's DNS records now and returns the updated status.",
        "tags": [
          "Pod Domains"
        ],
        "x-docs-ids": [
          "am-pod-verify-domain"
        ],
        "parameters": [
          {
            "name": "pod_id",
            "in": "path",
            "required": true,
            "description": "The pod's ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "domain_id",
            "in": "path",
            "required": true,
            "description": "The domain's ID, or the domain name itself (for example acme.com).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "domain_id": {
                      "type": "string"
                    },
                    "domain": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "feedback_enabled": {
                      "type": "boolean"
                    },
                    "records": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "value": {
                            "type": "string"
                          },
                          "priority": {},
                          "status": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "domain_id": "0c9d8e7f-6a5b-4c3d-2e1f-0a9b8c7d6e5f",
                  "domain": "acme.com",
                  "status": "VERIFIED",
                  "feedback_enabled": true,
                  "records": [
                    {
                      "type": "CNAME",
                      "name": "mx1._domainkey",
                      "value": "0028814c2802.dkim.send.io",
                      "priority": null,
                      "status": "VERIFIED"
                    },
                    {
                      "type": "CNAME",
                      "name": "send",
                      "value": "rp.send.io",
                      "priority": null,
                      "status": "VERIFIED"
                    },
                    {
                      "type": "TXT",
                      "name": "_dmarc",
                      "value": "v=DMARC1; p=none;",
                      "priority": null,
                      "status": "VERIFIED"
                    }
                  ],
                  "created_at": "2026-10-07T09:14:22.381Z",
                  "updated_at": "2026-10-07T09:14:22.381Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/pods/{pod_id}/domains/{domain_id}/zone-file": {
      "get": {
        "operationId": "amPodGetZoneFile",
        "summary": "Get Zone File",
        "description": "Gets the domain's DNS records as a BIND zone file you can import at your DNS provider.\n\n- Returned as JSON with a zone_file string.",
        "tags": [
          "Pod Domains"
        ],
        "x-docs-ids": [
          "am-pod-get-zone-file"
        ],
        "parameters": [
          {
            "name": "pod_id",
            "in": "path",
            "required": true,
            "description": "The pod's ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "domain_id",
            "in": "path",
            "required": true,
            "description": "The domain's ID, or the domain name itself (for example acme.com).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "domain_id": {
                      "type": "string"
                    },
                    "zone_file": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "domain_id": "0c9d8e7f-6a5b-4c3d-2e1f-0a9b8c7d6e5f",
                  "zone_file": "; Zone file for acme.com, generated by send.io\n$ORIGIN acme.com.\nmx1._domainkey\t3600\tIN\tCNAME\t0028814c2802.dkim.send.io.\nsend\t3600\tIN\tCNAME\trp.send.io.\n"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/pods/{pod_id}/metrics/events": {
      "get": {
        "operationId": "amPodMetricsEvents",
        "summary": "List Events",
        "description": "Lists message events (received, sent, delivered, bounced and more) for the pod's inboxes, newest first.\n\n- Metrics are split into /metrics/events, /metrics/usage and /metrics/rates.\n\n- At most the 1,000 most recent events in the window are returned.",
        "tags": [
          "Pod Metrics"
        ],
        "x-docs-ids": [
          "am-pod-metrics-events"
        ],
        "parameters": [
          {
            "name": "pod_id",
            "in": "path",
            "required": true,
            "description": "The pod's ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Items per page, 1 to 100. Default 50. Other values answer 422.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "required": false,
            "description": "The next_page_token from the previous page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "description": "Start of the window (RFC 3339). Also accepted as start_timestamp or after. Default 30 days ago.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "description": "End of the window (RFC 3339). Also accepted as end_timestamp or before. Default now.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "event_types",
            "in": "query",
            "required": false,
            "description": "Only these events: message.received, message.sent, message.delivered, message.bounced, message.complained, message.opened, message.rejected.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "number"
                    },
                    "limit": {
                      "type": "number"
                    },
                    "events": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "event_type": {
                            "type": "string"
                          },
                          "timestamp": {
                            "type": "string"
                          },
                          "message_id": {
                            "type": "string"
                          },
                          "thread_id": {
                            "type": "string"
                          },
                          "recipient": {
                            "type": "string"
                          },
                          "inbox_id": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "count": 2,
                  "limit": 50,
                  "events": [
                    {
                      "event_type": "message.delivered",
                      "timestamp": "2026-10-07T09:20:41.002Z",
                      "message_id": "f2a4c6e8-0b1d-4f3a-8c5e-7a9b1c3d5e7f",
                      "thread_id": "8e3b5a71-2f4c-4d1e-9b6a-7c0d2e4f1a93",
                      "recipient": "dana@acme.com",
                      "inbox_id": "research-bot@agents.send.io"
                    },
                    {
                      "event_type": "message.received",
                      "timestamp": "2026-10-07T09:14:22.381Z",
                      "message_id": "c41f9e20-6a3b-4f8d-b2e1-5d7a9c0b3e18",
                      "thread_id": "8e3b5a71-2f4c-4d1e-9b6a-7c0d2e4f1a93",
                      "inbox_id": "research-bot@agents.send.io"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/pods/{pod_id}/metrics/usage": {
      "get": {
        "operationId": "amPodMetricsUsage",
        "summary": "Get Usage",
        "description": "Counts messages by outcome for the pod's inboxes in a time window.\n\n- send.io addition.\n\n- Deleting mail does not change past numbers: a deleted sent message still counts for the inbox it was sent from. `received` counts received messages still in the inbox; a permanently deleted or expired message is no longer counted.",
        "tags": [
          "Pod Metrics"
        ],
        "x-docs-ids": [
          "am-pod-metrics-usage"
        ],
        "parameters": [
          {
            "name": "pod_id",
            "in": "path",
            "required": true,
            "description": "The pod's ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "description": "Start of the window (RFC 3339). Also accepted as start_timestamp or after. Default 30 days ago.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "description": "End of the window (RFC 3339). Also accepted as end_timestamp or before. Default now.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "received": {
                      "type": "number"
                    },
                    "sent": {
                      "type": "number"
                    },
                    "delivered": {
                      "type": "number"
                    },
                    "bounced": {
                      "type": "number"
                    },
                    "complained": {
                      "type": "number"
                    },
                    "rejected": {
                      "type": "number"
                    },
                    "opened": {
                      "type": "number"
                    },
                    "inboxes": {
                      "type": "number"
                    },
                    "start": {
                      "type": "string"
                    },
                    "end": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "received": 412,
                  "sent": 380,
                  "delivered": 371,
                  "bounced": 6,
                  "complained": 1,
                  "rejected": 2,
                  "opened": 154,
                  "inboxes": 12,
                  "start": "2026-09-07T00:00:00Z",
                  "end": "2026-10-07T00:00:00Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/pods/{pod_id}/metrics/rates": {
      "get": {
        "operationId": "amPodMetricsRates",
        "summary": "Get Rates",
        "description": "Delivery, bounce, complaint, rejection and open rates for the pod's inboxes, as fractions of sent messages.\n\n- send.io addition.",
        "tags": [
          "Pod Metrics"
        ],
        "x-docs-ids": [
          "am-pod-metrics-rates"
        ],
        "parameters": [
          {
            "name": "pod_id",
            "in": "path",
            "required": true,
            "description": "The pod's ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "description": "Start of the window (RFC 3339). Also accepted as start_timestamp or after. Default 30 days ago.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "description": "End of the window (RFC 3339). Also accepted as end_timestamp or before. Default now.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "start": {
                      "type": "string"
                    },
                    "end": {
                      "type": "string"
                    },
                    "sent": {
                      "type": "number"
                    },
                    "delivery_rate": {
                      "type": "number"
                    },
                    "bounce_rate": {
                      "type": "number"
                    },
                    "complaint_rate": {
                      "type": "number"
                    },
                    "rejection_rate": {
                      "type": "number"
                    },
                    "open_rate": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "start": "2026-09-07T00:00:00Z",
                  "end": "2026-10-07T00:00:00Z",
                  "sent": 380,
                  "delivery_rate": 0.9763,
                  "bounce_rate": 0.0157,
                  "complaint_rate": 0.0026,
                  "rejection_rate": 0.0052,
                  "open_rate": 0.4052
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/pods/{pod_id}/api-keys": {
      "get": {
        "operationId": "amPodListApiKeys",
        "summary": "List API Keys",
        "description": "Lists the pod's active keys, newest first. The full key is never shown again.",
        "tags": [
          "Pod API Keys"
        ],
        "x-docs-ids": [
          "am-pod-list-api-keys"
        ],
        "parameters": [
          {
            "name": "pod_id",
            "in": "path",
            "required": true,
            "description": "The pod's ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Items per page, 1 to 100. Default 50. Other values answer 422.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "required": false,
            "description": "The next_page_token from the previous page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "number"
                    },
                    "limit": {
                      "type": "number"
                    },
                    "api_keys": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "api_key_id": {
                            "type": "string"
                          },
                          "prefix": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "inbox_id": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "pod_id": {
                            "type": "string"
                          },
                          "permissions": {
                            "type": "object",
                            "properties": {
                              "message_read": {
                                "type": "boolean"
                              },
                              "message_send": {
                                "type": "boolean"
                              },
                              "message_reply": {
                                "type": "boolean"
                              }
                            }
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "used_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "count": 1,
                  "limit": 50,
                  "api_keys": [
                    {
                      "api_key_id": "6d4f2a8c-1e3b-4a5d-9c7e-0b2d4f6a8c1e",
                      "prefix": "mx_Q7kR2pLz_",
                      "name": "support pod key",
                      "inbox_id": null,
                      "pod_id": "3f6c1e0a-8b2d-4c55-9a1e-6d7f2b9c0e41",
                      "permissions": {
                        "message_read": true,
                        "message_send": true,
                        "message_reply": true
                      },
                      "created_at": "2026-10-07T09:14:22.381Z",
                      "used_at": "2026-10-07T11:02:09.114Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "post": {
        "operationId": "amPodCreateApiKey",
        "summary": "Create API Key",
        "description": "Creates a key scoped to the pod. The full key is in api_key and is shown only once.\n\n- Only admins can create, change or delete keys. A restricted key can only manage keys inside its own scope and cannot grant permissions it does not hold.\n\n- A key cannot delete itself.",
        "tags": [
          "Pod API Keys"
        ],
        "x-docs-ids": [
          "am-pod-create-api-key"
        ],
        "parameters": [
          {
            "name": "pod_id",
            "in": "path",
            "required": true,
            "description": "The pod's ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "A label for the key, at most 50 characters. Default \"agent key\"."
                  },
                  "permissions": {
                    "type": "object",
                    "description": "Permission names mapped to true, for example {\"message_read\": true}. Leave it out for all permissions in the key's scope. Names: inbox_*, message_*, label_*_read, draft_*, webhook_*, domain_*, list_entry_*, metrics_read, api_key_*, pod_*.",
                    "properties": {
                      "message_read": {
                        "type": "boolean"
                      },
                      "message_send": {
                        "type": "boolean"
                      },
                      "message_reply": {
                        "type": "boolean"
                      }
                    }
                  }
                }
              },
              "example": {
                "name": "support pod key",
                "permissions": {
                  "message_read": true,
                  "message_send": true,
                  "message_reply": true
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "api_key_id": {
                      "type": "string"
                    },
                    "prefix": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "inbox_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "pod_id": {
                      "type": "string"
                    },
                    "permissions": {
                      "type": "object",
                      "properties": {
                        "message_read": {
                          "type": "boolean"
                        },
                        "message_send": {
                          "type": "boolean"
                        },
                        "message_reply": {
                          "type": "boolean"
                        }
                      }
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "used_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    },
                    "api_key": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "api_key_id": "6d4f2a8c-1e3b-4a5d-9c7e-0b2d4f6a8c1e",
                  "prefix": "mx_Q7kR2pLz_",
                  "name": "support pod key",
                  "inbox_id": null,
                  "pod_id": "3f6c1e0a-8b2d-4c55-9a1e-6d7f2b9c0e41",
                  "permissions": {
                    "message_read": true,
                    "message_send": true,
                    "message_reply": true
                  },
                  "created_at": "2026-10-07T09:14:22.381Z",
                  "used_at": null,
                  "api_key": "mx_Q7kR2pLz_x8VbN3mK9tW4cY6hJ1dF5gS2"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/pods/{pod_id}/api-keys/{key_id}": {
      "patch": {
        "operationId": "amPodUpdateApiKey",
        "summary": "Update API Key",
        "description": "Renames a key or changes its permissions.\n\n- send.io extension.",
        "tags": [
          "Pod API Keys"
        ],
        "x-docs-ids": [
          "am-pod-update-api-key"
        ],
        "parameters": [
          {
            "name": "pod_id",
            "in": "path",
            "required": true,
            "description": "The pod's ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "key_id",
            "in": "path",
            "required": true,
            "description": "The API key's ID (api_key_id).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "A new label."
                  },
                  "permissions": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "description": "Replaces the permission list. null removes the list (only for inbox or pod keys).",
                    "properties": {
                      "message_read": {
                        "type": "boolean"
                      }
                    }
                  }
                }
              },
              "example": {
                "name": "support pod key (read only)",
                "permissions": {
                  "message_read": true
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "api_key_id": {
                      "type": "string"
                    },
                    "prefix": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "inbox_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "pod_id": {
                      "type": "string"
                    },
                    "permissions": {
                      "type": "object",
                      "properties": {
                        "message_read": {
                          "type": "boolean"
                        }
                      }
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "used_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "api_key_id": "6d4f2a8c-1e3b-4a5d-9c7e-0b2d4f6a8c1e",
                  "prefix": "mx_Q7kR2pLz_",
                  "name": "support pod key (read only)",
                  "inbox_id": null,
                  "pod_id": "3f6c1e0a-8b2d-4c55-9a1e-6d7f2b9c0e41",
                  "permissions": {
                    "message_read": true
                  },
                  "created_at": "2026-10-07T09:14:22.381Z",
                  "used_at": "2026-10-07T11:02:09.114Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "delete": {
        "operationId": "amPodDeleteApiKey",
        "summary": "Delete API Key",
        "description": "Revokes a key. Requests with it fail right away.\n\n- Only admins can create, change or delete keys. A restricted key can only manage keys inside its own scope and cannot grant permissions it does not hold.\n\n- A key cannot delete itself.",
        "tags": [
          "Pod API Keys"
        ],
        "x-docs-ids": [
          "am-pod-delete-api-key"
        ],
        "parameters": [
          {
            "name": "pod_id",
            "in": "path",
            "required": true,
            "description": "The pod's ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "key_id",
            "in": "path",
            "required": true,
            "description": "The API key's ID (api_key_id).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {}
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/domains": {
      "get": {
        "operationId": "amListDomains",
        "summary": "List Domains",
        "description": "Lists your domains, newest first.\n\n- Inbox-scoped API keys cannot use the domain routes.",
        "tags": [
          "Domains (Agent inboxes)"
        ],
        "x-docs-ids": [
          "am-list-domains"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Items per page, 1 to 100. Default 50. Other values answer 422.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "required": false,
            "description": "The next_page_token from the previous page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "number"
                    },
                    "limit": {
                      "type": "number"
                    },
                    "domains": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "domain_id": {
                            "type": "string"
                          },
                          "domain": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "feedback_enabled": {
                            "type": "boolean"
                          },
                          "records": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                },
                                "value": {
                                  "type": "string"
                                },
                                "priority": {},
                                "status": {
                                  "type": "string"
                                }
                              }
                            }
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updated_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "count": 1,
                  "limit": 50,
                  "domains": [
                    {
                      "domain_id": "0c9d8e7f-6a5b-4c3d-2e1f-0a9b8c7d6e5f",
                      "domain": "acme.com",
                      "status": "PENDING",
                      "feedback_enabled": true,
                      "records": [
                        {
                          "type": "CNAME",
                          "name": "mx1._domainkey",
                          "value": "0028814c2802.dkim.send.io",
                          "priority": null,
                          "status": "PENDING"
                        },
                        {
                          "type": "CNAME",
                          "name": "send",
                          "value": "rp.send.io",
                          "priority": null,
                          "status": "PENDING"
                        },
                        {
                          "type": "TXT",
                          "name": "_dmarc",
                          "value": "v=DMARC1; p=none;",
                          "priority": null,
                          "status": "PENDING"
                        }
                      ],
                      "created_at": "2026-10-07T09:14:22.381Z",
                      "updated_at": "2026-10-07T09:14:22.381Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "post": {
        "operationId": "amCreateDomain",
        "summary": "Create Domain",
        "description": "Adds a domain and returns the DNS records to set up, such as DKIM, the return path and DMARC. Copy them from the response: they depend on the domain's setup.\n\n- The number of domains depends on your plan.\n\n- Status values: NOT_STARTED, PENDING, VERIFYING, VERIFIED, INVALID, FAILED. Record status: PENDING, VERIFIED, FAILED or MISSING.\n\n- Record names are relative to the domain: `send` means `send.acme.com`. For a subdomain inside a parent zone, the main API's `GET /domains/{domain_id}` also gives each record's `host` relative to the zone.",
        "tags": [
          "Domains (Agent inboxes)"
        ],
        "x-docs-ids": [
          "am-create-domain"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "domain": {
                    "type": "string",
                    "description": "The domain name, for example acme.com. name is accepted as an alias."
                  },
                  "feedback_enabled": {
                    "type": "boolean",
                    "description": "Accepted for compatibility. Bounce and complaint feedback is always on."
                  }
                },
                "required": [
                  "domain"
                ]
              },
              "example": {
                "domain": "acme.com"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "domain_id": {
                      "type": "string"
                    },
                    "domain": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "feedback_enabled": {
                      "type": "boolean"
                    },
                    "records": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "value": {
                            "type": "string"
                          },
                          "priority": {},
                          "status": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "domain_id": "0c9d8e7f-6a5b-4c3d-2e1f-0a9b8c7d6e5f",
                  "domain": "acme.com",
                  "status": "PENDING",
                  "feedback_enabled": true,
                  "records": [
                    {
                      "type": "CNAME",
                      "name": "mx1._domainkey",
                      "value": "0028814c2802.dkim.send.io",
                      "priority": null,
                      "status": "PENDING"
                    },
                    {
                      "type": "CNAME",
                      "name": "send",
                      "value": "rp.send.io",
                      "priority": null,
                      "status": "PENDING"
                    },
                    {
                      "type": "TXT",
                      "name": "_dmarc",
                      "value": "v=DMARC1; p=none;",
                      "priority": null,
                      "status": "PENDING"
                    }
                  ],
                  "created_at": "2026-10-07T09:14:22.381Z",
                  "updated_at": "2026-10-07T09:14:22.381Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/domains/{domain_id}": {
      "get": {
        "operationId": "amGetDomain",
        "summary": "Get Domain",
        "description": "Gets a domain with its DNS records and their status.",
        "tags": [
          "Domains (Agent inboxes)"
        ],
        "x-docs-ids": [
          "am-get-domain"
        ],
        "parameters": [
          {
            "name": "domain_id",
            "in": "path",
            "required": true,
            "description": "The domain's ID, or the domain name itself (for example acme.com).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "domain_id": {
                      "type": "string"
                    },
                    "domain": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "feedback_enabled": {
                      "type": "boolean"
                    },
                    "records": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "value": {
                            "type": "string"
                          },
                          "priority": {},
                          "status": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "domain_id": "0c9d8e7f-6a5b-4c3d-2e1f-0a9b8c7d6e5f",
                  "domain": "acme.com",
                  "status": "PENDING",
                  "feedback_enabled": true,
                  "records": [
                    {
                      "type": "CNAME",
                      "name": "mx1._domainkey",
                      "value": "0028814c2802.dkim.send.io",
                      "priority": null,
                      "status": "PENDING"
                    },
                    {
                      "type": "CNAME",
                      "name": "send",
                      "value": "rp.send.io",
                      "priority": null,
                      "status": "PENDING"
                    },
                    {
                      "type": "TXT",
                      "name": "_dmarc",
                      "value": "v=DMARC1; p=none;",
                      "priority": null,
                      "status": "PENDING"
                    }
                  ],
                  "created_at": "2026-10-07T09:14:22.381Z",
                  "updated_at": "2026-10-07T09:14:22.381Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "patch": {
        "operationId": "amUpdateDomain",
        "summary": "Update Domain",
        "description": "Accepted for compatibility. Bounce and complaint feedback is always on, so this returns the domain unchanged.",
        "tags": [
          "Domains (Agent inboxes)"
        ],
        "x-docs-ids": [
          "am-update-domain"
        ],
        "parameters": [
          {
            "name": "domain_id",
            "in": "path",
            "required": true,
            "description": "The domain's ID, or the domain name itself (for example acme.com).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "feedback_enabled": {
                    "type": "boolean",
                    "description": "Ignored: feedback is always on."
                  }
                }
              },
              "example": {
                "feedback_enabled": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "domain_id": {
                      "type": "string"
                    },
                    "domain": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "feedback_enabled": {
                      "type": "boolean"
                    },
                    "records": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "value": {
                            "type": "string"
                          },
                          "priority": {},
                          "status": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "domain_id": "0c9d8e7f-6a5b-4c3d-2e1f-0a9b8c7d6e5f",
                  "domain": "acme.com",
                  "status": "PENDING",
                  "feedback_enabled": true,
                  "records": [
                    {
                      "type": "CNAME",
                      "name": "mx1._domainkey",
                      "value": "0028814c2802.dkim.send.io",
                      "priority": null,
                      "status": "PENDING"
                    },
                    {
                      "type": "CNAME",
                      "name": "send",
                      "value": "rp.send.io",
                      "priority": null,
                      "status": "PENDING"
                    },
                    {
                      "type": "TXT",
                      "name": "_dmarc",
                      "value": "v=DMARC1; p=none;",
                      "priority": null,
                      "status": "PENDING"
                    }
                  ],
                  "created_at": "2026-10-07T09:14:22.381Z",
                  "updated_at": "2026-10-07T09:14:22.381Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "delete": {
        "operationId": "amDeleteDomain",
        "summary": "Delete Domain",
        "description": "Deletes a domain. Mail from it stops.",
        "tags": [
          "Domains (Agent inboxes)"
        ],
        "x-docs-ids": [
          "am-delete-domain"
        ],
        "parameters": [
          {
            "name": "domain_id",
            "in": "path",
            "required": true,
            "description": "The domain's ID, or the domain name itself (for example acme.com).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {}
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/domains/{domain_id}/verify": {
      "post": {
        "operationId": "amVerifyDomain",
        "summary": "Verify Domain",
        "description": "Checks the domain's DNS records now and returns the updated status. A domain.verified event is sent when it becomes verified.",
        "tags": [
          "Domains (Agent inboxes)"
        ],
        "x-docs-ids": [
          "am-verify-domain"
        ],
        "parameters": [
          {
            "name": "domain_id",
            "in": "path",
            "required": true,
            "description": "The domain's ID, or the domain name itself (for example acme.com).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "domain_id": {
                      "type": "string"
                    },
                    "domain": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "feedback_enabled": {
                      "type": "boolean"
                    },
                    "records": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "value": {
                            "type": "string"
                          },
                          "priority": {},
                          "status": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "domain_id": "0c9d8e7f-6a5b-4c3d-2e1f-0a9b8c7d6e5f",
                  "domain": "acme.com",
                  "status": "VERIFIED",
                  "feedback_enabled": true,
                  "records": [
                    {
                      "type": "CNAME",
                      "name": "mx1._domainkey",
                      "value": "0028814c2802.dkim.send.io",
                      "priority": null,
                      "status": "VERIFIED"
                    },
                    {
                      "type": "CNAME",
                      "name": "send",
                      "value": "rp.send.io",
                      "priority": null,
                      "status": "VERIFIED"
                    },
                    {
                      "type": "TXT",
                      "name": "_dmarc",
                      "value": "v=DMARC1; p=none;",
                      "priority": null,
                      "status": "VERIFIED"
                    }
                  ],
                  "created_at": "2026-10-07T09:14:22.381Z",
                  "updated_at": "2026-10-07T09:14:22.381Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/domains/{domain_id}/zone-file": {
      "get": {
        "operationId": "amGetZoneFile",
        "summary": "Get Zone File",
        "description": "Gets the domain's DNS records as a BIND zone file you can import at your DNS provider.\n\n- Returned as JSON with a zone_file string.",
        "tags": [
          "Domains (Agent inboxes)"
        ],
        "x-docs-ids": [
          "am-get-zone-file"
        ],
        "parameters": [
          {
            "name": "domain_id",
            "in": "path",
            "required": true,
            "description": "The domain's ID, or the domain name itself (for example acme.com).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "domain_id": {
                      "type": "string"
                    },
                    "zone_file": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "domain_id": "0c9d8e7f-6a5b-4c3d-2e1f-0a9b8c7d6e5f",
                  "zone_file": "; Zone file for acme.com, generated by send.io\n$ORIGIN acme.com.\nmx1._domainkey\t3600\tIN\tCNAME\t0028814c2802.dkim.send.io.\nsend\t3600\tIN\tCNAME\trp.send.io.\n_dmarc\t3600\tIN\tTXT\t\"v=DMARC1; p=none;\"\n"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/domains/{domain_id}/setup-link": {
      "get": {
        "operationId": "amGetDomainSetupLink",
        "summary": "Get Setup Link",
        "description": "Gets a one-click DNS setup link (Domain Connect) when the domain's DNS provider supports it. Open the url to add all records at once.\n\n- send.io addition. When the provider is not supported, supported is false and url is null.",
        "tags": [
          "Domains (Agent inboxes)"
        ],
        "x-docs-ids": [
          "am-get-domain-setup-link"
        ],
        "parameters": [
          {
            "name": "domain_id",
            "in": "path",
            "required": true,
            "description": "The domain's ID, or the domain name itself (for example acme.com).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "domain_id": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "supported": {
                      "type": "boolean"
                    },
                    "provider": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "domain_id": "0c9d8e7f-6a5b-4c3d-2e1f-0a9b8c7d6e5f",
                  "url": "https://domainconnect.godaddy.com/v2/domainTemplates/providers/send.io/services/mail/apply?domain=acme.com",
                  "supported": true,
                  "provider": "GoDaddy"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/webhooks": {
      "get": {
        "operationId": "amListWebhooks",
        "summary": "List Webhooks",
        "description": "Lists your webhooks, newest first. A scoped API key sees only webhooks for its inbox or pod.",
        "tags": [
          "Webhooks (Agent inboxes)"
        ],
        "x-docs-ids": [
          "am-list-webhooks"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Items per page, 1 to 100. Default 50. Other values answer 422.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "required": false,
            "description": "The next_page_token from the previous page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "number"
                    },
                    "limit": {
                      "type": "number"
                    },
                    "webhooks": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "webhook_id": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string"
                          },
                          "event_types": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "enabled": {
                            "type": "boolean"
                          },
                          "client_id": {
                            "type": "string"
                          },
                          "inbox_ids": {
                            "type": "array"
                          },
                          "pod_ids": {
                            "type": "array"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updated_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "count": 1,
                  "limit": 50,
                  "webhooks": [
                    {
                      "webhook_id": "e7a1c3f5-2b4d-4e6f-8a0c-1d3e5f7a9b2c",
                      "url": "https://example.com/hooks/sendio",
                      "event_types": [
                        "message.received",
                        "message.bounced"
                      ],
                      "enabled": true,
                      "client_id": "main-hook",
                      "inbox_ids": [],
                      "pod_ids": [],
                      "created_at": "2026-10-07T09:14:22.381Z",
                      "updated_at": "2026-10-07T09:14:22.381Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "post": {
        "operationId": "amCreateWebhook",
        "summary": "Create Webhook",
        "description": "Creates a webhook. The signing secret is returned only once: use it to check each delivery's signature.\n\n- The number of webhooks depends on your plan.\n\n- A scoped API key that names no inboxes or pods gets a webhook limited to its own inbox or pod.",
        "tags": [
          "Webhooks (Agent inboxes)"
        ],
        "x-docs-ids": [
          "am-create-webhook"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "The HTTPS URL that receives the events. endpoint is accepted as an alias."
                  },
                  "event_types": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Events to send: message.received, message.received.spam, message.sent, message.delivered, message.bounced, message.complained, message.rejected, message.opened, domain.verified. Default [\"message.received\"]. A webhook limited to inboxes or pods only receives the message events: any other type answers 422."
                  },
                  "inbox_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Limit the webhook to these inboxes (addresses or IDs)."
                  },
                  "pod_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Limit the webhook to these pods."
                  },
                  "client_id": {
                    "type": "string",
                    "description": "Your own ID for idempotency. If a webhook with this client_id exists with the same settings, it is returned instead of a new one; different settings answer 409."
                  }
                },
                "required": [
                  "url"
                ]
              },
              "example": {
                "url": "https://example.com/hooks/sendio",
                "event_types": [
                  "message.received",
                  "message.bounced"
                ],
                "client_id": "main-hook"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "webhook_id": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "event_types": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "enabled": {
                      "type": "boolean"
                    },
                    "client_id": {
                      "type": "string"
                    },
                    "inbox_ids": {
                      "type": "array"
                    },
                    "pod_ids": {
                      "type": "array"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "secret": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "webhook_id": "e7a1c3f5-2b4d-4e6f-8a0c-1d3e5f7a9b2c",
                  "url": "https://example.com/hooks/sendio",
                  "event_types": [
                    "message.received",
                    "message.bounced"
                  ],
                  "enabled": true,
                  "client_id": "main-hook",
                  "inbox_ids": [],
                  "pod_ids": [],
                  "created_at": "2026-10-07T09:14:22.381Z",
                  "updated_at": "2026-10-07T09:14:22.381Z",
                  "secret": "whsec_c2VjcmV0LXNpZ25pbmcta2V5LWV4YW1wbGU="
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/webhooks/{webhook_id}": {
      "get": {
        "operationId": "amGetWebhook",
        "summary": "Get Webhook",
        "description": "Gets one webhook.",
        "tags": [
          "Webhooks (Agent inboxes)"
        ],
        "x-docs-ids": [
          "am-get-webhook"
        ],
        "parameters": [
          {
            "name": "webhook_id",
            "in": "path",
            "required": true,
            "description": "The webhook's ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "webhook_id": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "event_types": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "enabled": {
                      "type": "boolean"
                    },
                    "client_id": {
                      "type": "string"
                    },
                    "inbox_ids": {
                      "type": "array"
                    },
                    "pod_ids": {
                      "type": "array"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "webhook_id": "e7a1c3f5-2b4d-4e6f-8a0c-1d3e5f7a9b2c",
                  "url": "https://example.com/hooks/sendio",
                  "event_types": [
                    "message.received",
                    "message.bounced"
                  ],
                  "enabled": true,
                  "client_id": "main-hook",
                  "inbox_ids": [],
                  "pod_ids": [],
                  "created_at": "2026-10-07T09:14:22.381Z",
                  "updated_at": "2026-10-07T09:14:22.381Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "patch": {
        "operationId": "amUpdateWebhook",
        "summary": "Update Webhook",
        "description": "Changes a webhook's URL, events, scope or whether it is enabled. Only the fields you send change.",
        "tags": [
          "Webhooks (Agent inboxes)"
        ],
        "x-docs-ids": [
          "am-update-webhook"
        ],
        "parameters": [
          {
            "name": "webhook_id",
            "in": "path",
            "required": true,
            "description": "The webhook's ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "A new HTTPS URL."
                  },
                  "event_types": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Replaces the list of events."
                  },
                  "enabled": {
                    "type": "boolean",
                    "description": "false pauses delivery; true resumes it."
                  },
                  "add_inbox_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Inboxes to add to the webhook's scope."
                  },
                  "remove_inbox_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Inboxes to remove from the webhook's scope."
                  },
                  "add_pod_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Pods to add to the webhook's scope."
                  },
                  "remove_pod_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Pods to remove from the webhook's scope."
                  }
                }
              },
              "example": {
                "event_types": [
                  "message.received"
                ],
                "add_pod_ids": [
                  "3f6c1e0a-8b2d-4c55-9a1e-6d7f2b9c0e41"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "webhook_id": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "event_types": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "enabled": {
                      "type": "boolean"
                    },
                    "client_id": {
                      "type": "string"
                    },
                    "inbox_ids": {
                      "type": "array"
                    },
                    "pod_ids": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "webhook_id": "e7a1c3f5-2b4d-4e6f-8a0c-1d3e5f7a9b2c",
                  "url": "https://example.com/hooks/sendio",
                  "event_types": [
                    "message.received"
                  ],
                  "enabled": true,
                  "client_id": "main-hook",
                  "inbox_ids": [],
                  "pod_ids": [
                    "3f6c1e0a-8b2d-4c55-9a1e-6d7f2b9c0e41"
                  ],
                  "created_at": "2026-10-07T09:14:22.381Z",
                  "updated_at": "2026-10-07T09:14:22.381Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "delete": {
        "operationId": "amDeleteWebhook",
        "summary": "Delete Webhook",
        "description": "Deletes a webhook. No more events are sent to it.",
        "tags": [
          "Webhooks (Agent inboxes)"
        ],
        "x-docs-ids": [
          "am-delete-webhook"
        ],
        "parameters": [
          {
            "name": "webhook_id",
            "in": "path",
            "required": true,
            "description": "The webhook's ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {}
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/webhooks/{webhook_id}/headers": {
      "get": {
        "operationId": "amGetWebhookHeaders",
        "summary": "Get Webhook Headers",
        "description": "Gets the custom headers sent with every delivery of this webhook.\n\n- send.io addition.",
        "tags": [
          "Webhooks (Agent inboxes)"
        ],
        "x-docs-ids": [
          "am-get-webhook-headers"
        ],
        "parameters": [
          {
            "name": "webhook_id",
            "in": "path",
            "required": true,
            "description": "The webhook's ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "webhook_id": {
                      "type": "string"
                    },
                    "headers": {
                      "type": "object",
                      "properties": {
                        "X-Auth-Token": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "webhook_id": "e7a1c3f5-2b4d-4e6f-8a0c-1d3e5f7a9b2c",
                  "headers": {
                    "X-Auth-Token": "s3cr3t"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "patch": {
        "operationId": "amUpdateWebhookHeaders",
        "summary": "Update Webhook Headers",
        "description": "Sets or removes custom headers on this webhook's deliveries, for example a token your endpoint checks.\n\n- send.io addition.",
        "tags": [
          "Webhooks (Agent inboxes)"
        ],
        "x-docs-ids": [
          "am-update-webhook-headers"
        ],
        "parameters": [
          {
            "name": "webhook_id",
            "in": "path",
            "required": true,
            "description": "The webhook's ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "headers": {
                    "type": "object",
                    "description": "Header names mapped to values. A null value removes that header. Content-Type, Content-Length, Host, User-Agent and svix-* headers cannot be set.",
                    "properties": {
                      "X-Auth-Token": {
                        "type": "string"
                      },
                      "X-Old": {}
                    }
                  }
                },
                "required": [
                  "headers"
                ]
              },
              "example": {
                "headers": {
                  "X-Auth-Token": "s3cr3t",
                  "X-Old": null
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "webhook_id": {
                      "type": "string"
                    },
                    "headers": {
                      "type": "object",
                      "properties": {
                        "X-Auth-Token": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "webhook_id": "e7a1c3f5-2b4d-4e6f-8a0c-1d3e5f7a9b2c",
                  "headers": {
                    "X-Auth-Token": "s3cr3t"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/lists/{direction}/{type}": {
      "get": {
        "operationId": "amListEntries",
        "summary": "List Entries",
        "description": "Lists the entries on one team-wide list, sorted by entry.\n\n- Inbox- and pod-scoped API keys cannot use the team-wide lists; use the inbox or pod lists instead.",
        "tags": [
          "Lists"
        ],
        "x-docs-ids": [
          "am-list-entries"
        ],
        "parameters": [
          {
            "name": "direction",
            "in": "path",
            "required": true,
            "description": "Which mail the list applies to: send, receive or reply.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "path",
            "required": true,
            "description": "The list type: allow or block.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Items per page, 1 to 100. Default 50. Other values answer 422.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "required": false,
            "description": "The next_page_token from the previous page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "number"
                    },
                    "limit": {
                      "type": "number"
                    },
                    "entries": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "entry": {
                            "type": "string"
                          },
                          "entry_type": {
                            "type": "string"
                          },
                          "list_type": {
                            "type": "string"
                          },
                          "direction": {
                            "type": "string"
                          },
                          "inbox_id": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "pod_id": {
                            "type": "string"
                          },
                          "organization_id": {
                            "type": "string"
                          },
                          "reason": {
                            "type": "string"
                          },
                          "read_only": {
                            "type": "boolean"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "count": 1,
                  "limit": 50,
                  "entries": [
                    {
                      "entry": "spammy.example",
                      "entry_type": "domain",
                      "list_type": "block",
                      "direction": "receive",
                      "inbox_id": null,
                      "pod_id": "default",
                      "organization_id": "a1d2c3b4-5e6f-4789-8abc-0d1e2f3a4b5c",
                      "reason": "Unwanted cold outreach",
                      "read_only": false,
                      "created_at": "2026-10-07T09:14:22.381Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "post": {
        "operationId": "amCreateListEntry",
        "summary": "Create List Entry",
        "description": "Adds an email address or domain to a team-wide list. For example, block a domain on the receive list.\n\n- An agent that signed up by itself must be verified by its human first.",
        "tags": [
          "Lists"
        ],
        "x-docs-ids": [
          "am-create-list-entry"
        ],
        "parameters": [
          {
            "name": "direction",
            "in": "path",
            "required": true,
            "description": "Which mail the list applies to: send, receive or reply.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "path",
            "required": true,
            "description": "The list type: allow or block.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "entry": {
                    "type": "string",
                    "description": "An email address (dana@acme.com) or a domain (acme.com)."
                  },
                  "reason": {
                    "type": "string",
                    "description": "Why the entry was added. Adding an existing entry updates its reason."
                  }
                },
                "required": [
                  "entry"
                ]
              },
              "example": {
                "entry": "spammy.example",
                "reason": "Unwanted cold outreach"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "entry": {
                      "type": "string"
                    },
                    "entry_type": {
                      "type": "string"
                    },
                    "list_type": {
                      "type": "string"
                    },
                    "direction": {
                      "type": "string"
                    },
                    "inbox_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "pod_id": {
                      "type": "string"
                    },
                    "organization_id": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    },
                    "read_only": {
                      "type": "boolean"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "entry": "spammy.example",
                  "entry_type": "domain",
                  "list_type": "block",
                  "direction": "receive",
                  "inbox_id": null,
                  "pod_id": "default",
                  "organization_id": "a1d2c3b4-5e6f-4789-8abc-0d1e2f3a4b5c",
                  "reason": "Unwanted cold outreach",
                  "read_only": false,
                  "created_at": "2026-10-07T09:14:22.381Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/lists/{direction}/{type}/{entry}": {
      "get": {
        "operationId": "amGetListEntry",
        "summary": "Get List Entry",
        "description": "Gets one entry on a team-wide list.",
        "tags": [
          "Lists"
        ],
        "x-docs-ids": [
          "am-get-list-entry"
        ],
        "parameters": [
          {
            "name": "direction",
            "in": "path",
            "required": true,
            "description": "Which mail the list applies to: send, receive or reply.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "path",
            "required": true,
            "description": "The list type: allow or block.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "entry",
            "in": "path",
            "required": true,
            "description": "The email address or domain on the list (case does not matter).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "entry": {
                      "type": "string"
                    },
                    "entry_type": {
                      "type": "string"
                    },
                    "list_type": {
                      "type": "string"
                    },
                    "direction": {
                      "type": "string"
                    },
                    "inbox_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "pod_id": {
                      "type": "string"
                    },
                    "organization_id": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    },
                    "read_only": {
                      "type": "boolean"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "entry": "spammy.example",
                  "entry_type": "domain",
                  "list_type": "block",
                  "direction": "receive",
                  "inbox_id": null,
                  "pod_id": "default",
                  "organization_id": "a1d2c3b4-5e6f-4789-8abc-0d1e2f3a4b5c",
                  "reason": "Unwanted cold outreach",
                  "read_only": false,
                  "created_at": "2026-10-07T09:14:22.381Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "delete": {
        "operationId": "amDeleteListEntry",
        "summary": "Delete List Entry",
        "description": "Removes an entry from a team-wide list.",
        "tags": [
          "Lists"
        ],
        "x-docs-ids": [
          "am-delete-list-entry"
        ],
        "parameters": [
          {
            "name": "direction",
            "in": "path",
            "required": true,
            "description": "Which mail the list applies to: send, receive or reply.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "path",
            "required": true,
            "description": "The list type: allow or block.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "entry",
            "in": "path",
            "required": true,
            "description": "The email address or domain on the list (case does not matter).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {}
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/metrics/events": {
      "get": {
        "operationId": "amMetricsEvents",
        "summary": "List Events",
        "description": "Lists message events (received, sent, delivered, bounced, complained, opened, rejected), newest first.\n\n- Metrics are split into /metrics/events, /metrics/usage and /metrics/rates.\n\n- At most the 1,000 most recent events in the window are returned.",
        "tags": [
          "Metrics"
        ],
        "x-docs-ids": [
          "am-metrics-events"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Items per page, 1 to 100. Default 50. Other values answer 422.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "required": false,
            "description": "The next_page_token from the previous page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "description": "Start of the window (RFC 3339). Also accepted as start_timestamp or after. Default 30 days ago.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "description": "End of the window (RFC 3339). Also accepted as end_timestamp or before. Default now.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "event_types",
            "in": "query",
            "required": false,
            "description": "Only these events: message.received, message.sent, message.delivered, message.bounced, message.complained, message.opened, message.rejected.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "number"
                    },
                    "limit": {
                      "type": "number"
                    },
                    "events": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "event_type": {
                            "type": "string"
                          },
                          "timestamp": {
                            "type": "string"
                          },
                          "message_id": {
                            "type": "string"
                          },
                          "thread_id": {
                            "type": "string"
                          },
                          "recipient": {
                            "type": "string"
                          },
                          "inbox_id": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "count": 2,
                  "limit": 50,
                  "events": [
                    {
                      "event_type": "message.delivered",
                      "timestamp": "2026-10-07T09:20:41.002Z",
                      "message_id": "f2a4c6e8-0b1d-4f3a-8c5e-7a9b1c3d5e7f",
                      "thread_id": "8e3b5a71-2f4c-4d1e-9b6a-7c0d2e4f1a93",
                      "recipient": "dana@acme.com",
                      "inbox_id": "research-bot@agents.send.io"
                    },
                    {
                      "event_type": "message.received",
                      "timestamp": "2026-10-07T09:14:22.381Z",
                      "message_id": "c41f9e20-6a3b-4f8d-b2e1-5d7a9c0b3e18",
                      "thread_id": "8e3b5a71-2f4c-4d1e-9b6a-7c0d2e4f1a93",
                      "inbox_id": "research-bot@agents.send.io"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/metrics/usage": {
      "get": {
        "operationId": "amMetricsUsage",
        "summary": "Get Usage",
        "description": "Counts messages by outcome in a time window, plus the number of active inboxes.\n\n- send.io addition.\n\n- Deleting mail does not change past numbers: a deleted sent message still counts for the inbox it was sent from. `received` counts received messages still in the inbox; a permanently deleted or expired message is no longer counted.",
        "tags": [
          "Metrics"
        ],
        "x-docs-ids": [
          "am-metrics-usage"
        ],
        "parameters": [
          {
            "name": "start",
            "in": "query",
            "required": false,
            "description": "Start of the window (RFC 3339). Also accepted as start_timestamp or after. Default 30 days ago.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "description": "End of the window (RFC 3339). Also accepted as end_timestamp or before. Default now.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "received": {
                      "type": "number"
                    },
                    "sent": {
                      "type": "number"
                    },
                    "delivered": {
                      "type": "number"
                    },
                    "bounced": {
                      "type": "number"
                    },
                    "complained": {
                      "type": "number"
                    },
                    "rejected": {
                      "type": "number"
                    },
                    "opened": {
                      "type": "number"
                    },
                    "inboxes": {
                      "type": "number"
                    },
                    "start": {
                      "type": "string"
                    },
                    "end": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "received": 412,
                  "sent": 380,
                  "delivered": 371,
                  "bounced": 6,
                  "complained": 1,
                  "rejected": 2,
                  "opened": 154,
                  "inboxes": 12,
                  "start": "2026-09-07T00:00:00Z",
                  "end": "2026-10-07T00:00:00Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/metrics/rates": {
      "get": {
        "operationId": "amMetricsRates",
        "summary": "Get Rates",
        "description": "Delivery, bounce, complaint, rejection and open rates in a time window, as fractions of sent messages (0 to 1).\n\n- send.io addition.",
        "tags": [
          "Metrics"
        ],
        "x-docs-ids": [
          "am-metrics-rates"
        ],
        "parameters": [
          {
            "name": "start",
            "in": "query",
            "required": false,
            "description": "Start of the window (RFC 3339). Also accepted as start_timestamp or after. Default 30 days ago.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "description": "End of the window (RFC 3339). Also accepted as end_timestamp or before. Default now.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "start": {
                      "type": "string"
                    },
                    "end": {
                      "type": "string"
                    },
                    "sent": {
                      "type": "number"
                    },
                    "delivery_rate": {
                      "type": "number"
                    },
                    "bounce_rate": {
                      "type": "number"
                    },
                    "complaint_rate": {
                      "type": "number"
                    },
                    "rejection_rate": {
                      "type": "number"
                    },
                    "open_rate": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "start": "2026-09-07T00:00:00Z",
                  "end": "2026-10-07T00:00:00Z",
                  "sent": 380,
                  "delivery_rate": 0.9763,
                  "bounce_rate": 0.0157,
                  "complaint_rate": 0.0026,
                  "rejection_rate": 0.0052,
                  "open_rate": 0.4052
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/api-keys": {
      "get": {
        "operationId": "amListApiKeys",
        "summary": "List API Keys",
        "description": "Lists your active keys, newest first. A scoped key sees only keys in its own scope.",
        "tags": [
          "API Keys"
        ],
        "x-docs-ids": [
          "am-list-api-keys"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Items per page, 1 to 100. Default 50. Other values answer 422.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "required": false,
            "description": "The next_page_token from the previous page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "number"
                    },
                    "limit": {
                      "type": "number"
                    },
                    "api_keys": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "api_key_id": {
                            "type": "string"
                          },
                          "prefix": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "inbox_id": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "pod_id": {
                            "type": "string"
                          },
                          "permissions": {
                            "type": "object",
                            "properties": {
                              "message_read": {
                                "type": "boolean"
                              },
                              "message_send": {
                                "type": "boolean"
                              },
                              "message_reply": {
                                "type": "boolean"
                              }
                            }
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "used_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "count": 1,
                  "limit": 50,
                  "api_keys": [
                    {
                      "api_key_id": "6d4f2a8c-1e3b-4a5d-9c7e-0b2d4f6a8c1e",
                      "prefix": "mx_Q7kR2pLz_",
                      "name": "support pod key",
                      "inbox_id": null,
                      "pod_id": "3f6c1e0a-8b2d-4c55-9a1e-6d7f2b9c0e41",
                      "permissions": {
                        "message_read": true,
                        "message_send": true,
                        "message_reply": true
                      },
                      "created_at": "2026-10-07T09:14:22.381Z",
                      "used_at": "2026-10-07T11:02:09.114Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "post": {
        "operationId": "amCreateApiKey",
        "summary": "Create API Key",
        "description": "Creates a team-wide key. Without permissions it has full access; with permissions it can do only those things. The full key is in api_key and is shown only once.\n\n- Only admins can create, change or delete keys. A restricted key can only manage keys inside its own scope and cannot grant permissions it does not hold.\n\n- A key cannot delete itself.\n\n- A scoped key that calls this route creates a key in its own inbox or pod.\n\n- An agent that signed up by itself must be verified by its human first.",
        "tags": [
          "API Keys"
        ],
        "x-docs-ids": [
          "am-create-api-key"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "A label for the key, at most 50 characters. Default \"agent key\"."
                  },
                  "permissions": {
                    "type": "object",
                    "description": "Permission names mapped to true, for example {\"message_read\": true}. Leave it out for all permissions in the key's scope. Names: inbox_*, message_*, label_*_read, draft_*, webhook_*, domain_*, list_entry_*, metrics_read, api_key_*, pod_*.",
                    "properties": {
                      "metrics_read": {
                        "type": "boolean"
                      },
                      "message_read": {
                        "type": "boolean"
                      }
                    }
                  }
                }
              },
              "example": {
                "name": "reporting",
                "permissions": {
                  "metrics_read": true,
                  "message_read": true
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "api_key_id": {
                      "type": "string"
                    },
                    "prefix": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "inbox_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "pod_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "permissions": {
                      "type": "object",
                      "properties": {
                        "metrics_read": {
                          "type": "boolean"
                        },
                        "message_read": {
                          "type": "boolean"
                        }
                      }
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "used_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    },
                    "api_key": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "api_key_id": "6d4f2a8c-1e3b-4a5d-9c7e-0b2d4f6a8c1e",
                  "prefix": "mx_Q7kR2pLz_",
                  "name": "reporting",
                  "inbox_id": null,
                  "pod_id": null,
                  "permissions": {
                    "metrics_read": true,
                    "message_read": true
                  },
                  "created_at": "2026-10-07T09:14:22.381Z",
                  "used_at": null,
                  "api_key": "mx_Q7kR2pLz_x8VbN3mK9tW4cY6hJ1dF5gS2"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/api-keys/{key_id}": {
      "get": {
        "operationId": "amGetApiKey",
        "summary": "Get API Key",
        "description": "Gets one key. The full key is never shown again.",
        "tags": [
          "API Keys"
        ],
        "x-docs-ids": [
          "am-get-api-key"
        ],
        "parameters": [
          {
            "name": "key_id",
            "in": "path",
            "required": true,
            "description": "The API key's ID (api_key_id).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "api_key_id": {
                      "type": "string"
                    },
                    "prefix": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "inbox_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "pod_id": {
                      "type": "string"
                    },
                    "permissions": {
                      "type": "object",
                      "properties": {
                        "message_read": {
                          "type": "boolean"
                        },
                        "message_send": {
                          "type": "boolean"
                        },
                        "message_reply": {
                          "type": "boolean"
                        }
                      }
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "used_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "api_key_id": "6d4f2a8c-1e3b-4a5d-9c7e-0b2d4f6a8c1e",
                  "prefix": "mx_Q7kR2pLz_",
                  "name": "support pod key",
                  "inbox_id": null,
                  "pod_id": "3f6c1e0a-8b2d-4c55-9a1e-6d7f2b9c0e41",
                  "permissions": {
                    "message_read": true,
                    "message_send": true,
                    "message_reply": true
                  },
                  "created_at": "2026-10-07T09:14:22.381Z",
                  "used_at": "2026-10-07T11:02:09.114Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "patch": {
        "operationId": "amUpdateApiKey",
        "summary": "Update API Key",
        "description": "Renames a key or changes its permissions.\n\n- send.io extension.\n\n- A team-wide restricted key always needs a permission list; it is never turned into a full-access key.",
        "tags": [
          "API Keys"
        ],
        "x-docs-ids": [
          "am-update-api-key"
        ],
        "parameters": [
          {
            "name": "key_id",
            "in": "path",
            "required": true,
            "description": "The API key's ID (api_key_id).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "A new label."
                  },
                  "permissions": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "description": "Replaces the permission list. null removes the list (only for inbox or pod keys).",
                    "properties": {
                      "message_read": {
                        "type": "boolean"
                      }
                    }
                  }
                }
              },
              "example": {
                "permissions": {
                  "message_read": true
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "api_key_id": {
                      "type": "string"
                    },
                    "prefix": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "inbox_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "pod_id": {
                      "type": "string"
                    },
                    "permissions": {
                      "type": "object",
                      "properties": {
                        "message_read": {
                          "type": "boolean"
                        }
                      }
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "used_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "api_key_id": "6d4f2a8c-1e3b-4a5d-9c7e-0b2d4f6a8c1e",
                  "prefix": "mx_Q7kR2pLz_",
                  "name": "support pod key",
                  "inbox_id": null,
                  "pod_id": "3f6c1e0a-8b2d-4c55-9a1e-6d7f2b9c0e41",
                  "permissions": {
                    "message_read": true
                  },
                  "created_at": "2026-10-07T09:14:22.381Z",
                  "used_at": "2026-10-07T11:02:09.114Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "delete": {
        "operationId": "amDeleteApiKey",
        "summary": "Delete API Key",
        "description": "Revokes a key. Requests with it fail right away.\n\n- Only admins can create, change or delete keys. A restricted key can only manage keys inside its own scope and cannot grant permissions it does not hold.\n\n- A key cannot delete itself.",
        "tags": [
          "API Keys"
        ],
        "x-docs-ids": [
          "am-delete-api-key"
        ],
        "parameters": [
          {
            "name": "key_id",
            "in": "path",
            "required": true,
            "description": "The API key's ID (api_key_id).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {}
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/organizations/{org_id}": {
      "get": {
        "operationId": "amGetOrganization",
        "summary": "Get Organization",
        "description": "Gets your organization. Use the organization_id from Get Current Key.\n\n- Any other organization's ID returns 404.",
        "tags": [
          "Organization"
        ],
        "x-docs-ids": [
          "am-get-organization"
        ],
        "parameters": [
          {
            "name": "org_id",
            "in": "path",
            "required": true,
            "description": "Your organization's ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "organization_id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "organization_id": "a1d2c3b4-5e6f-4789-8abc-0d1e2f3a4b5c",
                  "name": "Acme",
                  "created_at": "2026-03-02T08:00:00Z",
                  "updated_at": "2026-10-07T09:14:22.381Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/auth/me": {
      "get": {
        "operationId": "amAuthMe",
        "summary": "Get Current Key",
        "description": "Tells you who you are: your organization, the key in use, its scope and permissions, and for a self-signed-up agent whether it is verified.\n\n- send.io addition.\n\n- permission is full_access or inbox_access (a scoped or restricted key). inbox_id or pod_id appear for scoped keys; agent appears only for agent sign-ups. permissions is null when there is no permission list.",
        "tags": [
          "Organization"
        ],
        "x-docs-ids": [
          "am-auth-me"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "organization_id": {
                      "type": "string"
                    },
                    "api_key_id": {
                      "type": "string"
                    },
                    "permission": {
                      "type": "string"
                    },
                    "pod_id": {
                      "type": "string"
                    },
                    "permissions": {
                      "type": "object",
                      "properties": {
                        "message_read": {
                          "type": "boolean"
                        },
                        "message_send": {
                          "type": "boolean"
                        },
                        "message_reply": {
                          "type": "boolean"
                        }
                      }
                    },
                    "agent": {
                      "type": "object",
                      "properties": {
                        "verified": {
                          "type": "boolean"
                        },
                        "human_email": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "organization_id": "a1d2c3b4-5e6f-4789-8abc-0d1e2f3a4b5c",
                  "api_key_id": "6d4f2a8c-1e3b-4a5d-9c7e-0b2d4f6a8c1e",
                  "permission": "inbox_access",
                  "pod_id": "3f6c1e0a-8b2d-4c55-9a1e-6d7f2b9c0e41",
                  "permissions": {
                    "message_read": true,
                    "message_send": true,
                    "message_reply": true
                  },
                  "agent": {
                    "verified": true,
                    "human_email": "praveen@acme.com"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/agents/sign-up": {
      "post": {
        "operationId": "amAgentSignup",
        "summary": "Sign Up an Agent",
        "description": "Creates an account, an inbox on agents.send.io and an API key. If you give human_email, a verification code is emailed to that person.\n\n- No API key needed. Limited to 20 sign-ups per hour per network.\n\n- Until verified, the agent can only email its human and cannot create pods, API keys or list entries.\n\n- Signing up again with an existing username and the same human_email returns a new key that only works for verify, plus a message field, and emails the human a recovery code. The old key keeps working unless that recovery code is entered.\n\n- While the agent's recovery is locked (too many wrong recovery codes), signing up again returns 429 with Retry-After.\n\n- Returns 409 if the address is taken by someone else.",
        "tags": [
          "Agent Sign-up"
        ],
        "x-docs-ids": [
          "am-agent-signup"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "username": {
                    "type": "string",
                    "description": "The inbox's name before @agents.send.io. a-z, 0-9, dot, dash, underscore and plus, 1 to 64 characters. Leave it out for a random agent-xxxxxxxxxx; an empty string or a value that is not a string is refused with 422."
                  },
                  "human_email": {
                    "type": "string",
                    "description": "The email address of the human responsible for this agent. They get the verification code."
                  }
                }
              },
              "example": {
                "username": "research-bot",
                "human_email": "praveen@acme.com"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "agent_id": {
                      "type": "string"
                    },
                    "organization_id": {
                      "type": "string"
                    },
                    "inbox_id": {
                      "type": "string"
                    },
                    "api_key": {
                      "type": "string"
                    },
                    "verified": {
                      "type": "boolean"
                    },
                    "human_email": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "agent_id": "b8c7d6e5-f4a3-4b2c-9d1e-0f8a7b6c5d4e",
                  "organization_id": "a1d2c3b4-5e6f-4789-8abc-0d1e2f3a4b5c",
                  "inbox_id": "research-bot@agents.send.io",
                  "api_key": "mx_Q7kR2pLz_x8VbN3mK9tW4cY6hJ1dF5gS2",
                  "verified": false,
                  "human_email": "praveen@acme.com"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        },
        "security": []
      }
    },
    "/v0/agents/{agent_id}/verify": {
      "post": {
        "operationId": "amAgentVerify",
        "summary": "Verify an Agent",
        "description": "Unlocks the agent with the 6-digit code its human received. Call it with the API key from sign-up.\n\n- Auth: Authorization: Bearer <api_key from sign-up>.\n\n- There are two codes: the verification code for the key from the first sign-up, and a recovery code for the key from a repeat sign-up. Each has its own limits, so wrong recovery codes never affect the agent's own code or key.\n\n- Codes expire after 15 minutes. A wrong or expired code returns 400 invalid_otp. A code allows 5 checks; the 5th wrong one ends it (for a recovery code, the repeat sign-up's key is revoked too, so later calls with it get 401).\n\n- Each kind of code allows 10 checks in total, across new codes, until one is right. The 10th wrong check locks it for 24 hours: verify returns 429 with Retry-After, and no new code of that kind is sent. Asking for a new code does not reset the 10.\n\n- When called with the new key from a repeat sign-up and the recovery code, that key becomes the account's key, the old one is revoked, and the human is emailed that the key was replaced.\n\n- When a verified agent calls verify with its own key, any pending recovery is cancelled.",
        "tags": [
          "Agent Sign-up"
        ],
        "x-docs-ids": [
          "am-agent-verify"
        ],
        "parameters": [
          {
            "name": "agent_id",
            "in": "path",
            "required": true,
            "description": "The agent_id from sign-up.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "otp_code": {
                    "type": "string",
                    "description": "The 6-digit code from the email. code is accepted as an alias."
                  }
                },
                "required": [
                  "otp_code"
                ]
              },
              "example": {
                "otp_code": "482913"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "agent_id": {
                      "type": "string"
                    },
                    "verified": {
                      "type": "boolean"
                    },
                    "human_email": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "agent_id": "b8c7d6e5-f4a3-4b2c-9d1e-0f8a7b6c5d4e",
                  "verified": true,
                  "human_email": "praveen@acme.com"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/agents/{agent_id}/attach-human": {
      "post": {
        "operationId": "amAgentAttachHuman",
        "summary": "Attach a Human",
        "description": "Sets the agent's human, if sign-up had none, or re-sends the verification code to the same human. Only for agents that are not verified yet. The human cannot be changed afterwards (409): sign up a new agent instead.\n\n- Auth: Authorization: Bearer <api_key from the first sign-up>. A key from a repeat sign-up cannot call it (403).\n\n- At most 3 codes an hour and 5 a day; beyond that, or while verification is locked, it returns 429 with Retry-After and sends nothing.",
        "tags": [
          "Agent Sign-up"
        ],
        "x-docs-ids": [
          "am-agent-attach-human"
        ],
        "parameters": [
          {
            "name": "agent_id",
            "in": "path",
            "required": true,
            "description": "The agent_id from sign-up.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "human_email": {
                    "type": "string",
                    "description": "The human's email address."
                  }
                },
                "required": [
                  "human_email"
                ]
              },
              "example": {
                "human_email": "praveen@acme.com"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "agent_id": {
                      "type": "string"
                    },
                    "human_email": {
                      "type": "string"
                    },
                    "verified": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "agent_id": "b8c7d6e5-f4a3-4b2c-9d1e-0f8a7b6c5d4e",
                  "human_email": "praveen@acme.com",
                  "verified": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/agents/identity": {
      "post": {
        "operationId": "amAuthmdIdentity",
        "summary": "Register an Agent",
        "description": "Creates the account and inbox. anonymous returns an identity assertion (exchange it for a restricted key) and a claim token for later; service_auth names the human up front and starts the approval at once; identity_assertion presents an ID-JAG from a trusted agent provider and returns a full-access assertion in one step.\n\n- Limited to 5 registrations per hour per network. A User-Agent header is required. Registering a username again (even your own, with the same human) returns 409 address_taken and never replaces a pending approval.\n\n- service_auth answers without identity_assertion and with a claim object instead (user_code, verification_uri, expires_in, interval): the approval has already started and the human has been emailed.\n\n- Scopes: agent_unverified means the inbox works but outgoing email reaches only the human, and the agent cannot create keys, lists or pods. full_access is a normal key, granted after the approval.\n\n- identity_assertion: send.io checks the provider is trusted, the signature, audience, expiry, a one-time jti, the allowed client_id, a verified email and a sign-in within the last hour; the human gets an account and becomes admin, and the same human and username sign back in. 60 per hour per network.\n\n- Errors are OAuth style, {error, error_description}: address_taken (409), rate_limit_exceeded (429), and for identity_assertion invalid_issuer, invalid_signature, invalid_audience, invalid_client_id, expired, replay_detected, missing_verified_email, login_required (401 with max_age) and interaction_required (401: the email already has an account never linked to this provider; the answer carries claim_token and a claim block, and once the human approves, later assertions go straight through).",
        "tags": [
          "Agent Registration (auth.md)"
        ],
        "x-docs-ids": [
          "am-authmd-identity"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "description": "anonymous, service_auth or identity_assertion."
                  },
                  "assertion": {
                    "type": "string",
                    "description": "The ID-JAG from your agent provider, with audience https://api.send.io. Required for identity_assertion."
                  },
                  "assertion_type": {
                    "type": "string",
                    "description": "urn:ietf:params:oauth:token-type:id-jag (optional)."
                  },
                  "login_hint": {
                    "type": "string",
                    "description": "The human's email address. Required for service_auth."
                  },
                  "username": {
                    "type": "string",
                    "description": "The inbox's name before @agents.send.io. a-z, 0-9, dot, dash, underscore and plus. Default: a random agent-xxxxxxxxxx."
                  }
                },
                "required": [
                  "type"
                ]
              },
              "example": {
                "type": "anonymous",
                "username": "research-bot"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "registration_id": {
                      "type": "string"
                    },
                    "registration_type": {
                      "type": "string"
                    },
                    "inbox": {
                      "type": "string"
                    },
                    "identity_assertion": {
                      "type": "string"
                    },
                    "assertion_expires": {
                      "type": "string"
                    },
                    "pre_claim_scopes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "claim_url": {
                      "type": "string"
                    },
                    "claim_token": {
                      "type": "string"
                    },
                    "claim_token_expires": {
                      "type": "string"
                    },
                    "post_claim_scopes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": {
                  "registration_id": "b8c7d6e5-f4a3-4b2c-9d1e-0f8a7b6c5d4e",
                  "registration_type": "anonymous",
                  "inbox": "research-bot@agents.send.io",
                  "identity_assertion": "eyJhbGciOiJSUzI1NiIsInR5cCI6Im9hdXRoLWlkLWphZytqd3QiLCJraWQiOiJhaWQtMWE...",
                  "assertion_expires": "2026-10-14T09:14:22Z",
                  "pre_claim_scopes": [
                    "agent_unverified"
                  ],
                  "claim_url": "/v0/agents/identity/claim",
                  "claim_token": "3mK9tW4cY6hJ1dF5gS2Q7kR2pLz_x8VbN3mK9tW4cY6",
                  "claim_token_expires": "2026-10-14T09:14:22Z",
                  "post_claim_scopes": [
                    "full_access"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/agents/identity/claim": {
      "post": {
        "operationId": "amAuthmdClaim",
        "summary": "Start the Approval",
        "description": "Names the human for an anonymous registration and starts the approval: a 6-digit code the agent shows, and a link. send.io emails the human the same link.\n\n- The human opens the link from the email (or signs in with that address), sees the agent's inbox address and types the code. Five wrong codes end the attempt; the code and link expire after 10 minutes.\n\n- One attempt at a time per registration (409 claimed_or_in_flight). Limited to 10 per hour per network. claim_expired once the claim token is older than 7 days.",
        "tags": [
          "Agent Registration (auth.md)"
        ],
        "x-docs-ids": [
          "am-authmd-claim"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "claim_token": {
                    "type": "string",
                    "description": "The claim_token from the registration."
                  },
                  "email": {
                    "type": "string",
                    "description": "The human's email address."
                  }
                },
                "required": [
                  "claim_token",
                  "email"
                ]
              },
              "example": {
                "claim_token": "3mK9tW4cY6hJ1dF5gS2Q7kR2pLz_x8VbN3mK9tW4cY6",
                "email": "praveen@acme.com"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "registration_id": {
                      "type": "string"
                    },
                    "claim_attempt_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "expires_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "claim_attempt": {
                      "type": "object",
                      "properties": {
                        "user_code": {
                          "type": "string"
                        },
                        "expires_in": {
                          "type": "number"
                        },
                        "verification_uri": {
                          "type": "string"
                        },
                        "interval": {
                          "type": "number"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "registration_id": "b8c7d6e5-f4a3-4b2c-9d1e-0f8a7b6c5d4e",
                  "claim_attempt_id": "7c2e9a41-5b6d-4f08-a3c1-9e8d7f6a5b4c",
                  "status": "initiated",
                  "expires_at": "2026-10-07T09:24:22Z",
                  "claim_attempt": {
                    "user_code": "482913",
                    "expires_in": 600,
                    "verification_uri": "https://app.send.io/claim?attempt=pLz_x8VbN3mK9tW4cY6hJ1dF5gS2Q7kR2pLz_x8VbN3",
                    "interval": 5
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v0/token": {
      "post": {
        "operationId": "amAuthmdToken",
        "summary": "Get the API Key",
        "description": "The OAuth token endpoint (form-encoded or JSON). The jwt-bearer grant turns an identity assertion into an API key with the registration's current scope. The claim grant polls for the human's approval and then returns the full-access key plus a fresh assertion, once.\n\n- The access_token is a send.io API key: it does not expire and works for every API, the MCP server and IMAP/SMTP. Each exchange issues a new key and retires the registration's previous one.\n\n- Assertions are single use: the jwt-bearer grant consumes the assertion and its answer carries the next identity_assertion. Limited to 30 exchanges per hour per registration and 120 per hour per network.\n\n- Claim grant errors: authorization_pending (poll again after interval seconds), slow_down (polled within 5 seconds), expired_token (the attempt or the claim token expired, or the key was already handed over). invalid_grant for an unknown claim token or a bad assertion.\n\n- POST /revoke with token=<api key or identity_assertion> revokes it (RFC 7009) and always answers 200.\n\n**Exchange Code for Tokens**\n\nTrades the code for an ID token and an access token. Both are RS256 JWTs valid for 10 minutes.\n\n- Auth: client_id and client_secret by HTTP Basic (client_secret_basic) or in the body (client_secret_post); public clients send only client_id.\n\n- The body may be form-encoded (standard) or JSON.\n\n- ID token claims: sub (a stable opaque ID for the inbox), email, email_verified, name, preferred_username, owner_sub, actor_type \"agent\", plus owner_name / owner_email when granted.",
        "tags": [
          "Agent Registration (auth.md)"
        ],
        "x-docs-ids": [
          "am-authmd-token",
          "am-oidc-token"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "grant_type": {
                        "type": "string",
                        "description": "urn:ietf:params:oauth:grant-type:jwt-bearer or urn:workos:agent-auth:grant-type:claim."
                      },
                      "assertion": {
                        "type": "string",
                        "description": "The identity_assertion (jwt-bearer grant)."
                      },
                      "claim_token": {
                        "type": "string",
                        "description": "The claim token (claim grant)."
                      }
                    },
                    "required": [
                      "grant_type"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "grant_type": {
                        "type": "string",
                        "description": "Must be authorization_code."
                      },
                      "code": {
                        "type": "string",
                        "description": "The code from the redirect. Single use."
                      },
                      "redirect_uri": {
                        "type": "string",
                        "description": "The same redirect_uri used in /authorize."
                      },
                      "code_verifier": {
                        "type": "string",
                        "description": "The PKCE verifier. Required if a code_challenge was sent."
                      },
                      "client_id": {
                        "type": "string",
                        "description": "For client_secret_post or public clients. Otherwise use HTTP Basic auth."
                      },
                      "client_secret": {
                        "type": "string",
                        "description": "For client_secret_post."
                      }
                    },
                    "required": [
                      "grant_type",
                      "code",
                      "redirect_uri"
                    ]
                  }
                ]
              },
              "examples": {
                "am-authmd-token": {
                  "value": {
                    "grant_type": "urn:workos:agent-auth:grant-type:claim",
                    "claim_token": "3mK9tW4cY6hJ1dF5gS2Q7kR2pLz_x8VbN3mK9tW4cY6"
                  }
                },
                "am-oidc-token": {
                  "value": {
                    "grant_type": "authorization_code",
                    "code": "aic_P3xK8mQ2Lz7Vt4Wn9Bc",
                    "redirect_uri": "https://app.example.com/auth/callback",
                    "code_verifier": "dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "access_token": {
                      "type": "string"
                    },
                    "token_type": {
                      "type": "string"
                    },
                    "scope": {
                      "type": "string"
                    },
                    "identity_assertion": {
                      "type": "string"
                    },
                    "assertion_expires": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "access_token": "mx_Q7kR2pLz_x8VbN3mK9tW4cY6hJ1dF5gS2",
                  "token_type": "Bearer",
                  "scope": "full_access",
                  "identity_assertion": "eyJhbGciOiJSUzI1NiIsInR5cCI6Im9hdXRoLWlkLWphZytqd3QiLCJraWQiOiJhaWQtMWE...",
                  "assertion_expires": "2026-10-14T09:24:22Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/.well-known/openid-configuration": {
      "get": {
        "operationId": "amOidcDiscovery",
        "summary": "Get OpenID Configuration",
        "description": "The OpenID Connect discovery document. Point your OIDC library at the issuer https://api.send.io and it finds everything else.\n\n- Served at the site root (https://api.send.io/.well-known/openid-configuration), not under /v0. No auth.",
        "tags": [
          "AgentID (OpenID Connect)"
        ],
        "x-docs-ids": [
          "am-oidc-discovery"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "issuer": {
                      "type": "string"
                    },
                    "authorization_endpoint": {
                      "type": "string"
                    },
                    "token_endpoint": {
                      "type": "string"
                    },
                    "userinfo_endpoint": {
                      "type": "string"
                    },
                    "jwks_uri": {
                      "type": "string"
                    },
                    "registration_endpoint": {
                      "type": "string"
                    },
                    "response_types_supported": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "grant_types_supported": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "subject_types_supported": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "id_token_signing_alg_values_supported": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "scopes_supported": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "code_challenge_methods_supported": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "token_endpoint_auth_methods_supported": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "claims_supported": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": {
                  "issuer": "https://api.send.io",
                  "authorization_endpoint": "https://api.send.io/v0/authorize",
                  "token_endpoint": "https://api.send.io/v0/token",
                  "userinfo_endpoint": "https://api.send.io/v0/userinfo",
                  "jwks_uri": "https://api.send.io/v0/jwks.json",
                  "registration_endpoint": "https://api.send.io/v0/register",
                  "response_types_supported": [
                    "code"
                  ],
                  "grant_types_supported": [
                    "authorization_code"
                  ],
                  "subject_types_supported": [
                    "public"
                  ],
                  "id_token_signing_alg_values_supported": [
                    "RS256"
                  ],
                  "scopes_supported": [
                    "openid",
                    "email",
                    "profile",
                    "owner_profile",
                    "owner_email"
                  ],
                  "code_challenge_methods_supported": [
                    "S256"
                  ],
                  "token_endpoint_auth_methods_supported": [
                    "client_secret_basic",
                    "client_secret_post",
                    "none"
                  ],
                  "claims_supported": [
                    "sub",
                    "email",
                    "email_verified",
                    "name",
                    "preferred_username",
                    "actor_type",
                    "owner_sub",
                    "owner_name",
                    "owner_email",
                    "owner_email_verified"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        },
        "security": []
      }
    },
    "/v0/jwks.json": {
      "get": {
        "operationId": "amOidcJwks",
        "summary": "Get Signing Keys",
        "description": "The public keys (JWKS) that sign ID tokens and access tokens. Keys rotate every 30 days.\n\n- No auth. Cached for 5 minutes.",
        "tags": [
          "AgentID (OpenID Connect)"
        ],
        "x-docs-ids": [
          "am-oidc-jwks"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "keys": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "kty": {
                            "type": "string"
                          },
                          "use": {
                            "type": "string"
                          },
                          "alg": {
                            "type": "string"
                          },
                          "kid": {
                            "type": "string"
                          },
                          "n": {
                            "type": "string"
                          },
                          "e": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "keys": [
                    {
                      "kty": "RSA",
                      "use": "sig",
                      "alg": "RS256",
                      "kid": "k_2026_10_01",
                      "n": "u1SU1LfVLPHCozMxH2Mo4lgOEePzNm0tRgeLezV6ffAt0gunVTLw7onLRnrq0_IzW7yWR7QkrmBL7jTKEn5u-qKhbwKfBstIs-bMY2Zkp18gnTxKLxoS2tFczGkPLPgizskuemMghRniWaoLcyehkd3qqGElvW_VDL5AaWTg0nLVkjRo9z-40RQzuVaE8AkAFmxZzow3x-VJYKdjykkJ0iT9wCS0DRTXu269V264Vf_3jvredZiKRkgwlL9xNAwxXFg0x_XFw005UWVRIkdgcKWTjpBP2dPwVZ4WWC-9aGVd-Gyn1o0CLelf4rEjGoXbAAEgAqeGUxrcIlbjXfbcmw",
                      "e": "AQAB"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        },
        "security": []
      }
    },
    "/v0/register": {
      "post": {
        "operationId": "amOidcRegister",
        "summary": "Register a Client",
        "description": "Registers your app as an OpenID Connect client (dynamic client registration, RFC 7591). Returns the client_id and, unless you choose none, a client_secret.\n\n- No auth. Limited to 30 registrations per hour per network.\n\n- Clients made here are open clients: they must use PKCE (S256) and cannot ask for owner_email. Apps that need the owner's details are registered by a team in the send.io dashboard.\n\n- Errors use OAuth's shape: {error, error_description}.",
        "tags": [
          "AgentID (OpenID Connect)"
        ],
        "x-docs-ids": [
          "am-oidc-register"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "redirect_uris": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "1 to 10 callback URLs. Each must be https (http only for localhost or 127.0.0.1), with no #fragment."
                  },
                  "client_name": {
                    "type": "string",
                    "description": "Your app's name, shown on the sign-in page. At most 100 characters."
                  },
                  "token_endpoint_auth_method": {
                    "type": "string",
                    "description": "client_secret_basic (default), client_secret_post, or none for public clients without a secret."
                  }
                },
                "required": [
                  "redirect_uris"
                ]
              },
              "example": {
                "redirect_uris": [
                  "https://app.example.com/auth/callback"
                ],
                "client_name": "Example App"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "client_id": {
                      "type": "string"
                    },
                    "client_id_issued_at": {
                      "type": "number"
                    },
                    "redirect_uris": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "client_name": {
                      "type": "string"
                    },
                    "token_endpoint_auth_method": {
                      "type": "string"
                    },
                    "grant_types": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "response_types": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "client_secret": {
                      "type": "string"
                    },
                    "client_secret_expires_at": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "client_id": "aid_client_Xk29fLq0Zr7mBv4Tn1Ws",
                  "client_id_issued_at": 1791364462,
                  "redirect_uris": [
                    "https://app.example.com/auth/callback"
                  ],
                  "client_name": "Example App",
                  "token_endpoint_auth_method": "client_secret_basic",
                  "grant_types": [
                    "authorization_code"
                  ],
                  "response_types": [
                    "code"
                  ],
                  "client_secret": "aid_secret_9Qm2Lx7Rk4Vt1Zp8Nw3Hc6Jd5Fs0Gb",
                  "client_secret_expires_at": 0
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        },
        "security": []
      }
    },
    "/v0/authorize": {
      "get": {
        "operationId": "amOidcAuthorize",
        "summary": "Start a Sign-in",
        "description": "Send the user's browser here to start a sign-in. It shows a page with an auth_token; the agent approves with POST /inboxes/{inbox_id}/authorize, and the page then returns to your redirect_uri with a code.\n\n- No auth: this is a browser redirect. Normally it returns an HTML waiting page. The JSON above is returned when the request sends Accept: application/json (headless sign-in).\n\n- A sign-in expires after 5 minutes. Errors after the client and redirect_uri are checked go back to redirect_uri as error and error_description.\n\n- The agent approves with POST /inboxes/{inbox_id}/authorize {\"auth_token\": \"...\", \"accept_disclosure\": true}, using its send.io API key (see Inboxes). accept_disclosure is required when owner scopes are asked for.",
        "tags": [
          "AgentID (OpenID Connect)"
        ],
        "x-docs-ids": [
          "am-oidc-authorize"
        ],
        "parameters": [
          {
            "name": "client_id",
            "in": "query",
            "required": true,
            "description": "Your client_id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "redirect_uri",
            "in": "query",
            "required": true,
            "description": "One of your registered redirect URIs, exactly.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "response_type",
            "in": "query",
            "required": true,
            "description": "Must be code.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "scope",
            "in": "query",
            "required": true,
            "description": "Space-separated. openid is required; add email, profile, and for dashboard-registered apps owner_profile or owner_email.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "description": "Returned unchanged with the code. Use it against CSRF.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "nonce",
            "in": "query",
            "required": false,
            "description": "Copied into the ID token.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "code_challenge",
            "in": "query",
            "required": false,
            "description": "PKCE challenge: base64url(SHA-256(code_verifier)). Required for open clients.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "code_challenge_method",
            "in": "query",
            "required": false,
            "description": "Must be S256 when code_challenge is set.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "login_hint",
            "in": "query",
            "required": false,
            "description": "The agent's inbox address, if you know it. Only that inbox can approve.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "transaction_id": {
                      "type": "string"
                    },
                    "auth_token": {
                      "type": "string"
                    },
                    "browser_secret": {
                      "type": "string"
                    },
                    "expires_in": {
                      "type": "number"
                    },
                    "approve_url": {
                      "type": "string"
                    },
                    "status_url": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "transaction_id": "atx_Lq8Zr2Xk0mBv4Tn1Ws7Fh3Jc",
                  "auth_token": "aid_R7kM2pQx9LzV4tW8nB3cY6hJ1dF5gS0a",
                  "browser_secret": "Tn1Ws7Fh3JcLq8Zr2Xk0mBv4Rp6Yd9Ge",
                  "expires_in": 300,
                  "approve_url": "https://api.send.io/v0/inboxes/{inbox_id}/authorize",
                  "status_url": "https://api.send.io/v0/authorize/status?txn=atx_Lq8Zr2Xk0mBv4Tn1Ws7Fh3Jc"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        },
        "security": []
      }
    },
    "/v0/authorize/status": {
      "get": {
        "operationId": "amOidcAuthorizeStatus",
        "summary": "Get Sign-in Status",
        "description": "Polls a sign-in. Once the agent approves, the first poll returns redirect_to: your redirect_uri with a one-time code, state and iss.\n\n- No API key: do not send your send.io key. The sign-in is proved by the browser's cookie set by /authorize, or an X-Browser-Secret header with the browser_secret for headless callers.\n\n- A missing or malformed txn is a 422. An unknown txn, or a wrong or missing browser secret, is a 404 (the sign-in is never confirmed to anyone without its secret).\n\n- status is pending, approved, expired or completed (the code was already handed out). The code is valid for 60 seconds.",
        "tags": [
          "AgentID (OpenID Connect)"
        ],
        "x-docs-ids": [
          "am-oidc-authorize-status"
        ],
        "parameters": [
          {
            "name": "txn",
            "in": "query",
            "required": true,
            "description": "The transaction_id from Start a Sign-in.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "redirect_to": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "status": "approved",
                  "redirect_to": "https://app.example.com/auth/callback?code=aic_P3xK8mQ2Lz7Vt4Wn9Bc&iss=https%3A%2F%2Fapi.send.io&state=xyz"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        },
        "security": []
      }
    },
    "/v0/userinfo": {
      "get": {
        "operationId": "amOidcUserinfo",
        "summary": "Get User Info",
        "description": "Returns the signed-in agent's claims for an access token.\n\n- Auth: Authorization: Bearer <access_token from /token> (not a send.io API key).\n\n- POST works too.",
        "tags": [
          "AgentID (OpenID Connect)"
        ],
        "x-docs-ids": [
          "am-oidc-userinfo"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sub": {
                      "type": "string"
                    },
                    "actor_type": {
                      "type": "string"
                    },
                    "email": {
                      "type": "string"
                    },
                    "email_verified": {
                      "type": "boolean"
                    },
                    "name": {
                      "type": "string"
                    },
                    "preferred_username": {
                      "type": "string"
                    },
                    "owner_sub": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "sub": "q3V9xN2kLm8Rt5Wb7Yc1Zd4Fg6Hj0Kp2Ls9Mn3Qr5Tv",
                  "actor_type": "agent",
                  "email": "research-bot@agents.send.io",
                  "email_verified": true,
                  "name": "Research Bot",
                  "preferred_username": "research-bot",
                  "owner_sub": "Hj0Kp2Ls9Mn3Qr5Tvq3V9xN2kLm8Rt5Wb7Yc1Zd4Fg6"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "mx_ API key",
        "description": "Your send.io API key (mx_...) as a bearer token."
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "statusCode",
          "name",
          "message"
        ],
        "properties": {
          "statusCode": {
            "type": "integer",
            "description": "The HTTP status code."
          },
          "name": {
            "type": "string",
            "description": "A stable error code, such as validation_error or not_found."
          },
          "message": {
            "type": "string",
            "description": "What went wrong, in plain words."
          }
        },
        "example": {
          "statusCode": 422,
          "name": "validation_error",
          "message": "The `to` field is required."
        }
      }
    },
    "responses": {
      "E400": {
        "description": "Bad request: invalid_idempotency_key (the Idempotency-Key header is empty or longer than 256 characters), or a malformed sign-up or OAuth request.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "E401": {
        "description": "Missing, invalid or restricted API key: missing_api_key, invalid_api_key, or restricted_api_key (a sending-only key, or an app connected with sending access, used for anything but sending; an agent inbox key outside its inbox).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "E402": {
        "description": "insufficient_credits: the credit balance is too low (buy credits in Billing).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "E403": {
        "description": "Not allowed: validation_error (for example sending from a domain that is not verified), invalid_permission (a key limited to another domain, or an action that needs an Admin) or missing_permission (a key whose permission list does not include this action).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "E404": {
        "description": "Not found.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "E409": {
        "description": "Conflict. With an Idempotency-Key: concurrent_idempotent_requests (a request with the same key has not finished; retry later) or invalid_idempotent_request (the key was used in the last 24 hours with a different body). Otherwise the request conflicts with the resource's current state, for example it already exists, changed since you read it, or is no longer in a state that allows this; the operation's description says when.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "E422": {
        "description": "Validation error: invalid_parameter (a parameter has the wrong type or format, such as a malformed id), missing_required_field, or validation_error.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "E429": {
        "description": "Rate limited (10 requests per second per team).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    }
  },
  "x-tagGroups": [
    {
      "name": "Email",
      "tags": [
        "Emails",
        "Receiving emails",
        "Inbound routes",
        "Domains",
        "API keys",
        "OAuth grants",
        "Subaccounts",
        "Webhooks",
        "Senders",
        "Streams",
        "Suppressions",
        "Templates"
      ]
    },
    {
      "name": "Marketing",
      "tags": [
        "Contacts",
        "Audiences",
        "Segments",
        "Topics",
        "Contact properties",
        "Broadcasts",
        "Unsubscribe page"
      ]
    },
    {
      "name": "Platform",
      "tags": [
        "Transactional emails",
        "Automations",
        "Events",
        "Mailboxes",
        "Inboxes",
        "Inbox drafts",
        "Inbox lists",
        "Inbox threads",
        "Pods",
        "Agent domain and AgentID",
        "API logs",
        "Assets",
        "MCP",
        "Billing",
        "Sending reputation"
      ]
    },
    {
      "name": "Agent inboxes",
      "tags": [
        "Inboxes (Agent inboxes)",
        "Messages",
        "Threads",
        "Drafts",
        "Inbox lists (Agent inboxes)",
        "Inbox webhooks",
        "Inbox API keys",
        "Inbox metrics",
        "Pods (Agent inboxes)",
        "Pod Inboxes",
        "Pod Threads",
        "Pod Drafts",
        "Pod Lists",
        "Pod Webhooks",
        "Pod Domains",
        "Pod Metrics",
        "Pod API Keys",
        "Domains (Agent inboxes)",
        "Webhooks (Agent inboxes)",
        "Lists",
        "Metrics",
        "API Keys",
        "Organization",
        "Agent Sign-up",
        "Agent Registration (auth.md)",
        "AgentID (OpenID Connect)"
      ]
    }
  ]
}
