Postfleet Messages API

Read inbound/outbound messages.

GitHub OpenAPI

Operations 2

GET /api/v1/messages List messages in a mailbox #
GET /api/v1/messages/{id} Get a message #

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-messages-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-messages-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Postfleet Messages 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: Messages
  description: Read inbound/outbound messages.
paths:
  /api/v1/messages:
    get:
      operationId: listMessages
      tags:
      - Messages
      summary: List messages in a mailbox
      description: Lists messages for a mailbox, newest first, with an opaque `cursor`. `since` and `until` bound `created_at`, `q` matches subject, addresses, and cleaned body, and `thread_id` is exact. Requires an `api` or `mcp` key with `can_read`.
      parameters:
      - name: mailbox_id
        in: query
        required: true
        schema:
          type: string
        description: Mailbox to list. A mailbox-bound key may only list its own mailbox.
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          minimum: 1
          default: 50
        description: Max rows (integer ≥ 1). Values above 100 are clamped to 100. Pass `next_cursor` to read the following page.
      - name: cursor
        in: query
        required: false
        schema:
          type: string
        description: Opaque cursor from the previous page `next_cursor`.
      - name: since
        in: query
        required: false
        schema:
          type: string
          format: date-time
        description: Include messages created at or after this ISO-8601 timestamp.
      - name: until
        in: query
        required: false
        schema:
          type: string
          format: date-time
        description: Include messages created before this ISO-8601 timestamp.
      - name: q
        in: query
        required: false
        schema:
          type: string
          maxLength: 200
        description: Case-insensitive match on subject, from, to, and cleaned body.
      - name: thread_id
        in: query
        required: false
        schema:
          type: string
        description: Exact thread id.
      responses:
        '200':
          description: Messages.
          content:
            application/json:
              schema:
                type: object
                properties:
                  messages:
                    type: array
                    items:
                      $ref: '#/components/schemas/MessageListItem'
                  next_cursor:
                    anyOf:
                    - type: string
                    - type: 'null'
                    description: Pass as cursor to read the next page. Null when this page is the last.
                required:
                - messages
                - next_cursor
                additionalProperties: false
        '400':
          description: '`mailbox_id` query param required, or `cursor` / `since` / `until` / `q` is invalid.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Key cannot read messages, or is scoped to a different mailbox (`code:key_scope`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KeyScopeError'
  /api/v1/messages/{id}:
    get:
      operationId: getMessage
      tags:
      - Messages
      summary: Get a message
      description: Returns a single message with body, comprehension, and attachments. Requires `can_read`. A message in another mailbox (for a mailbox-bound key) or another account is reported as `404` (anti-enumeration).
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Message.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageDetail'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Key cannot read messages (`code:key_scope`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KeyScopeError'
        '404':
          description: Message not found (missing, cross-account, or cross-mailbox for a bound key).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: message not found
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
      required:
      - error
      additionalProperties: false
    KeyScopeError:
      type: object
      properties:
        error:
          type: string
        code:
          type: string
          const: key_scope
      required:
      - error
      - code
      additionalProperties: false
    MessageDetail:
      type: object
      properties:
        id:
          type: string
        mailbox_id:
          type: string
        direction:
          type: string
          enum:
          - in
          - out
        provider_message_id:
          anyOf:
          - type: string
          - type: 'null'
        rfc_message_id:
          anyOf:
          - type: string
          - type: 'null'
        thread_id:
          type: string
        in_reply_to:
          anyOf:
          - type: string
          - type: 'null'
        from_addr:
          type: string
        to_addr:
          type: string
        subject:
          type: string
          description: The sanitized subject (invisible/bidi characters stripped) — the value every delivery surface serves.
        subject_raw:
          description: Pre-sanitization subject original. Purged on the same TTL as body_raw; null on messages that predate subject sanitization. Stripped from MCP reads, like body_raw.
          anyOf:
          - type: string
          - type: 'null'
        body_raw:
          anyOf:
          - type: string
          - type: 'null'
        body_clean:
          anyOf:
          - type: string
          - type: 'null'
        truncated:
          type: boolean
        created_at:
          type: string
        comprehension:
          anyOf:
          - type: object
            propertyNames:
              type: string
            additionalProperties: {}
          - type: 'null'
        attachments:
          type: array
          items:
            type: object
            propertyNames:
              type: string
            additionalProperties: {}
        auth_results:
          anyOf:
          - type: object
            properties:
              spf:
                type: string
                enum:
                - pass
                - fail
                - softfail
                - neutral
                - none
                - temperror
                - permerror
              dkim:
                type: string
                enum:
                - pass
                - fail
                - softfail
                - neutral
                - none
                - temperror
                - permerror
              dmarc:
                type: string
                enum:
                - pass
                - fail
                - softfail
                - neutral
                - none
                - temperror
                - permerror
            required:
            - spf
            - dkim
            - dmarc
            additionalProperties: false
          - type: 'null'
          description: SPF/DKIM/DMARC verdicts from the inbound Authentication-Results header; null if none was forwarded.
        spam_risk:
          anyOf:
          - type: string
            enum:
            - low
            - high
            - error
          - type: 'null'
          description: 'The layered spam verdict: ''high'' from either the free SES x-ses-spam-verdict gate or the Haiku classifier reaching the same conclusion on SES-pass mail; ''low'' cleared both; ''error'' means the classifier failed and the message proceeded un-quarantined (availability over false quarantine). null when spam scoring never ran for this message.'
        virus_risk:
          anyOf:
          - type: string
            enum:
            - low
            - high
          - type: 'null'
          description: 'The SES virus verdict from the free x-ses-virus-verdict gate: ''high'' means SES flagged the message as malware — it is stored but never delivered (no deliver-toggle exists for malware); ''low'' means SES cleared it; null when no verdict was forwarded.'
      required:
      - id
      - mailbox_id
      - direction
      - thread_id
      - from_addr
      - to_addr
      - subject
      - created_at
      - auth_results
      - spam_risk
      - virus_risk
      additionalProperties: false
    MessageListItem:
      type: object
      properties:
        id:
          type: string
        direction:
          type: string
          enum:
          - in
          - out
        from_addr:
          type: string
        to_addr:
          type: string
        subject:
          type: string
        created_at:
          type: string
        comprehension:
          anyOf:
          - type: object
            properties:
              status:
                type: string
              classification:
                anyOf:
                - type: string
                - type: 'null'
            additionalProperties: false
          - type: 'null'
      required:
      - id
      - direction
      - from_addr
      - to_addr
      - subject
      - created_at
      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.'