Mailbuttons Memory API

The memory API from Mailbuttons — 5 operation(s) for memory.

GitHub OpenAPI

Operations 5

GET /v1/mailboxes/{mailbox_id}/memory/download Get a short-lived presigned URL for the mailbox's `.mv2` memory file #
POST /v1/mailboxes/{mailbox_id}/memory/lock Acquire a short exclusive lock on the mailbox's `.mv2` memory file #
GET /v1/mailboxes/{mailbox_id}/memory/metadata Get the mailbox's `.mv2` memory file metadata #
POST /v1/mailboxes/{mailbox_id}/memory/unlock Release the mailbox's `.mv2` memory file lock #
POST /v1/mailboxes/{mailbox_id}/memory/upload Upload (or replace) the mailbox's `.mv2` memory file #

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-memory-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-memory-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 Memory API
  version: 1.0.0
servers:
- url: https://mbag.ai/api
- url: https://mailbuttons.com/api
security:
- apiKey: []
tags:
- name: Memory
paths:
  /v1/mailboxes/{mailbox_id}/memory/download:
    get:
      operationId: downloadMemory
      parameters:
      - in: path
        name: mailbox_id
        required: true
        schema:
          format: int32
          type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PresignedDownloadResponse'
          description: Presigned GET URL, valid for `expires_in_seconds`.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          content:
            text/plain:
              schema:
                type: string
          description: Mailbox not found (or not owned), or no memory file has been uploaded yet. Plain-text body.
        '500':
          content:
            text/plain:
              schema:
                type: string
          description: Database error checking mailbox ownership. Plain-text body.
        '502':
          content:
            text/plain:
              schema:
                type: string
          description: Object storage error checking existence or presigning the URL. Plain-text body.
      security:
      - apiKey: []
      summary: Get a short-lived presigned URL for the mailbox's `.mv2` memory file
      tags:
      - Memory
  /v1/mailboxes/{mailbox_id}/memory/lock:
    post:
      description: 'Fixed 30-second lock duration. Before any file has ever been

        uploaded there is nothing to lock yet, so the first acquire always

        succeeds (races between two first-writers are an accepted edge —

        every subsequent write is properly serialised).'
      operationId: acquireMemoryLock
      parameters:
      - in: path
        name: mailbox_id
        required: true
        schema:
          format: int32
          type: integer
      responses:
        '200':
          description: Lock acquired. Empty 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.
        '409':
          content:
            text/plain:
              schema:
                type: string
          description: Memory file is currently locked by another writer. Plain-text body.
        '500':
          content:
            text/plain:
              schema:
                type: string
          description: Database error checking mailbox ownership or acquiring the lock. Plain-text body.
      security:
      - apiKey: []
      summary: Acquire a short exclusive lock on the mailbox's `.mv2` memory file
      tags:
      - Memory
  /v1/mailboxes/{mailbox_id}/memory/metadata:
    get:
      operationId: getMemoryMetadata
      parameters:
      - in: path
        name: mailbox_id
        required: true
        schema:
          format: int32
          type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MemoryMetadataResponse'
          description: Metadata for the stored file.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          content:
            text/plain:
              schema:
                type: string
          description: Mailbox not found (or not owned), or no memory file has been uploaded yet. Plain-text body.
        '500':
          content:
            text/plain:
              schema:
                type: string
          description: Database error checking mailbox ownership or reading the metadata row. Plain-text body.
      security:
      - apiKey: []
      summary: Get the mailbox's `.mv2` memory file metadata
      tags:
      - Memory
  /v1/mailboxes/{mailbox_id}/memory/unlock:
    post:
      description: Unconditional — releases whatever lock is held (or is a no-op if none is), regardless of who acquired it.
      operationId: releaseMemoryLock
      parameters:
      - in: path
        name: mailbox_id
        required: true
        schema:
          format: int32
          type: integer
      responses:
        '200':
          description: Released (or was already unlocked). Empty 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 checking mailbox ownership or releasing the lock. Plain-text body.
      security:
      - apiKey: []
      summary: Release the mailbox's `.mv2` memory file lock
      tags:
      - Memory
  /v1/mailboxes/{mailbox_id}/memory/upload:
    post:
      description: Upserts by `storage_key` (one file per mailbox); overwrites any existing file and metadata row.
      operationId: uploadMemory
      parameters:
      - in: path
        name: mailbox_id
        required: true
        schema:
          format: int32
          type: integer
      requestBody:
        content:
          multipart/form-data:
            schema:
              properties:
                file:
                  description: The other multipart parts are ignored; the first `file` field wins.
                  format: binary
                  type: string
              required:
              - file
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MemoryMetadataResponse'
          description: Stored.
        '400':
          content:
            text/plain:
              schema:
                type: string
          description: Malformed multipart body, or no `file` field present. 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 checking mailbox ownership or upserting the metadata row. Plain-text body.
        '502':
          content:
            text/plain:
              schema:
                type: string
          description: Object storage error writing the file. Plain-text body.
      security:
      - apiKey: []
      summary: Upload (or replace) the mailbox's `.mv2` memory file
      tags:
      - Memory
components:
  schemas:
    MemoryMetadataResponse:
      properties:
        checksum_sha256:
          type: string
        customer_id:
          format: int64
          type: integer
        file_size:
          format: int64
          type: integer
        last_modified:
          format: date-time
          type: string
        mailbox_id:
          format: int32
          type: integer
        storage_key:
          type: string
      required:
      - mailbox_id
      - customer_id
      - storage_key
      - file_size
      - checksum_sha256
      - last_modified
      type: object
    PresignedDownloadResponse:
      properties:
        expires_in_seconds:
          format: int64
          type: integer
        url:
          type: string
      required:
      - url
      - expires_in_seconds
      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