Umami Two-factor authentication API

The Two-factor authentication API from Umami — 6 operation(s) for two-factor authentication.

Operations 6

POST /api/2fa/disable Disable two-factor authentication #
POST /api/2fa/setup/cancel Cancel two-factor authentication setup #
POST /api/2fa/setup/confirm Confirm two-factor authentication setup #
POST /api/2fa/setup/initiate Set up two-factor authentication #
GET /api/2fa/status Get two-factor authentication status #
POST /api/2fa/verify Complete two-factor sign-in #

Documentation

Specifications

Schemas & Data

📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/umami/refs/heads/main/json-schema/umami-website-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/umami/refs/heads/main/json-schema/umami-website-pageviews-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/umami/refs/heads/main/json-schema/umami-create-website-request-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/umami/refs/heads/main/json-schema/umami-website-page-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/umami/refs/heads/main/json-schema/umami-website-stats-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/umami/refs/heads/main/json-schema/umami-website-session-page-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/umami/refs/heads/main/json-schema/umami-website-list-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/umami/refs/heads/main/json-schema/umami-website-request-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/umami/refs/heads/main/json-schema/umami-pageview-data-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/umami/refs/heads/main/json-schema/umami-metric-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/umami/refs/heads/main/json-schema/umami-active-visitors-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/umami/refs/heads/main/json-schema/umami-session-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/umami/refs/heads/main/json-schema/umami-session-list-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/umami/refs/heads/main/json-schema/umami-session-stats-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/umami/refs/heads/main/json-schema/umami-user-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/umami/refs/heads/main/json-schema/umami-user-request-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/umami/refs/heads/main/json-schema/umami-team-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/umami/refs/heads/main/json-schema/umami-team-list-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/umami/refs/heads/main/json-schema/umami-team-member-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/umami/refs/heads/main/json-schema/umami-team-request-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/umami/refs/heads/main/json-schema/umami-login-request-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/umami/refs/heads/main/json-schema/umami-login-response-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/umami/refs/heads/main/json-schema/umami-ok-response-schema.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/umami/refs/heads/main/json-structure/umami-website-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/umami/refs/heads/main/json-structure/umami-website-list-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/umami/refs/heads/main/json-structure/umami-website-stats-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/umami/refs/heads/main/json-structure/umami-session-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/umami/refs/heads/main/json-structure/umami-session-list-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/umami/refs/heads/main/json-structure/umami-metric-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/umami/refs/heads/main/json-structure/umami-user-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/umami/refs/heads/main/json-structure/umami-team-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/umami/refs/heads/main/json-structure/umami-team-member-structure.json

Other Resources

🔗
Postman
https://raw.githubusercontent.com/api-evangelist/umami/refs/heads/main/postman/umami-events-api.postman_collection.json
🔗
OpenCollection
https://raw.githubusercontent.com/api-evangelist/umami/refs/heads/main/collections/umami-events-api.opencollection.json
🔗
APIDocumentation
https://docs.umami.is/docs/api
🔗
GitHubOrg
https://github.com/umami-software/umami
🔗
JSONLDContext
https://raw.githubusercontent.com/api-evangelist/umami/refs/heads/main/json-ld/umami-context.jsonld
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/umami/refs/heads/main/examples/umami-website-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/umami/refs/heads/main/examples/umami-website-stats-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/umami/refs/heads/main/examples/umami-pageview-data-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/umami/refs/heads/main/examples/umami-metric-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/umami/refs/heads/main/examples/umami-session-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/umami/refs/heads/main/examples/umami-session-stats-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/umami/refs/heads/main/examples/umami-user-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/umami/refs/heads/main/examples/umami-team-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/umami/refs/heads/main/examples/umami-active-visitors-example.json
🔗
Postman
https://raw.githubusercontent.com/api-evangelist/umami/refs/heads/main/postman/umami-sessions-api.postman_collection.json
🔗
OpenCollection
https://raw.githubusercontent.com/api-evangelist/umami/refs/heads/main/collections/umami-sessions-api.opencollection.json
🔗
Postman
https://raw.githubusercontent.com/api-evangelist/umami/refs/heads/main/postman/umami-website-statistics-api.postman_collection.json
🔗
OpenCollection
https://raw.githubusercontent.com/api-evangelist/umami/refs/heads/main/collections/umami-website-statistics-api.opencollection.json

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/umami:umami-two-factor-authentication-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

