Mailosaur Devices API

Operations for managing virtual security devices and retrieving their current one-time passwords (OTPs), used to automate testing of app-based multi-factor authentication.

Operations 5

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /api/devices List virtual security devices · List devices #
Ask an LLM
“Which virtual MFA devices have I set up for testing?”
“Can I see all my saved virtual security devices?”
Tell an agent
List all my virtual security devices.
Show the virtual authenticator devices saved on my account.
POST /api/devices Create a virtual security device · Create a device #
Ask an LLM
“How do I save a virtual authenticator device to test two-factor logins?”
“Can I register a device using an existing base32 shared secret?”
Tell an agent
Create a virtual security device named {name}.
Save a new device called {name} using shared secret {sharedSecret}.
DELETE /api/devices/{deviceId} Delete a virtual security device · Delete a device #
Ask an LLM
“How do I remove a virtual security device I no longer need?”
“Is deleting a saved virtual MFA device permanent?”
Tell an agent destructive · confirm first
Delete virtual security device {deviceId}.
Permanently remove the saved authenticator device {deviceId}.
GET /api/devices/{deviceId}/otp Get the current code from a saved device · Get OTP for a device #
Ask an LLM
“What is the current one-time password for my saved virtual device?”
“Can my automated test read the 2FA code from a device I already saved?”
Tell an agent
Get the current OTP for saved device {deviceId}.
Fetch the latest two-factor code from virtual device {deviceId}.
POST /api/devices/otp Get a one-time password from a shared secret · Get OTP by shared secret #
Ask an LLM
“Can I generate a TOTP code from a base32 secret without saving a device?”
“How do I get a 2FA code straight from the shared secret shown during MFA setup?”
Tell an agent
Generate the current one-time password for shared secret {sharedSecret}.
Give me the 2FA code for secret {sharedSecret} without creating a device.

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/mailosaur:mailosaur-devices-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

mailosaur-devices-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Mailosaur Devices API
  description: REST API for email and SMS testing. Provides endpoints for managing test inboxes (servers), retrieving and searching messages, running deliverability checks, generating OTPs for authenticator testing, and accessing account usage data. All requests authenticate via HTTP Basic Auth using an API key.
  version: 1.0.0
  contact:
    name: Mailosaur Support
    url: https://mailosaur.com/docs/api
  termsOfService: https://mailosaur.com/terms
  license:
    name: Commercial
    url: https://mailosaur.com/terms
servers:
- url: https://mailosaur.com
  description: Mailosaur production API
security:
- basicAuth: []
tags:
- name: Devices
  description: Operations for managing virtual security devices and retrieving their current one-time passwords (OTPs), used to automate testing of app-based multi-factor authentication.
paths:
  /api/devices:
    get:
      operationId: listDevices
      summary: List devices
      description: Returns a list of your virtual security devices.
      tags:
      - Devices
      responses:
        '200':
          description: A list of virtual security devices.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceListResult'
    post:
      operationId: createDevice
      summary: Create a device
      description: Creates a new virtual security device.
      tags:
      - Devices
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeviceCreateOptions'
      responses:
        '200':
          description: The newly-created virtual security device.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Device'
  /api/devices/{deviceId}:
    delete:
      operationId: deleteDevice
      summary: Delete a device
      description: Permanently delete a virtual security device. This operation cannot be undone.
      tags:
      - Devices
      parameters:
      - $ref: '#/components/parameters/deviceId'
      responses:
        '204':
          description: The device was successfully deleted.
  /api/devices/{deviceId}/otp:
    get:
      operationId: getDeviceOtp
      summary: Get OTP for a device
      description: Retrieves the current one-time password for a saved device.
      tags:
      - Devices
      parameters:
      - $ref: '#/components/parameters/deviceId'
      responses:
        '200':
          description: The current one-time password result.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OtpResult'
  /api/devices/otp:
    post:
      operationId: getOtpBySharedSecret
      summary: Get OTP by shared secret
      description: Retrieves the current one-time password given a base32-encoded shared secret.
      tags:
      - Devices
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                sharedSecret:
                  type: string
                  description: The base32-encoded shared secret.
              required:
              - sharedSecret
      responses:
        '200':
          description: The current one-time password result.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OtpResult'
components:
  schemas:
    Device:
      type: object
      description: A Mailosaur virtual security device (for TOTP/2FA testing).
      properties:
        id:
          type: string
          description: Unique identifier for the device.
        name:
          type: string
          description: The name of the device.
    DeviceListResult:
      type: object
      description: A list of virtual security devices.
      properties:
        items:
          type: array
          description: A list of devices.
          items:
            $ref: '#/components/schemas/Device'
    OtpResult:
      type: object
      description: A one-time password result from a virtual security device.
      properties:
        code:
          type: string
          description: The current one-time password.
        expires:
          type: string
          format: date-time
          description: The expiry date/time of the current one-time password.
    DeviceCreateOptions:
      type: object
      description: Options used to create a new Mailosaur virtual security device.
      properties:
        name:
          type: string
          description: A name used to identify the device.
        sharedSecret:
          type: string
          description: The base32-encoded shared secret for this device.
  parameters:
    deviceId:
      name: deviceId
      in: path
      required: true
      description: The unique identifier of the virtual security device.
      schema:
        type: string
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: HTTP Basic Auth using your Mailosaur API key as the username and an empty password, or your API key as both username and password.