mailfixture Hooks API

Capture hooks (webhook capture): public ingest URLs that record every HTTP request sent to them, for asserting the app under test fired its webhooks. Receive-only — captures are never forwarded, replayed, or turned into events. Not to be confused with the outbound `webhooks` resource.

GitHub OpenAPI

Operations 6

GET /v1/hook-requests/{id} Get a captured request #
GET /v1/hooks List capture hooks #
POST /v1/hooks Create a capture hook #
DELETE /v1/hooks/{id} Delete a capture hook #
POST /v1/hooks/{id}/clear Clear captured requests #
GET /v1/hooks/{id}/requests List or long-poll captured requests #

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/mailfixture-com:mailfixture-com-hooks-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

mailfixture-com-hooks-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  contact:
    email: support@mailfixture.com
    name: mailfixture support
  description: 'REST API for mailfixture: create inboxes, trigger your app''s email flow, then read messages back and assert on extracted OTPs, links, SPF/DKIM/DMARC verdicts, and a SpamAssassin score. Paid plans add dedicated US phone numbers with the same loop for SMS.


    Conventions:

    - Every request needs `Authorization: Bearer mfx_`.

    - Errors are RFC 7807 `application/problem+json` (`{type, title, status, detail}`); `type` is always `about:blank`. 404 uniformly covers both missing and not-owned resources.

    - Rate limiting is a per-key token bucket: 2 requests/second sustained, burst 60 (policy `requests`). Refusals are 429 with a `Retry-After` header (integer seconds). Inbox, phone-number, and capture-hook creation draw on a shared second per-key bucket (burst 10, refills 10/minute; policy `creates`).

    - Every authenticated response carries rate-limit headers: `RateLimit-Policy: "requests";q=60;w=30` and `RateLimit: "requests";r=;t=` (draft-ietf-httpapi-ratelimit-headers syntax) plus `RateLimit-Limit` / `RateLimit-Remaining` / `RateLimit-Reset` integers. A 429 reports the bucket that refused with `r=0`.

    - A 401 carries `WWW-Authenticate: Bearer realm="mailfixture"` (`error="invalid_token"` when a key was presented but rejected).

    - Timestamps are RFC 3339 UTC strings; ids are UUIDs. Nullable fields serialize as JSON `null`, never omitted (except where a schema notes otherwise).

    - List responses wrap the array in an object key (`{"messages": [...]}`) and are not paginated; message lists take a `since` cursor instead.

    - Long-polling: message list endpoints accept `wait` (clamped to 60 s) and hold the request until a match arrives or the window closes. An empty window is a 200 with an empty array, never 204 or 408.'
  summary: 'Programmatic email inboxes (and SMS numbers) for automated testing. Receive-only: mailfixture never sends.'
  termsOfService: https://mailfixture.com/terms
  title: mailfixture Hooks API
  version: 0.1.0
servers:
- description: Canonical API origin
  url: https://api.mailfixture.com
security:
- apiKey: []
tags:
- description: 'Capture hooks (webhook capture): public ingest URLs that record every HTTP request sent to them, for asserting the app under test fired its webhooks. Receive-only — captures are never forwarded, replayed, or turned into events. Not to be confused with the outbound `webhooks` resource.'
  name: Hooks
