Postfleet Send API

Direct outbound send with idempotency.

GitHub OpenAPI

Operations 1

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/postfleet-ai:postfleet-ai-send-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

postfleet-ai-send-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Postfleet Send API
  version: 1.0.0
  description: Hand-authored OpenAPI description of the Postfleet `/api/v1/**` REST surface. Every path, method, status code, request field, and error `code` is transcribed from the shipped route handlers under `src/app/api/v1/`; a drift test asserts this file stays in sync with the code. All endpoints authenticate with a bearer `pf_` API key. This spec documents shipped behavior only — see the `/docs` pages for narrative guides and current limitations.
servers:
- url: /
  description: Same-origin (relative). Prefix every path with your deployment origin, e.g. https://your-app.example.com
security:
- bearerAuth: []
tags:
- name: Send
  description: Direct outbound send with idempotency.
paths:
  /api/v1/send:
    post:
      operationId: sendMessage
      tags:
      - Send
      summary: Send an email
      description: The single outbound path for direct and MCP sends. Requires an `api` or `mcp` key with `can_send`. Supply an optional `client_id` for idempotent duplicate protection (replay table). On a mailbox with `require_approval` enabled, the send is turned into a forced draft (`202`) instead of delivering. `to` is one address or an array of up to 10; a string that contains a comma is rejected `400` rather than split. Optional `html` is sent with the required text part, and is rejected on a mailbox that requires approval.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendRequest'
      responses:
        '200':
          description: 'Idempotent replay: this `client_id` was already used with the same payload for a completed send; the stored result is returned verbatim.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SendResult'
        '201':
          description: Sent.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SendResult'
        '202':
          description: Mailbox requires approval — the send was queued as a forced draft awaiting a human.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PendingApproval'
        '400':
          description: Validation error (missing `mailbox_id`/`text`, bad `client_id`, `to` not a single address or more than 10 addresses, missing `to` when not replying, `html` on an approval mailbox) or a permanent provider rejection (`{retryable:false}`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          description: Monthly send quota exhausted (terminal for this `client_id`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MonthlySendLimitError'
              example:
                code: monthly_send_limit
                error: monthly send quota exhausted
        '403':
          description: Key cannot send / is scoped to a different mailbox (`code:key_scope`), recipient blocked by a send list (`code:send_blocked_by_list`), account sending is held (`code:sending_held` or `code:account_send_held`; owner review required), or a custom-domain entitlement rejection.
          content:
            application/json:
              schema:
                oneOf:
                - $ref: '#/components/schemas/KeyScopeError'
                - $ref: '#/components/schemas/SendBlockedByListError'
                - $ref: '#/components/schemas/SendingHeldError'
                - $ref: '#/components/schemas/AccountSendHeldError'
                - $ref: '#/components/schemas/Error'
        '404':
          description: Mailbox not found, or (when replying) the original message was not found / not visible to a mailbox-bound key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: 'Idempotency conflict: same `client_id` with a different payload (`idempotency_conflict`), or a send with this `client_id` is still in progress (`idempotency_in_progress`).'
          content:
            application/json:
              schema:
                oneOf:
                - $ref: '#/components/schemas/IdempotencyConflictError'
                - $ref: '#/components/schemas/IdempotencyInProgressError'
        '422':
          description: Recipient is suppressed (bounce/complaint/unsubscribe).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: recipient is suppressed (bounce/complaint/unsubscribe)
        '429':
          description: Free-account daily send or distinct-recipient limit reached.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SendRateLimitError'
        '502':
          description: Transient delivery failure (`{retryable:true}`) or an ambiguous provider outcome (`code:delivery_outcome_unknown`) — the send may or may not have gone out and is left for reconciliation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeliveryError'
        '503':
          description: No message was delivered. Screening unavailable requires a new client_id; sending_cleanup_pending retries cleanup with the same client_id.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SendingSafetyUnavailableError'
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
      required:
      - error
      additionalProperties: false
    IdempotencyConflictError:
      type: object
      properties:
        code:
          type: string
          const: idempotency_conflict
        error:
          type: string
      required:
      - code
      - error
      additionalProperties: false
    SendingSafetyUnavailableError:
      type: object
      properties:
        code:
          type: string
          enum:
          - sending_safety_unavailable
          - sending_cleanup_pending
        error:
          type: string
        retryable:
          type: boolean
          const: true
      required:
      - code
      - error
      - retryable
      additionalProperties: false
    SendRateLimitError:
      type: object
      properties:
        error:
          type: string
        code:
          type: string
          enum:
          - recipient_limit
          - daily_send_limit
      required:
      - error
      - code
      additionalProperties: false
    KeyScopeError:
      type: object
      properties:
        error:
          type: string
        code:
          type: string
          const: key_scope
      required:
      - error
      - code
      additionalProperties: false
    SendBlockedByListError:
      type: object
      properties:
        code:
          type: string
          const: send_blocked_by_list
        reason:
          type: string
          enum:
          - block_match
          - no_allow_match
        scope:
          type: string
          enum:
          - account
          - mailbox
        list_entry_id:
          description: The matched block entry (present only on `block_match`).
          type: string
      required:
      - code
      - reason
      - scope
      additionalProperties: false
    PendingApproval:
      type: object
      properties:
        draft_id:
          type: string
        status:
          type: string
          const: pending_approval
      required:
      - draft_id
      - status
      additionalProperties: false
    IdempotencyInProgressError:
      type: object
      properties:
        code:
          type: string
          const: idempotency_in_progress
        error:
          type: string
      required:
      - code
      - error
      additionalProperties: false
    SendingHeldError:
      type: object
      properties:
        code:
          type: string
          const: sending_held
        error:
          type: string
        reason:
          type: string
          enum:
          - burst_limit
          - hourly_limit
          - spam_complaint
          - hard_bounces
          - owner_pause
          - bounce_rate
          - manual_review
          - legacy_hold
          - suspicious_content
        hold_id:
          type: string
          format: uuid
          pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        retryable:
          type: boolean
          const: false
      required:
      - code
      - error
      - reason
      - hold_id
      - retryable
      additionalProperties: false
    SendResult:
      type: object
      properties:
        id:
          type: string
          description: Stored message id.
        thread_id:
          type: string
        provider_message_id:
          type: string
      required:
      - id
      - thread_id
      - provider_message_id
      additionalProperties: false
    MonthlySendLimitError:
      type: object
      properties:
        error:
          type: string
        code:
          type: string
          const: monthly_send_limit
      required:
      - error
      - code
      additionalProperties: false
    SendRequest:
      type: object
      properties:
        mailbox_id:
          type: string
          minLength: 1
          description: Mailbox to send from. A mailbox-bound key must match this.
        text:
          type: string
          minLength: 1
          description: Plain-text body. Required even when html is set.
        html:
          description: Optional HTML body sent with the text part. Not accepted on drafts or on mailboxes that require approval.
          type: string
          maxLength: 100000
        to:
          description: One address, or an array of up to 10. A string must be exactly one address (commas are rejected). Required unless replying.
          anyOf:
          - type: string
          - minItems: 1
            maxItems: 10
            type: array
            items:
              type: string
              minLength: 1
        subject:
          type: string
        reply_to_message_id:
          description: Reply in-thread to an existing message; resolves `to`/`subject`/thread from the original.
          type: string
        client_id:
          description: Idempotency key for duplicate protection. Must not start with `draft:` (reserved).
          type: string
          minLength: 1
          maxLength: 256
          pattern: ^(?!draft:)
        attachments:
          description: Optional files to attach. Each item is exactly one of base64 `content` or an HTTPS `url` (fetched at send time). Filename and content_type are optional. At most 20 files; 6 MB total inline, 30 MB total URL-backed. Bytes are not echoed on draft reads.
          maxItems: 20
          type: array
          items:
            anyOf:
            - type: object
              properties:
                filename:
                  description: Basename only — no path separators. Derived from the URL path, or `attachment`, when omitted.
                  type: string
                  minLength: 1
                  maxLength: 255
                  pattern: ^[^/\0\\]+$
                content:
                  type: string
                  minLength: 1
                  description: File bytes, standard base64.
                content_type:
                  description: MIME type. Defaults to application/octet-stream, or the URL response Content-Type.
                  type: string
                  maxLength: 127
                  pattern: ^[a-zA-Z0-9][a-zA-Z0-9!#$&^_.+-]*\/[a-zA-Z0-9][a-zA-Z0-9!#$&^_.+-]*$
              required:
              - content
              additionalProperties: false
            - type: object
              properties:
                filename:
                  description: Basename only — no path separators. Derived from the URL path, or `attachment`, when omitted.
                  type: string
                  minLength: 1
                  maxLength: 255
                  pattern: ^[^/\0\\]+$
                url:
                  type: string
                  minLength: 1
                  maxLength: 2048
                  description: HTTPS URL fetched at send time. Not forwarded to the provider.
                content_type:
                  description: MIME type. Defaults to application/octet-stream, or the URL response Content-Type.
                  type: string
                  maxLength: 127
                  pattern: ^[a-zA-Z0-9][a-zA-Z0-9!#$&^_.+-]*\/[a-zA-Z0-9][a-zA-Z0-9!#$&^_.+-]*$
              required:
              - url
              additionalProperties: false
      required:
      - mailbox_id
      - text
      additionalProperties: false
    AccountSendHeldError:
      type: object
      properties:
        error:
          type: string
        code:
          type: string
          const: account_send_held
      required:
      - error
      - code
      additionalProperties: false
    DeliveryError:
      type: object
      properties:
        error:
          type: string
        retryable:
          type: boolean
        code:
          description: Present only on an ambiguous provider outcome.
          type: string
          const: delivery_outcome_unknown
      required:
      - error
      - retryable
      additionalProperties: false
  responses:
    Unauthorized:
      description: Missing or invalid bearer token, or a key whose scope is not permitted for this endpoint.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'A Postfleet API key, e.g. `Authorization: Bearer pf_...`. Keys carry a scope (`api`/`mcp`/`bootstrap`), optional mailbox binding, and `can_read`/`can_send` capabilities.'