umami-two-factor-authentication-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Umami Two-factor authentication API
  version: 3.3.1
  license:
    identifier: MIT
    name: MIT
  x-refined-note:
  - x-source differs across the merged source definitions and was not carried
  description: 'Operations tagged Two-factor authentication across 2 of this provider''s published API definitions: umami-openapi.json, umami-openapi.yml. Each path carries the servers of the definition it was published in.'
servers:
- url: https://{instance}
  description: Self-hosted Umami instance (paths begin with /api). Umami Cloud serves the same API at https://api.umami.is/v1 per docs.umami.is/docs/api.
  variables:
    instance:
      default: your-umami-instance.example.com
tags:
- name: Two-factor authentication
paths:
  /api/2fa/disable:
    post:
      description: Disables two-factor authentication for the current user after verifying their password and authenticator code. Rejected when an administrator or team requires it.
      operationId: disableTwoFactor
      requestBody:
        content:
          application/json:
            schema:
              properties:
                password:
                  description: Password used to authenticate the account.
                  type: string
                token:
                  maxLength: 6
                  minLength: 6
                  type: string
              required:
              - password
              - token
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                anyOf:
                - properties:
                    error:
                      description: Error details returned when the operation fails.
                      properties:
                        code:
                          type: string
                        lockedUntil:
                          description: Time until which further authentication attempts are blocked.
                          format: date-time
                          type: string
                        message:
                          description: Human-readable explanation of the result.
                          type: string
                      required:
                      - code
                      - message
                      - lockedUntil
                      type: object
                  required:
                  - error
                  type: object
                - properties:
                    ok:
                      description: Whether the operation succeeded.
                      type: boolean
                  required:
                  - ok
                  type: object
          description: The operation completed successfully.
        '400':
          content:
            application/json:
              example:
                error:
                  code: bad-request
                  message: Bad request.
                  status: 400
              schema:
                $ref: '#/components/schemas/ApiError'
          description: Bad request.
        '401':
          content:
            application/json:
              example:
                error:
                  code: unauthorized
                  message: Unauthorized.
                  status: 401
              schema:
                $ref: '#/components/schemas/ApiError'
          description: Unauthorized.
        '403':
          content:
            application/json:
              example:
                error:
                  code: forbidden
                  message: Forbidden.
                  status: 403
              schema:
                $ref: '#/components/schemas/ApiError'
          description: Forbidden.
        '404':
          content:
            application/json:
              example:
                error:
                  code: not-found
                  message: Not found.
                  status: 404
              schema:
                $ref: '#/components/schemas/ApiError'
          description: Not found.
        '429':
          content:
            application/json:
              schema:
                properties:
                  error:
                    description: Error details returned when the operation fails.
                    properties:
                      code:
                        type: string
                      lockedUntil:
                        description: Time until which further authentication attempts are blocked.
                        format: date-time
                        type: string
                      message:
                        description: Human-readable explanation of the result.
                        type: string
                    required:
                    - code
                    - message
                    - lockedUntil
                    type: object
                required:
                - error
                type: object
          description: The operation completed successfully.
        '503':
          content:
            application/json:
              example:
                error:
                  code: service-unavailable
                  message: Service unavailable.
                  status: 503
              schema:
                $ref: '#/components/schemas/ApiError'
          description: Service unavailable.
      security:
      - bearerAuth: []
      summary: Disable two-factor authentication
      tags:
      - Two-factor authentication
      x-umami-audience: public
      x-umami-contract: explicit
      x-umami-source: src/app/api/2fa/disable/contract.generated.ts
  /api/2fa/setup/cancel:
    post:
      description: Deletes the current user's pending setup without changing an already enabled authenticator.
      operationId: cancelTwoFactorSetup
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  ok:
                    description: Whether the operation succeeded.
                    type: boolean
                required:
                - ok
                type: object
          description: The operation completed successfully.
        '401':
          content:
            application/json:
              example:
                error:
                  code: unauthorized
                  message: Unauthorized.
                  status: 401
              schema:
                $ref: '#/components/schemas/ApiError'
          description: Unauthorized.
        '404':
          content:
            application/json:
              example:
                error:
                  code: not-found
                  message: Not found.
                  status: 404
              schema:
                $ref: '#/components/schemas/ApiError'
          description: Not found.
      security:
      - bearerAuth: []
      summary: Cancel two-factor authentication setup
      tags:
      - Two-factor authentication
      x-umami-audience: public
      x-umami-contract: explicit
      x-umami-source: src/app/api/2fa/setup/cancel/contract.generated.ts
  /api/2fa/setup/confirm:
    post:
      description: Verifies an authenticator code, enables two-factor authentication, and returns a new set of backup codes.
      operationId: confirmTwoFactorSetup
      requestBody:
        content:
          application/json:
            schema:
              properties:
                token:
                  maxLength: 6
                  minLength: 6
                  type: string
              required:
              - token
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                anyOf:
                - properties:
                    error:
                      description: Error details returned when the operation fails.
                      properties:
                        code:
                          type: string
                        lockedUntil:
                          description: Time until which further authentication attempts are blocked.
                          format: date-time
                          type: string
                        message:
                          description: Human-readable explanation of the result.
                          type: string
                      required:
                      - code
                      - message
                      - lockedUntil
                      type: object
                  required:
                  - error
                  type: object
                - properties:
                    backupCodes:
                      description: Single-use backup codes for two-factor authentication.
                      items:
                        type: string
                      type: array
                  required:
                  - backupCodes
                  type: object
          description: The operation completed successfully.
        '400':
          content:
            application/json:
              example:
                error:
                  code: bad-request
                  message: Bad request.
                  status: 400
              schema:
                $ref: '#/components/schemas/ApiError'
          description: Bad request.
        '401':
          content:
            application/json:
              example:
                error:
                  code: unauthorized
                  message: Unauthorized.
                  status: 401
              schema:
                $ref: '#/components/schemas/ApiError'
          description: Unauthorized.
        '404':
          content:
            application/json:
              example:
                error:
                  code: not-found
                  message: Not found.
                  status: 404
              schema:
                $ref: '#/components/schemas/ApiError'
          description: Not found.
        '429':
          content:
            application/json:
              schema:
                properties:
                  error:
                    description: Error details returned when the operation fails.
                    properties:
                      code:
                        type: string
                      lockedUntil:
                        description: Time until which further authentication attempts are blocked.
                        format: date-time
                        type: string
                      message:
                        description: Human-readable explanation of the result.
                        type: string
                    required:
                    - code
                    - message
                    - lockedUntil
                    type: object
                required:
                - error
                type: object
          description: The operation completed successfully.
        '503':
          content:
            application/json:
              example:
                error:
                  code: service-unavailable
                  message: Service unavailable.
                  status: 503
              schema:
                $ref: '#/components/schemas/ApiError'
          description: Service unavailable.
      security:
      - bearerAuth: []
      summary: Confirm two-factor authentication setup
      tags:
      - Two-factor authentication
      x-umami-audience: public
      x-umami-contract: explicit
      x-umami-source: src/app/api/2fa/setup/confirm/contract.generated.ts
  /api/2fa/setup/initiate:
    post:
      description: Starts or replaces the current user's pending setup and returns a QR code and manual setup key for an authenticator app.
      operationId: initiateTwoFactorSetup
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  manualKey:
                    description: Secret key for manually configuring an authenticator app.
                    type: string
                  qrCodeDataUrl:
                    description: Data URL of the QR code for authenticator setup.
                    type: string
                required:
                - qrCodeDataUrl
                - manualKey
                type: object
          description: The operation completed successfully.
        '400':
          content:
            application/json:
              example:
                error:
                  code: bad-request
                  message: Bad request.
                  status: 400
              schema:
                $ref: '#/components/schemas/ApiError'
          description: Bad request.
        '401':
          content:
            application/json:
              example:
                error:
                  code: unauthorized
                  message: Unauthorized.
                  status: 401
              schema:
                $ref: '#/components/schemas/ApiError'
          description: Unauthorized.
        '404':
          content:
            application/json:
              example:
                error:
                  code: not-found
                  message: Not found.
                  status: 404
              schema:
                $ref: '#/components/schemas/ApiError'
          description: Not found.
        '503':
          content:
            application/json:
              example:
                error:
                  code: service-unavailable
                  message: Service unavailable.
                  status: 503
              schema:
                $ref: '#/components/schemas/ApiError'
          description: Service unavailable.
      security:
      - bearerAuth: []
      summary: Set up two-factor authentication
      tags:
      - Two-factor authentication
      x-umami-audience: public
      x-umami-contract: explicit
      x-umami-source: src/app/api/2fa/setup/initiate/contract.generated.ts
  /api/2fa/status:
    get:
      description: Returns whether two-factor authentication is enabled, configured, or required for the current user, including the reason it is required.
      operationId: getTwoFactorStatus
      responses:
        '200':
          content:
            application/json:
              schema:
                anyOf:
                - properties:
                    globalRequired:
                      description: Whether two-factor authentication is required for all users.
                      type: boolean
                    isConfigured:
                      description: Whether two-factor authentication has been configured.
                      type: boolean
                    isEnabled:
                      description: Whether two-factor authentication is enabled.
                      type: boolean
                    isRequired:
                      description: Whether two-factor authentication is required for this user.
                      type: boolean
                    requiredReason:
                      description: Reason two-factor authentication is required.
                      type: 'null'
                  required:
                  - isEnabled
                  - isRequired
                  - requiredReason
                  - isConfigured
                  - globalRequired
                  type: object
                - properties:
                    globalRequired:
                      description: Whether two-factor authentication is required for all users.
                      type: boolean
                    isConfigured:
                      description: Whether two-factor authentication has been configured.
                      type: boolean
                    isEnabled:
                      description: Whether two-factor authentication is enabled.
                      type: boolean
                    isRequired:
                      description: Whether two-factor authentication is required for this user.
                      type: boolean
                    requiredReason:
                      description: Reason two-factor authentication is required.
                      type: string
                  required:
                  - isEnabled
                  - isRequired
                  - requiredReason
                  - isConfigured
                  - globalRequired
                  type: object
          description: The operation completed successfully.
        '401':
          content:
            application/json:
              example:
                error:
                  code: unauthorized
                  message: Unauthorized.
                  status: 401
              schema:
                $ref: '#/components/schemas/ApiError'
          description: Unauthorized.
      security:
      - bearerAuth: []
      summary: Get two-factor authentication status
      tags:
      - Two-factor authentication
      x-umami-audience: public
      x-umami-contract: explicit
      x-umami-source: src/app/api/2fa/status/contract.generated.ts
  /api/2fa/verify:
    post:
      description: Exchanges a partial sign-in token and a valid authenticator or backup code for a full authentication token and user details.
      operationId: verifyTwoFactor
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
              - properties:
                  token:
                    maxLength: 6
                    minLength: 6
                    type: string
                required:
                - token
                type: object
              - properties:
                  backupCode:
                    description: Single-use backup code for two-factor authentication.
                    minLength: 1
                    type: string
                required:
                - backupCode
                type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                anyOf:
                - properties:
                    error:
                      description: Error details returned when the operation fails.
                      properties:
                        code:
                          type: string
                        lockedUntil:
                          description: Time until which further authentication attempts are blocked.
                          format: date-time
                          type: string
                        message:
                          description: Human-readable explanation of the result.
                          type: string
                      required:
                      - code
                      - message
                      - lockedUntil
                      type: object
                  required:
                  - error
                  type: object
                - properties:
                    token:
                      type: string
                    user:
                      description: User associated with the resource.
                      properties:
                        createdAt:
                          description: Date and time the record was created.
                          format: date-time
                          type: string
                        id:
                          description: Unique identifier of the resource.
                          type: string
                        isAdmin:
                          description: Whether the user has administrator privileges.
                          type: boolean
                        role:
                          description: Permission role assigned to the user.
                          type: string
                        teams:
                          description: Teams associated with the user.
                          items:
                            properties:
                              id:
                                description: Unique identifier of the resource.
                                type: string
                              logoUrl:
                                description: URL of the logo image.
                                type: string
                              name:
                                description: Display name of the resource.
                                type: string
                            required:
                            - id
                            - logoUrl
                            - name
                            type: object
                          type: array
                        username:
                          description: Username of the account.
                          type: string
                      required:
                      - id
                      - username
                      - role
                      - createdAt
                      - isAdmin
                      - teams
                      type: object
                  required:
                  - token
                  - user
                  type: object
          description: The operation completed successfully.
        '400':
          content:
            application/json:
              example:
                error:
                  code: bad-request
                  message: Bad request.
                  status: 400
              schema:
                $ref: '#/components/schemas/ApiError'
          description: Bad request.
        '401':
          content:
            application/json:
              example:
                error:
                  code: unauthorized
                  message: Unauthorized.
                  status: 401
              schema:
                $ref: '#/components/schemas/ApiError'
          description: Unauthorized.
        '404':
          content:
            application/json:
              example:
                error:
                  code: not-found
                  message: Not found.
                  status: 404
              schema:
                $ref: '#/components/schemas/ApiError'
          description: Not found.
        '429':
          content:
            application/json:
              schema:
                properties:
                  error:
                    description: Error details returned when the operation fails.
                    properties:
                      code:
                        type: string
                      lockedUntil:
                        description: Time until which further authentication attempts are blocked.
                        format: date-time
                        type: string
                      message:
                        description: Human-readable explanation of the result.
                        type: string
                    required:
                    - code
                    - message
                    - lockedUntil
                    type: object
                required:
                - error
                type: object
          description: The operation completed successfully.
        '503':
          content:
            application/json:
              example:
                error:
                  code: service-unavailable
                  message: Service unavailable.
                  status: 503
              schema:
                $ref: '#/components/schemas/ApiError'
          description: Service unavailable.
      security: []
      summary: Complete two-factor sign-in
      tags:
      - Two-factor authentication
      x-umami-audience: public
      x-umami-contract: explicit
      x-umami-source: src/app/api/2fa/verify/contract.generated.ts
components:
  schemas:
    ApiError:
      additionalProperties: false
      description: Standard Umami API error response.
      properties:
        error:
          additionalProperties: {}
          description: Error details returned when the operation fails.
          properties:
            code:
              type: string
            message:
              description: Human-readable explanation of the result.
              type: string
            status:
              maximum: 9007199254740991
              minimum: -9007199254740991
              type: integer
          required:
          - message
          - code
          - status
          type: object
      required:
      - error
      type: object
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT
      description: Token returned by POST /api/auth/login, or an API key (`umami_…`) created under Settings → API keys (self-hosted only).
      scheme: bearer
      type: http
    shareContext:
      description: Required context header when authenticating with a share token.
      in: header
      name: x-umami-share-context
      type: apiKey
    shareToken:
      description: Signed token returned by a share endpoint.
      in: header
      name: x-umami-share-token
      type: apiKey
externalDocs:
  description: Umami API documentation
  url: https://docs.umami.is/docs/api
x-refined-from:
- umami-openapi.json
- umami-openapi.yml