paths:
  /v1/hook-requests/{id}:
    get:
      operationId: get_hook_request
      parameters:
      - description: Captured request id.
        in: path
        name: id
        required: true
        schema:
          format: uuid
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HookRequestDetail'
          description: The captured request with headers and body.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: No such captured request on this account.
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/ServerError'
      summary: Get a captured request
      tags:
      - Hooks
  /v1/hooks:
    get:
      operationId: list_hooks
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HookList'
          description: The account's live hooks.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/ServerError'
      summary: List capture hooks
      tags:
      - Hooks
    post:
      description: Mints a public ingest URL (on a dedicated utility host, never the brand or API origin). Any HTTP request sent there is recorded and answered with a fixed `200 {"ok":true}` — responses are not configurable. Creation shares the burst-10 creation bucket with inboxes. Captured requests are hard-capped per plan (free 100/mo, solo 2,500, team 15,000, scale 100,000; daily caps 100/2,000/10,000/50,000) — over-cap ingest answers 429 with Retry-After. Captures never fire outbound webhook events (loop prevention, by design).
      operationId: create_hook
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateHookRequest'
        required: false
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Hook'
          description: Hook created; `ingest_url` is the address to give the app under test.
        '400':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: '`label` over 200 chars or `ttl_seconds` out of range.'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: Account frozen, or the plan's hook cap is reached (free 1, solo 3, team 10, scale 25).
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/ServerError'
      summary: Create a capture hook
      tags:
      - Hooks
  /v1/hooks/{id}:
    delete:
      description: Deletes the hook and all captured requests immediately; the ingest URL answers 404 afterwards.
      operationId: delete_hook
      parameters:
      - description: Hook id.
        in: path
        name: id
        required: true
        schema:
          format: uuid
          type: string
      responses:
        '204':
          description: Hook deleted; its captured requests are gone.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: No such hook on this account.
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/ServerError'
      summary: Delete a capture hook
      tags:
      - Hooks
  /v1/hooks/{id}/clear:
    post:
      description: Deletes the hook's captured requests but keeps the hook and its ingest URL — rerun hygiene between test runs.
      operationId: clear_hook
      parameters:
      - description: Hook id.
        in: path
        name: id
        required: true
        schema:
          format: uuid
          type: string
      responses:
        '204':
          description: Captured requests dropped; the hook remains.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: No such hook on this account.
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/ServerError'
      summary: Clear captured requests
      tags:
      - Hooks
  /v1/hooks/{id}/requests:
    get:
      description: Summaries ordered oldest-first by `received_at`, at most 100 per response; bodies stay on the detail endpoint. Long-poll semantics match the email endpoint.
      operationId: list_hook_requests
      parameters:
      - description: Hook id.
        in: path
        name: id
        required: true
        schema:
          format: uuid
          type: string
      - $ref: '#/components/parameters/Since'
      - description: 'Filter expression: `method:<verb>` (exact, case-insensitive), `path:<term>` or `body:<term>` (case-insensitive substring); a bare term (or unknown prefix) matches the body. Body matching scans the first 32 KiB of body bytes; detail responses still return the complete body.'
        in: query
        name: match
        required: false
        schema:
          type: string
      - $ref: '#/components/parameters/Wait'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HookRequestList'
          description: Matching captured requests — empty array when nothing matched within the wait window.
        '400':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: '`match` has an empty term after its field prefix.'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: No such hook on this account.
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/ServerError'
      summary: List or long-poll captured requests
      tags:
      - Hooks
