Mailbuttons Webhooks API

The webhooks API from Mailbuttons — 2 operation(s) for webhooks.

GitHub OpenAPI

Operations 3

GET /v1/mailboxes/{mailbox_id}/webhooks List webhooks registered on a mailbox #
POST /v1/mailboxes/{mailbox_id}/webhooks Register a webhook on a mailbox #
DELETE /v1/mailboxes/{mailbox_id}/webhooks/{webhook_id} Delete a webhook #

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/mailbuttons-com:mailbuttons-com-webhooks-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

mailbuttons-com-webhooks-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  description: 'REST API for provisioning and operating governed email accounts for AI

    agents, on mbag.ai and mailbuttons.com. Authenticate with a Bearer API

    key: `mbk_`-prefixed when obtained via the OTP flow below (see `/auth/otp/cli-exchange`);

    dashboard-issued keys carry no prefix.'
  title: Mailbuttons Agent Mail Webhooks API
  version: 1.0.0
servers:
- url: https://mbag.ai/api
- url: https://mailbuttons.com/api
security:
- apiKey: []
tags:
- name: Webhooks
paths:
  /v1/mailboxes/{mailbox_id}/webhooks:
    get:
      description: Never includes `secret` (unlike the create response).
      operationId: listWebhooks
      parameters:
      - in: path
        name: mailbox_id
        required: true
        schema:
          format: int32
          type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/WebhookSummary'
                type: array
          description: The mailbox's webhooks, newest first.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          content:
            text/plain:
              schema:
                type: string
          description: Mailbox not found (or not owned by the caller). Plain-text body.
        '500':
          content:
            text/plain:
              schema:
                type: string
          description: Database error. Plain-text body.
      security:
      - apiKey: []
      summary: List webhooks registered on a mailbox
      tags:
      - Webhooks
    post:
      description: '`events` defaults to `["email.received"]` when omitted. The response

        includes the HMAC `secret` — this is the ONLY time it''s returned;

        `GET .../webhooks` never includes it.'
      operationId: registerWebhook
      parameters:
      - in: path
        name: mailbox_id
        required: true
        schema:
          format: int32
          type: integer
      requestBody:
        content:
          application/json:
            schema:
              properties:
                events:
                  description: Defaults to `["email.received"]` when omitted.
                  items:
                    type: string
                  type: array
                url:
                  description: Must start with `http://` or `https://`.
                  type: string
              required:
              - url
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookRecord'
          description: Webhook registered.
        '400':
          content:
            text/plain:
              schema:
                type: string
          description: Missing or invalid `url` (empty, or doesn't start with `http://`/`https://`). Plain-text body.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          content:
            text/plain:
              schema:
                type: string
          description: Mailbox not found (or not owned by the caller). Plain-text body.
        '500':
          content:
            text/plain:
              schema:
                type: string
          description: Database error. Plain-text body.
      security:
      - apiKey: []
      summary: Register a webhook on a mailbox
      tags:
      - Webhooks
  /v1/mailboxes/{mailbox_id}/webhooks/{webhook_id}:
    delete:
      operationId: deleteWebhook
      parameters:
      - in: path
        name: mailbox_id
        required: true
        schema:
          format: int32
          type: integer
      - in: path
        name: webhook_id
        required: true
        schema:
          format: int64
          type: integer
      responses:
        '204':
          description: Deleted.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          content:
            text/plain:
              schema:
                type: string
          description: Mailbox not found (or not owned by the caller), or the webhook id doesn't exist under this mailbox. Plain-text body.
        '500':
          content:
            text/plain:
              schema:
                type: string
          description: Database error. Plain-text body.
      security:
      - apiKey: []
      summary: Delete a webhook
      tags:
      - Webhooks
components:
  schemas:
    WebhookSummary:
      properties:
        created_at:
          format: date-time
          type: string
        events:
          items:
            type: string
          type: array
        id:
          format: int64
          type: integer
        is_active:
          type: boolean
        mailbox_id:
          format: int32
          type: integer
        url:
          type: string
      required:
      - id
      - mailbox_id
      - url
      - events
      - is_active
      - created_at
      type: object
    WebhookRecord:
      description: Returned once, on registration — this is the only response that includes `secret`.
      properties:
        created_at:
          format: date-time
          type: string
        customer_id:
          format: int64
          type: integer
        events:
          items:
            type: string
          type: array
        id:
          format: int64
          type: integer
        is_active:
          type: boolean
        mailbox_id:
          format: int32
          type: integer
        secret:
          description: HMAC secret for verifying the `X-Mailbuttons-Signature` header on delivered webhooks.
          type: string
        url:
          type: string
      required:
      - id
      - mailbox_id
      - customer_id
      - url
      - secret
      - events
      - is_active
      - created_at
      type: object
  responses:
    Unauthorized:
      content:
        application/json:
          schema:
            properties:
              error:
                enum:
                - Missing Authorization header
                - Bearer authorization required
                - Invalid API key
                - API key disabled
                type: string
            required:
            - error
            type: object
      description: 'Missing or invalid credential, raised by the `ApiKeyAuth` extractor

        (`backend/src/api_keys.rs`) before the handler runs: no

        `Authorization` header, a non-`Bearer` scheme, a key that doesn''t

        hash-match any row, or a key whose status isn''t `active`. A header

        that isn''t valid UTF-8, has no scheme token, or has `Bearer` with no

        key value returns 400 with this same JSON shape instead of 401.

        '
  securitySchemes:
    apiKey:
      bearerFormat: API key
      scheme: bearer
      type: http