SuperMailOS Sending API

The Sending API from SuperMailOS — 3 operation(s) for sending.

GitHub OpenAPI

Operations 3

POST /api/v1/threads/{id}/reply Reply to a thread #
POST /api/v1/threads/{id}/draft Draft a reply #
POST /api/v1/send Send an email #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/supermailos-com:supermailos-com-sending-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

supermailos-com-sending-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: SuperMailOS Sending API
  version: 1.3.0
  description: 'The SuperMailOS API lets your code and AI agents read, search, organize and send

    business email from your workspace''s real mailboxes — the same mail, rules and

    guardrails as the web app. ## Authentication

    Create a key in **Settings → Developers → API keys** (workspace admins). Keys look

    like `smk_…`, are shown once, and are sent as `Authorization: Bearer `. Prefer calling from a server; never ship a key in public client code. A key acts for the person who created it and reaches exactly the mailboxes they

    can open in the app: owners and admins reach every mailbox in the workspace; a

    member reaches their own mailboxes plus mailboxes shared with them (view-only,

    view-and-send, or full access). Anything else — another workspace, a teammate''s

    unshared mailbox — is reported as `404`, never as forbidden. Access follows the

    person''s current role, and a key stops working (`401`) once its creator leaves

    the workspace. ## Scopes

    | Scope | Allows |

    |---|---|

    | `read` | mailboxes, threads, messages, attachments, search |

    | `send` | `POST /send`, `POST /threads/{id}/reply` |

    | `write` | `PATCH /threads/{id}` (read/unread, star, move, archive, labels), `POST /threads/{id}/draft`, managing agent inboxes, their keys and held mail, rejecting an agent''s email — never sends |

    | `send` (also) | approving an agent''s waiting email (`POST /approvals/{id}/approve`) |


    A request without the needed scope gets `403` with code `missing_scope`. ## Rate limits

    120 requests per minute per key and 60 per minute per IP, then a

    one-minute cooldown. Responses carry `X-RateLimit-Limit` / `X-RateLimit-Remaining`;

    a `429` carries `Retry-After` (seconds). Sending has its own per-mailbox and

    per-workspace hourly limits and new-domain warm-up caps (also `429`). ## Idempotency

    Send an `Idempotency-Key` header (any 1–255 printable ASCII characters — a UUID

    is ideal) on `POST /send` and `POST /threads/{id}/reply`. Keys are scoped to your

    API key and kept for 24 hours:

    - same key + same body → the original response is replayed (same status and

    JSON, plus `Idempotency-Replayed: true`); nothing is sent again;

    - same key + a different body → `422` `idempotency_key_reused`;

    - same key while the first request is still running → `409` `idempotency_in_progress`. Only successful responses are stored: a refused request sent nothing, so you may

    fix it and retry with the same key. Always retry sends with the key you first used. ## Errors

    Errors are JSON: `{ "error": "", "code": "" }`. `error` is for

    humans and may change; `code` is stable: `bad_request`, `unauthorized`, `missing_scope`, `forbidden`, `not_found`, `conflict`, `idempotency_in_progress`, `idempotency_key_reused`, `payload_too_large`, `unprocessable`, `locked`, `rate_limited`, `insufficient_storage`, `server_error`, `upstream_failed`, `limit_reached`. A `503` `server_error` with `Retry-After` means the service is briefly unavailable:

    retry, and keep the key — only `401` says it is invalid. ## Pagination

    List endpoints return `nextCursor`; pass it back as `?cursor=` for the next page

    (`null` on the last page). `limit` is 1–100 (default 25). ## Privacy

    Bcc recipients appear only to the person who sent the message or was themselves

    Bcc''d — the same rule as the app. Reading a thread over the API never marks it

    read; `PATCH` it to change state. ## Ids

    Thread, message and attachment ids are opaque strings. A message''s `id` is the

    same value webhooks send as `emailId`; `messageId` is the RFC 5322 Message-ID. ## Agent inboxes

    Give an AI agent its own inbox on your domain (`POST /inboxes`), with a person who

    sponsors it and guardrails on by default. Its id is its mailbox id, so every mail

    endpoint above works with it. An **agent key** (`POST /inboxes/{id}/keys`, or

    `createKey` on create) reaches that one inbox and nothing else.'
  contact:
    name: SuperMailOS
    url: https://supermailos.com/contact
servers:
- url: https://supermailos.com
  description: Production