components:
  schemas:
    Problem:
      description: 'RFC 7807 problem document — every error response uses this shape with `Content-Type: application/problem+json`.'
      properties:
        detail:
          description: Human-readable specifics; null on 500.
          type:
          - string
          - 'null'
        status:
          description: The HTTP status, duplicated in the body.
          type: integer
        title:
          description: Fixed short phrase for the status class, e.g. `bad request`, `not found`.
          type: string
        type:
          const: about:blank
          type: string
      required:
      - type
      - title
      - status
      - detail
      type: object
    HookRequestDetail:
      properties:
        body:
          description: The body as text. When the raw bytes were not valid UTF-8 text this is a lossy rendering — use `body_base64` for the exact bytes (signature verification needs them).
          type: string
        body_base64:
          description: Base64 of the exact body bytes. Present ONLY when `body_is_utf8` is false.
          type: string
        body_is_utf8:
          type: boolean
        body_size:
          type: integer
        content_type:
          type:
          - string
          - 'null'
        expires_at:
          description: Plan retention, same clock as messages.
          format: date-time
          type: string
        headers:
          description: Lowercased names; duplicate values for one name keep their received order, but the relative order of different names is not preserved. The proxy's own x-forwarded-* hop headers are stripped (the sender address is `remote_ip`).
          items:
            $ref: '#/components/schemas/HookHeader'
          type: array
        hook_id:
          format: uuid
          type: string
        id:
          format: uuid
          type: string
        method:
          type: string
        path:
          type: string
        received_at:
          format: date-time
          type: string
        remote_ip:
          description: The sender's IP as seen at the edge.
          type:
          - string
          - 'null'
      required:
      - id
      - hook_id
      - received_at
      - method
      - path
      - headers
      - content_type
      - body
      - body_is_utf8
      - body_size
      - remote_ip
      - expires_at
      type: object
    CreateHookRequest:
      description: All fields optional; an empty or absent body creates an unlabeled hook with no expiry.
      properties:
        label:
          description: Human label shown in lists and the dashboard.
          maxLength: 200
          type: string
        ttl_seconds:
          description: Auto-delete the hook (and its captured requests) after this many seconds (max 30 days). Omit for no expiry.
          maximum: 2592000
          minimum: 60
          type: integer
      type: object
    HookList:
      properties:
        hooks:
          items:
            $ref: '#/components/schemas/Hook'
          type: array
      required:
      - hooks
      type: object
    HookRequestList:
      properties:
        requests:
          items:
            $ref: '#/components/schemas/HookRequestSummary'
          type: array
      required:
      - requests
      type: object
    Hook:
      properties:
        created_at:
          format: date-time
          type: string
        id:
          format: uuid
          type: string
        ingest_url:
          description: The public URL to configure in the app under test. Any method; bodies up to 256KB. Successful captures always answer the fixed `200 {"ok":true}` — responses are not configurable; over-size bodies answer 413, exhausted quotas 429 with Retry-After, and an unknown token 404.
          type: string
        label:
          type:
          - string
          - 'null'
        token:
          description: The write capability embedded in the ingest URL. Anyone who knows it can add requests to the bin — treat like a webhook secret. It never grants reads.
          type: string
        ttl_expires_at:
          format: date-time
          type:
          - string
          - 'null'
      required:
      - id
      - token
      - ingest_url
      - label
      - ttl_expires_at
      - created_at
      type: object
    HookRequestSummary:
      description: Body metadata only — fetch the detail endpoint for headers and the body itself.
      properties:
        body_size:
          description: Body size in bytes as received.
          type: integer
        content_type:
          type:
          - string
          - 'null'
        hook_id:
          format: uuid
          type: string
        id:
          format: uuid
          type: string
        method:
          description: Uppercased HTTP verb as received.
          type: string
        path:
          description: Path + query after the token; `/` when the request hit the bare ingest URL.
          type: string
        received_at:
          format: date-time
          type: string
      required:
      - id
      - hook_id
      - received_at
      - method
      - path
      - content_type
      - body_size
      type: object
    HookHeader:
      properties:
        name:
          description: Lowercased header name.
          type: string
        value:
          description: Header value, lossy-decoded when not valid UTF-8.
          type: string
      required:
      - name
      - value
      type: object
  responses:
    Unauthorized:
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
      description: Missing bearer token, malformed key, or unknown/revoked/invalid API key.
      headers:
        WWW-Authenticate:
          description: 'RFC 6750 Bearer challenge: `Bearer realm="mailfixture"` when no token was sent, with `error="invalid_token"` when one was sent but rejected.'
          schema:
            type: string
    RateLimited:
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
      description: Per-key rate limit exceeded. `Retry-After` says when the next request will be admitted; the RateLimit headers name the bucket that refused (`requests` or `creates`) with `r=0`.
      headers:
        RateLimit:
          description: 'Live bucket state: `"<bucket>";r=<remaining>;t=<seconds until full>`. Present on every authenticated response, not only 429s.'
          schema:
            type: string
        RateLimit-Limit:
          description: Bucket size (legacy integer form).
          schema:
            type: integer
        RateLimit-Policy:
          description: 'Quota policy, draft-ietf-httpapi-ratelimit-headers syntax: `"<bucket>";q=<size>;w=<seconds to refill fully>`.'
          schema:
            type: string
        RateLimit-Remaining:
          description: Whole tokens left (legacy integer form).
          schema:
            type: integer
        RateLimit-Reset:
          description: Seconds until the bucket is full (legacy integer form).
          schema:
            type: integer
        Retry-After:
          description: Seconds until the next token is available.
          schema:
            type: integer
    ServerError:
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
      description: Unexpected server error. `detail` is null — internals are never leaked.
  parameters:
    Wait:
      description: Long-poll window in seconds; default 0 answers immediately. Clamped to 60 — larger values are accepted and treated as 60. The request returns as soon as a matching item arrives; an empty window still answers 200 with an empty list.
      in: query
      name: wait
      required: false
      schema:
        minimum: 0
        type: integer
    Since:
      description: Only items (messages, SMS, or captured requests) received strictly after this RFC 3339 timestamp. Feed back the last summary's `received_at` as a cursor — the row carrying that exact timestamp is not repeated.
      in: query
      name: since
      required: false
      schema:
        format: date-time
        type: string
  securitySchemes:
    apiKey:
      description: mailfixture API key (`mfx_…`) as a Bearer token. Create one in the dashboard (/app/keys) or via POST /v1/keys.
      scheme: bearer
      type: http
externalDocs:
  description: Hand-written API reference
  url: https://mailfixture.com/docs/api