Mail-in-a-Box User API

Endpoints related to user authentication.

Operations 2

POST /login Exchange a username and password for a session API key #
POST /logout Invalidates a session API key #

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/mail-in-a-box:mail-in-a-box-user-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

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. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

mail-in-a-box-user-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Mail-in-a-Box User API
  description: 'Mail-in-a-Box API HTTP specification.


    # Introduction

    This API is documented in **OpenAPI format**.

    (View the full HTTP specification.)


    All endpoints are relative to `https://{host}/admin` and are secured with `Basic Access` authentication. If you have multi-factor authentication enabled, authentication with a `user:password` combination will fail unless a valid OTP is supplied via the `x-auth-token` header. Authentication via a `user:user_key` pair is possible without the header being present.'
  contact:
    name: Mail-in-a-Box support
    url: https://mailinabox.email/
  license:
    name: CC0 1.0 Universal
    url: https://creativecommons.org/publicdomain/zero/1.0/legalcode
  version: 0.51.0
  x-logo:
    url: https://mailinabox.email/static/logo.png
    altText: Mail-in-a-Box logo
servers:
- url: https://{host}/admin
  variables:
    host:
      default: box.example.com
      description: The API hostname.
security:
- basicAuth: []
tags:
- name: User
  description: Endpoints related to user authentication.
paths:
  /login:
    post:
      tags:
      - User
      summary: Exchange a username and password for a session API key
      description: 'Returns user information and a session API key.


        Authenticate a user by supplying the auth token as a base64 encoded string in

        format `email:password` using basic authentication headers.


        If successful, a long-lived `api_key` is returned which can be used for subsequent

        requests to the API in place of the password.'
      operationId: login
      x-codeSamples:
      - lang: curl
        source: "curl -X POST \"https://{host}/admin/login\" \\\n  -u \"<email>:<password>\"\n"
      responses:
        200:
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MeResponse'
              examples:
                invalid:
                  value:
                    reason: Incorrect username or password
                    status: invalid
                ok:
                  value:
                    api_key: 1a2b3c4d5e6f7g8h9i0j
                    email: user@example.com
                    privileges:
                    - admin
                    status: ok
  /logout:
    post:
      tags:
      - User
      summary: Invalidates a session API key
      description: Invalidates a session API key so that it cannot be used after this API call.
      operationId: logout
      x-codeSamples:
      - lang: curl
        source: "curl -X POST \"https://{host}/admin/logout\" \\\n  -u \"<email>:<session_key>\"\n"
      responses:
        200:
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LogoutResponse'
components:
  schemas:
    MailUserPrivilege:
      type: string
      enum:
      - admin
      - ''
      example: admin
      description: Mail user privilege.
    MeAuthStatus:
      type: string
      enum:
      - ok
      - invalid
      example: invalid
      description: Me (user) authentication result.
    LogoutResponse:
      type: object
      properties:
        status:
          type: string
    Email:
      type: string
      format: email
      example: user@example.com
      description: Email format.
    MeResponse:
      type: object
      required:
      - status
      properties:
        api_key:
          type: string
          example: 12345abcde
        email:
          $ref: '#/components/schemas/Email'
        privileges:
          type: array
          items:
            $ref: '#/components/schemas/MailUserPrivilege'
        reason:
          type: string
          example: Incorrect username or password
        status:
          $ref: '#/components/schemas/MeAuthStatus'
      description: Me (user) response.
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: 'Credentials can be supplied using the `Authorization` header in

        format `Authorization: Basic {access-token}`.


        The `access-token` is comprised of the Base64 encoding of `username:password`.

        The `username` is the mail user''s email address, and `password` can either be the mail user''s

        password, or the `api_key` returned from the `login` operation.


        When using `curl`, you can supply user credentials using the `-u` or `--user` parameter.

        '
externalDocs:
  description: Find out more about Mail-in-a-box.
  url: https://mailinabox.email/