security:
- bearerAuth: []
tags:
- name: Sending
paths:
  /api/v1/threads/{id}/reply:
    post:
      operationId: replyToThread
      tags:
      - Sending
      summary: Reply to a thread
      description: Reply or reply-all, threaded with In-Reply-To/References, through the same send pipeline as the app (verified domain, suppression list, rate limits, warm-up, storage quota). Supports Idempotency-Key.
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
        description: Thread id.
      - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReplyRequest'
      responses:
        '202':
          description: Accepted for delivery (or a replayed earlier response).
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            Idempotency-Replayed:
              $ref: '#/components/headers/Idempotency-Replayed'
          content:
            application/json:
              schema:
                oneOf:
                - $ref: '#/components/schemas/SendResponse'
                - $ref: '#/components/schemas/PendingSendResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '413':
          $ref: '#/components/responses/PayloadTooLarge'
        '422':
          $ref: '#/components/responses/Unprocessable'
        '423':
          $ref: '#/components/responses/Locked'
        '429':
          $ref: '#/components/responses/RateLimited'
        '502':
          $ref: '#/components/responses/UpstreamFailed'
        '507':
          $ref: '#/components/responses/InsufficientStorage'
      security:
      - bearerAuth: []
      x-required-scope: send
      x-codeSamples:
      - lang: curl
        label: curl
        source: "curl -X POST \"https://supermailos.com/api/v1/threads/THREAD_ID/reply\" \\\n  -H \"Authorization: Bearer $SUPERMAILOS_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Idempotency-Key: $(uuidgen)\" \\\n  -d '{\"text\":\"Thanks — received, I'\\''ll get back to you today.\",\"replyAll\":false}'"
      - lang: TypeScript
        label: TypeScript
        source: "const res = await fetch(\"https://supermailos.com/api/v1/threads/THREAD_ID/reply\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.SUPERMAILOS_API_KEY}`,\n    \"Content-Type\": \"application/json\",\n    // Reuse the same key when retrying this send; never mails twice.\n    \"Idempotency-Key\": crypto.randomUUID(),\n  },\n  body: JSON.stringify({\n    \"text\": \"Thanks — received, I'll get back to you today.\",\n    \"replyAll\": false\n  }),\n});\nif (!res.ok) throw new Error(`${res.status}: ${(await res.json()).error}`);\nconst data = await res.json();"
      - lang: Python
        label: Python
        source: "import os, uuid\nimport requests\n\nres = requests.post(\n    \"https://supermailos.com/api/v1/threads/THREAD_ID/reply\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['SUPERMAILOS_API_KEY']}\",\n        \"Idempotency-Key\": str(uuid.uuid4()),  # reuse it on retries\n    },\n    json={\n        \"text\": \"Thanks — received, I'll get back to you today.\",\n        \"replyAll\": False,\n    },\n    timeout=30,\n)\nres.raise_for_status()\ndata = res.json()"
  /api/v1/threads/{id}/draft:
    post:
      operationId: draftReply
      tags:
      - Sending
      summary: Draft a reply
      description: Save a reply as a draft in the conversation's mailbox for a person to review and send from the app. Nothing is sent.
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
        description: Thread id.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReplyRequest'
      responses:
        '201':
          description: Draft saved.
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DraftResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '413':
          $ref: '#/components/responses/PayloadTooLarge'
        '422':
          $ref: '#/components/responses/Unprocessable'
        '429':
          $ref: '#/components/responses/RateLimited'
      security:
      - bearerAuth: []
      x-required-scope: write
      x-codeSamples:
      - lang: curl
        label: curl
        source: "curl -X POST \"https://supermailos.com/api/v1/threads/THREAD_ID/draft\" \\\n  -H \"Authorization: Bearer $SUPERMAILOS_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"text\":\"Draft for review: thanks, we can do Thursday at 10.\",\"replyAll\":true}'"
      - lang: TypeScript
        label: TypeScript
        source: "const res = await fetch(\"https://supermailos.com/api/v1/threads/THREAD_ID/draft\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.SUPERMAILOS_API_KEY}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"text\": \"Draft for review: thanks, we can do Thursday at 10.\",\n    \"replyAll\": true\n  }),\n});\nif (!res.ok) throw new Error(`${res.status}: ${(await res.json()).error}`);\nconst data = await res.json();"
      - lang: Python
        label: Python
        source: "import os\nimport requests\n\nres = requests.post(\n    \"https://supermailos.com/api/v1/threads/THREAD_ID/draft\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['SUPERMAILOS_API_KEY']}\",\n    },\n    json={\n        \"text\": \"Draft for review: thanks, we can do Thursday at 10.\",\n        \"replyAll\": True,\n    },\n    timeout=30,\n)\nres.raise_for_status()\ndata = res.json()"
  /api/v1/send:
    post:
      operationId: sendEmail
      tags:
      - Sending
      summary: Send an email
      description: 'Send a new message as one of your mailboxes. Every guardrail of the app applies: verified domain, suppression list, per-mailbox/workspace hourly limits, new-domain warm-up, storage quota. Supports Idempotency-Key.'
      parameters:
      - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendRequest'
      responses:
        '202':
          description: Accepted for delivery (or a replayed earlier response).
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            Idempotency-Replayed:
              $ref: '#/components/headers/Idempotency-Replayed'
          content:
            application/json:
              schema:
                oneOf:
                - $ref: '#/components/schemas/SendResponse'
                - $ref: '#/components/schemas/PendingSendResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '413':
          $ref: '#/components/responses/PayloadTooLarge'
        '422':
          $ref: '#/components/responses/Unprocessable'
        '423':
          $ref: '#/components/responses/Locked'
        '429':
          $ref: '#/components/responses/RateLimited'
        '502':
          $ref: '#/components/responses/UpstreamFailed'
        '507':
          $ref: '#/components/responses/InsufficientStorage'
      security:
      - bearerAuth: []
      x-required-scope: send
      x-codeSamples:
      - lang: curl
        label: curl
        source: "curl -X POST \"https://supermailos.com/api/v1/send\" \\\n  -H \"Authorization: Bearer $SUPERMAILOS_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Idempotency-Key: $(uuidgen)\" \\\n  -d '{\"from\":\"you@acme.com\",\"to\":\"client@example.com\",\"subject\":\"Your invoice\",\"text\":\"Hi — your invoice is attached in the portal. Thanks!\"}'"
      - lang: TypeScript
        label: TypeScript
        source: "const res = await fetch(\"https://supermailos.com/api/v1/send\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.SUPERMAILOS_API_KEY}`,\n    \"Content-Type\": \"application/json\",\n    // Reuse the same key when retrying this send; never mails twice.\n    \"Idempotency-Key\": crypto.randomUUID(),\n  },\n  body: JSON.stringify({\n    \"from\": \"you@acme.com\",\n    \"to\": \"client@example.com\",\n    \"subject\": \"Your invoice\",\n    \"text\": \"Hi — your invoice is attached in the portal. Thanks!\"\n  }),\n});\nif (!res.ok) throw new Error(`${res.status}: ${(await res.json()).error}`);\nconst data = await res.json();"
      - lang: Python
        label: Python
        source: "import os, uuid\nimport requests\n\nres = requests.post(\n    \"https://supermailos.com/api/v1/send\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['SUPERMAILOS_API_KEY']}\",\n        \"Idempotency-Key\": str(uuid.uuid4()),  # reuse it on retries\n    },\n    json={\n        \"from\": \"you@acme.com\",\n        \"to\": \"client@example.com\",\n        \"subject\": \"Your invoice\",\n        \"text\": \"Hi — your invoice is attached in the portal. Thanks!\",\n    },\n    timeout=30,\n)\nres.raise_for_status()\ndata = res.json()"
components:
  responses:
    Unauthorized:
      description: Missing, invalid or revoked API key.
      headers: {}
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    BadRequest:
      description: The request is malformed.
      headers: {}
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    InsufficientStorage:
      description: The mailbox is out of storage.
      headers: {}
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: The key lacks the scope (`missing_scope`) or the access (`forbidden`).
      headers: {}
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Locked:
      description: Sending is paused for this mailbox or workspace.
      headers: {}
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    PayloadTooLarge:
      description: Body over 1 MB.
      headers: {}
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    RateLimited:
      description: Too many requests.
      headers:
        Retry-After:
          $ref: '#/components/headers/Retry-After'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Conflict:
      description: A request with this Idempotency-Key is still in progress.
      headers: {}
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    UpstreamFailed:
      description: The mail server didn't accept the message; nothing was sent. Safe to retry.
      headers: {}
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Not found — or not reachable with this key.
      headers: {}
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unprocessable:
      description: Valid JSON the server can't act on (e.g. unverified domain, suppressed recipient, reused Idempotency-Key).
      headers: {}
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  headers:
    Retry-After:
      description: Seconds to wait before retrying.
      schema:
        type: integer
    Idempotency-Replayed:
      description: '`true` when this is a stored response replayed for a repeated Idempotency-Key.'
      schema:
        type: string
    X-RateLimit-Limit:
      description: Requests allowed per minute for this key.
      schema:
        type: integer
    X-RateLimit-Remaining:
      description: Requests left in the current minute.
      schema:
        type: integer
  schemas:
    SendResponse:
      type: object
      required:
      - ok
      - id
      - messageId
      - emailId
      - threadId
      - mailboxId
      - from
      properties:
        ok:
          type: boolean
          const: true
        status:
          type: string
          const: sent
          description: Present on sends from an agent inbox.
        id:
          type: string
          description: RFC Message-ID (kept for compatibility; same as `messageId`).
        messageId:
          type: string
          description: RFC 5322 Message-ID of the sent message.
        emailId:
          type:
          - string
          - 'null'
          description: Internal id of the stored Sent copy.
        threadId:
          type: string
        mailboxId:
          type: string
        from:
          type: string
          format: email
    ReplyRequest:
      type: object
      properties:
        text:
          type: string
          description: '`text` or `html` is required.'
        html:
          type: string
        replyAll:
          type: boolean
          default: false
          description: Reply to everyone on the last message (To + Cc).
        from:
          type: string
          format: email
          description: 'The conversation''s mailbox or one of its aliases. Default: the address the mail arrived on.'
        to:
          oneOf:
          - type: string
          - type: array
            items:
              type: string
          description: Override the computed recipients.
        cc:
          oneOf:
          - type: string
          - type: array
            items:
              type: string
          description: Added to the computed Cc.
        bcc:
          oneOf:
          - type: string
          - type: array
            items:
              type: string
        subject:
          type: string
          description: 'Default: `Re: <subject>`.'
        quote:
          type: boolean
          default: false
          description: Append the previous message, quoted.
        idempotencyKey:
          type: string
          description: Alternative to the Idempotency-Key header (/reply only).
    Error:
      type: object
      required:
      - error
      - code
      properties:
        error:
          type: string
          description: Human-readable message.
        code:
          type: string
          description: Stable machine-readable code.
          enum:
          - bad_request
          - unauthorized
          - missing_scope
          - forbidden
          - not_found
          - conflict
          - idempotency_in_progress
          - idempotency_key_reused
          - payload_too_large
          - unprocessable
          - locked
          - rate_limited
          - insufficient_storage
          - server_error
          - upstream_failed
          - limit_reached
    PendingSendResponse:
      type: object
      description: An agent inbox's email that waits for a person; nothing was sent yet.
      required:
      - ok
      - status
      - approvalId
      - reasons
      - expiresAt
      - mailboxId
      - from
      properties:
        ok:
          type: boolean
          const: true
        status:
          type: string
          const: pending_approval
        approvalId:
          type: string
          description: '`GET /approvals/{approvalId}` for what became of it.'
        reasons:
          type: array
          items:
            type: string
          description: Why it waits, in plain words.
        expiresAt:
          type: string
          format: date-time
        mailboxId:
          type: string
        from:
          type: string
          format: email
    DraftResponse:
      type: object
      required:
      - ok
      - draftId
      - replyToThreadId
      - from
      - to
      - subject
      properties:
        ok:
          type: boolean
          const: true
        draftId:
          type: string
          description: The draft conversation's id (folder `drafts`).
        replyToThreadId:
          type: string
        from:
          type: string
        to:
          type: string
        cc:
          type:
          - string
          - 'null'
        subject:
          type: string
    SendRequest:
      type: object
      required:
      - from
      - to
      properties:
        from:
          type: string
          format: email
          description: A mailbox (not an alias) the key can send as.
        to:
          oneOf:
          - type: string
          - type: array
            items:
              type: string
          description: Comma-separated string or array of addresses.
        cc:
          oneOf:
          - type: string
          - type: array
            items:
              type: string
        bcc:
          oneOf:
          - type: string
          - type: array
            items:
              type: string
        subject:
          type: string
        text:
          type: string
          description: Plain-text body. `text` or `html` is required; together at most 1 MB.
        html:
          type: string
          description: 'HTML body (scripts, handlers and javascript: URLs are stripped).'
        idempotencyKey:
          type: string
          description: Alternative to the Idempotency-Key header.
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      schema:
        type: string
        minLength: 1
        maxLength: 255
      description: Makes the request safe to retry for 24 hours (see Idempotency).
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: smk_…
      description: A workspace API key from Settings → Developers → API keys.
externalDocs:
  description: Quick reference (agent skill)
  url: https://supermailos.com/.well-known/agent-skills/supermailos/SKILL.md