VPSnet Service 2FA lock API

The server's 2FA lock ("2FA užraktas"). While it is switched on, every operation that changes the server, or hands out what is inside it, answers 423 serviceTwoFactorLocked unless this browser session has unlocked the server; API keys, the MCP and the AI assistant are refused the whole time. Reading the server, renewing and paying for it (invoices, price quotes, automatic renewal on or off) always work. Switching the lock on, unlocking and switching it off are for the owner's browser session only.

GitHub OpenAPI
Pull this API's OpenAPI, operations, scores and pricing into your own code or AI agent with a free APIs.io key — sign in with GitHub, Google or LinkedIn. No form to fill in; signing in shares your email address with us (Privacy).

Operations 5

GET /account/services/{orderNo}/twofa-lock Read the server's 2FA lock #
POST /account/services/{orderNo}/twofa-lock/enable Switch the server's 2FA lock on #
POST /account/services/{orderNo}/twofa-lock/unlock Unlock the server for a while #
POST /account/services/{orderNo}/twofa-lock/lock-now Lock the server again at once #
POST /account/services/{orderNo}/twofa-lock/disable Switch the server's 2FA lock off #

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/vpsnet-com:vpsnet-com-service-2fa-lock-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

vpsnet-com-service-2fa-lock-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: VPSnet Service 2FA lock API
  description: 'VPSnet API reference (v1).


    Authenticated endpoints use an API key in the `X-API-KEY` header.

    Create a key in the control panel: Account → API keys

    (https://www.vpsnet.com/en/management/account/api-keys).

    Public endpoints are available under `/public/*` without authentication.

    This specification is intentionally partial and may omit fields from responses.


    Every error response follows `ErrorEnvelope`: `success: false`, a stable

    error code as a top-level boolean key, and any actionable context as

    further top-level keys (`requiredScope`, `retryAfter`/`retry_after`,

    `usageAccess`, `guestAgent`, `state`, and similar). Responses that carry

    such context now repeat it inside a nested `error_detail` object keyed by

    the same error code, so one parsing strategy works everywhere. The flat

    keys are unchanged and remain authoritative; `error_detail` is additive and

    may be ignored.

    Private networking paths resolve to private-networking-v1.yml; contract v2

    capability discovery resolves to private-networking-v2.yml. Their errors use

    reason_code alongside success=false, with explicit same-key retry advice

    for uncertain mutation outcomes.

    Service hostname/PTR operations resolve to service-identity-v1.yml. The

    isolated OpenAI-compatible inference API is published separately as

    managed-inference-v1.yml because it uses a different base URL and bearer

    credential boundary.'
  termsOfService: https://www.vpsnet.com/en/information/term-of-service
  contact:
    email: info@vpsnet.com
  version: 1.0.0
  license:
    name: VPSnet API Terms
    url: https://www.vpsnet.com/en/information/term-of-service
servers:
- url: https://api.vpsnet.com
  description: Production
tags:
- name: Service 2FA lock
  description: The server's 2FA lock ("2FA užraktas"). While it is switched on, every operation that changes the server, or hands out what is inside it, answers 423 serviceTwoFactorLocked unless this browser session has unlocked the server; API keys, the MCP and the AI assistant are refused the whole time. Reading the server, renewing and paying for it (invoices, price quotes, automatic renewal on or off) always work. Switching the lock on, unlocking and switching it off are for the owner's browser session only.
paths:
  /account/services/{orderNo}/twofa-lock:
    get:
      tags:
      - Service 2FA lock
      summary: Read the server's 2FA lock
      description: Whether the server's 2FA lock ("2FA užraktas") is switched on, which authenticator it uses, and whether this browser session has it unlocked and until when. Never carries a secret or a code. An API key needs services:read.
      operationId: getServiceTwoFactorLock
      parameters:
      - $ref: '#/components/parameters/OrderNo'
      responses:
        '200':
          description: The lock's state for this caller
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceTwoFactorLockAnswer'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '503':
          $ref: '#/components/responses/ErrorResponse'
      security:
      - apiKey: []
      - sessionBearer: []
  /account/services/{orderNo}/twofa-lock/enable:
    post:
      tags:
      - Service 2FA lock
      summary: Switch the server's 2FA lock on
      description: 'Browser session of the owner only: an API key (and so the MCP), the AI assistant, an administrator logged in as the customer and a session without a browser login answer 403 serviceTwoFactorLockForbidden with a reason. mode "account" uses the account''s authenticator app and needs a current code from it. mode "server" gives the server an authenticator of its own in two steps: without a code the answer carries the new secret and its QR code (the only answer that ever does; the offer expires after 30 minutes); with the first code from that secret the lock is switched on and the answer carries 10 one-time recovery codes (the only answer that ever does). An e-mailed PIN is never accepted.'
      operationId: enableServiceTwoFactorLock
      parameters:
      - $ref: '#/components/parameters/OrderNo'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ServiceTwoFactorLockEnableRequest'
      responses:
        '200':
          description: 'Mode "server" without a code: the enrolment offer. Mode "server" with a code: the recovery codes and the state. Mode "account": the state.'
          content:
            application/json:
              schema:
                oneOf:
                - $ref: '#/components/schemas/ServiceTwoFactorLockEnrolmentOffer'
                - $ref: '#/components/schemas/ServiceTwoFactorLockEnabled'
                - $ref: '#/components/schemas/ServiceTwoFactorLockAnswer'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '409':
          description: alreadyEnabled, enrolmentExpired or accountAuthenticatorMissing
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '422':
          description: invalidMode (with modes) or invalidCode
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '503':
          $ref: '#/components/responses/ErrorResponse'
      security:
      - sessionBearer: []
  /account/services/{orderNo}/twofa-lock/unlock:
    post:
      tags:
      - Service 2FA lock
      summary: Unlock the server for a while
      description: Browser session of the owner only (403 serviceTwoFactorLockForbidden otherwise). The challenge is a current code of the lock's authenticator (each 30-second step once) or, in mode "server", one recovery code. The unlock holds for the chosen period (900, 3600, 14400 or 86400 seconds; default 900) and only for THIS browser session; another session of the account stays locked, and API keys, the MCP and the AI assistant stay refused the whole time. Five wrong codes within 5 minutes block the unlock for 15 minutes (429).
      operationId: unlockServiceTwoFactorLock
      parameters:
      - $ref: '#/components/parameters/OrderNo'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ServiceTwoFactorLockUnlockRequest'
      responses:
        '200':
          description: Unlocked; unlockedUntil and unlockPeriodSeconds are set
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceTwoFactorLockAnswer'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '409':
          description: 'notEnabled, accountAuthenticatorMissing, or accountAuthenticatorChanged (with usableAt: a newly enrolled account app unlocks only 24 hours after it was first seen)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '422':
          description: invalidPeriod (with periods) or invalidCode
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '429':
          description: tooManyAttempts (with retryAfter and blockedUntil)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '503':
          $ref: '#/components/responses/ErrorResponse'
      security:
      - sessionBearer: []
  /account/services/{orderNo}/twofa-lock/lock-now:
    post:
      tags:
      - Service 2FA lock
      summary: Lock the server again at once
      description: Ends every open unlock of the server. Needs no code. Allowed to the owner's sessions and to an API key with services:manage (taking access away is never refused).
      operationId: lockServiceTwoFactorLockNow
      parameters:
      - $ref: '#/components/parameters/OrderNo'
      responses:
        '200':
          description: Locked
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceTwoFactorLockAnswer'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '409':
          description: notEnabled
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '503':
          $ref: '#/components/responses/ErrorResponse'
      security:
      - apiKey: []
      - sessionBearer: []
  /account/services/{orderNo}/twofa-lock/disable:
    post:
      tags:
      - Service 2FA lock
      summary: Switch the server's 2FA lock off
      description: Browser session of the owner only (403 serviceTwoFactorLockForbidden otherwise), with a current code of the lock's authenticator or, in mode "server", one recovery code. Immediate; the account gets an e-mail. Wrong codes count towards the same limit as unlock.
      operationId: disableServiceTwoFactorLock
      parameters:
      - $ref: '#/components/parameters/OrderNo'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ServiceTwoFactorLockCodeRequest'
      responses:
        '200':
          description: Switched off; enabled is false
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceTwoFactorLockAnswer'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '409':
          description: notEnabled, accountAuthenticatorMissing or accountAuthenticatorChanged (with usableAt)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '422':
          description: invalidCode
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '429':
          description: tooManyAttempts (with retryAfter and blockedUntil)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '503':
          $ref: '#/components/responses/ErrorResponse'
      security:
      - sessionBearer: []
components:
  schemas:
    ServiceTwoFactorLockState:
      type: object
      description: The server's 2FA lock as this caller sees it. Times are ISO 8601 UTC. Never carries a secret or a code.
      required:
      - enabled
      - mode
      - locked
      - unlockedUntil
      - unlockPeriodSeconds
      - enrolmentPending
      - recoveryCodesLeft
      - blockedUntil
      - accountAuthenticator
      - accountAuthenticatorUsableAt
      - accountAuthenticatorEnrolled
      - periods
      - defaultPeriod
      properties:
        enabled:
          type: boolean
        mode:
          type:
          - string
          - 'null'
          enum:
          - account
          - server
          - null
          description: account - the account's authenticator app; server - an authenticator of this server's own
        locked:
          type: boolean
          description: Switched on and not unlocked by THIS browser session
        unlockedUntil:
          type:
          - string
          - 'null'
          format: date-time
        unlockPeriodSeconds:
          type:
          - integer
          - 'null'
        enrolmentPending:
          type: boolean
          description: A mode "server" offer of this browser session waits for its first code
        recoveryCodesLeft:
          type:
          - integer
          - 'null'
          description: Mode "server" only
        blockedUntil:
          type:
          - string
          - 'null'
          format: date-time
          description: Unlock and switch-off are blocked until then after too many wrong codes
        accountAuthenticator:
          type:
          - string
          - 'null'
          enum:
          - present
          - missing
          - changed
          - replaced_usable
          - null
          description: Mode "account" only
        accountAuthenticatorUsableAt:
          type:
          - string
          - 'null'
          format: date-time
          description: When a newly enrolled account app may unlock (24 hours after it was first seen)
        accountAuthenticatorEnrolled:
          type: boolean
        periods:
          type: array
          items:
            type: integer
            enum:
            - 900
            - 3600
            - 14400
            - 86400
        defaultPeriod:
          type: integer
          enum:
          - 900
      additionalProperties: false
    ServiceTwoFactorLockCodeRequest:
      type: object
      required:
      - code
      properties:
        code:
          type: string
          description: A current authenticator code, or in mode "server" one recovery code
      additionalProperties: false
    ServiceTwoFactorLockEnabled:
      type: object
      required:
      - success
      - recoveryCodes
      - twoFactorLock
      properties:
        success:
          type: boolean
          enum:
          - true
        recoveryCodes:
          type: array
          minItems: 10
          maxItems: 10
          items:
            type: string
          description: Shown once; each one unlocks or switches the lock off once
        twoFactorLock:
          $ref: '#/components/schemas/ServiceTwoFactorLockState'
      additionalProperties: false
    ServiceTwoFactorLockAnswer:
      type: object
      required:
      - success
      - twoFactorLock
      properties:
        success:
          type: boolean
          enum:
          - true
        twoFactorLock:
          $ref: '#/components/schemas/ServiceTwoFactorLockState'
      additionalProperties: false
    ErrorDetail:
      type: object
      description: Machine-readable remediation for the error in the same body. It repeats the error code and mirrors the actionable context that also appears as flat top-level keys. It never carries a credential value or a reveal receipt. The flat keys stay authoritative; a client that ignores error_detail keeps working unchanged.
      required:
      - code
      properties:
        code:
          type: string
          description: Repeats the stable error key of this response, for example apiKeyScopeMissing, actionInProgress, or rateLimited.
        message_key:
          type: string
          description: Translation key for a customer-facing message.
        reason:
          type: string
          description: Stable machine reason for the failure.
        field:
          type: string
          description: Request field that caused a validation failure.
        accepted:
          type: array
          description: Accepted values for the rejected field.
          items:
            type: string
        credentials:
          type: array
          description: Names of generated credentials that forced this failure. Names only; never a value.
          items:
            type: string
        resolution:
          type: array
          description: Request shapes that resolve this failure. Each entry names a request field and the exact value to send.
          items:
            type: object
            required:
            - field
            - value
            properties:
              field:
                type: string
              value: {}
              requires:
                type: array
                items:
                  type: string
              description_key:
                type: string
            additionalProperties: true
        discover_at:
          type: string
          description: Read operation and response path that advertises this requirement before the mutation is attempted.
        retry_after:
          type: integer
          minimum: 1
          description: Seconds to wait before retrying a rate-limited request. Mirrors the Retry-After header and whichever flat spelling the endpoint emits.
      additionalProperties: true
    ServiceTwoFactorLockUnlockRequest:
      type: object
      required:
      - code
      properties:
        code:
          type: string
          description: A current authenticator code, or in mode "server" one recovery code
        period:
          type: integer
          enum:
          - 900
          - 3600
          - 14400
          - 86400
          default: 900
      additionalProperties: false
    ServiceTwoFactorLockEnableRequest:
      type: object
      required:
      - mode
      properties:
        mode:
          type: string
          enum:
          - account
          - server
        code:
          type: string
          description: 'Mode "account": a current code of the account''s app (required). Mode "server": omit to get the offer; send the first code of the new secret to switch the lock on.'
      additionalProperties: false
    ServiceTwoFactorLockEnrolmentOffer:
      type: object
      required:
      - success
      - enrolment
      properties:
        success:
          type: boolean
          enum:
          - true
        enrolment:
          type: object
          required:
          - secret
          - otpauthUri
          - qrCode
          - algorithm
          - expiresAt
          properties:
            secret:
              type: string
              description: Shown once; enter it in the authenticator app
            otpauthUri:
              type: string
            qrCode:
              type:
              - string
              - 'null'
              description: Base64 PNG of otpauthUri; null when the server cannot draw it (draw it from otpauthUri)
            algorithm:
              type: string
            expiresAt:
              type: string
              format: date-time
          additionalProperties: false
      additionalProperties: false
    ErrorEnvelope:
      type: object
      description: 'Error responses always carry success: false, a stable error code as a top-level boolean key, and any actionable context as further top-level keys (requiredScope, retryAfter/retry_after, usageAccess, guestAgent, state, and similar). Responses that carry such context additionally repeat it inside error_detail, keyed by the error code, so one parsing strategy works across the API. The flat keys are never removed or renamed.'
      required:
      - success
      properties:
        success:
          type: boolean
          enum:
          - false
        message:
          type: string
          description: Optional human-readable message. Not machine-readable.
        error_detail:
          $ref: '#/components/schemas/ErrorDetail'
      additionalProperties: true
  responses:
    UnauthorizedError:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    ErrorResponse:
      description: Request refused. See ErrorEnvelope for the flat error code and the mirrored error_detail object.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
  parameters:
    OrderNo:
      name: orderNo
      in: path
      required: true
      description: Tenant-owned service order number, for example VP88318.
      schema:
        type: string
        minLength: 1
        maxLength: 64
  securitySchemes:
    apiKey:
      type: apiKey
      name: X-API-KEY
      in: header
      description: Account API key (`vpsnet_` + 43 characters). Every key has one request budget of 300 requests per 60 seconds by default; some operations have lower limits of their own. A refused request answers 429 with retry_after in the body and the same value in the Retry-After header, plus X-RateLimit-Limit and X-RateLimit-Remaining. API keys cannot create, change or revoke API keys (403 apiKeyForbidden, reason api_keys_cannot_manage_api_keys).
    mcpOAuth:
      type: oauth2
      description: 'AI connection (MCP client) token issued by the VPSnet OAuth 2.1 authorization server, sent as `Authorization: Bearer vpsnet_...`. Discovery: /.well-known/oauth-authorization-server/oauth/mcp. A client registers dynamically (POST /oauth/mcp/register; public, or with a secret sent by HTTP Basic or in the form body), identifies itself by a client ID metadata document URL, or uses an application the customer created in the control panel (AI connections; client ID and secret, approvable only by that account). Every client must use S256 PKCE. A `resource` parameter, when sent, must equal the VPSnet MCP server address exactly; when omitted, that address is meant. The scope names offline_access, openid, profile and email are accepted and grant nothing; any other unknown scope is refused. The customer approves the connection in the control panel; it ends 30 days after approval. Access tokens last at most 15 minutes; refresh tokens rotate on every use and a replayed one revokes the whole connection.'
      flows:
        authorizationCode:
          authorizationUrl: https://api.vpsnet.com/oauth/mcp/authorize
          tokenUrl: https://api.vpsnet.com/oauth/mcp/token
          refreshUrl: https://api.vpsnet.com/oauth/mcp/token
          scopes:
            orders:read: Inspect plans and purchase receipts on the same connection
            orders:servers: Order servers from balance within approved limits
            orders:domains: Register domains from balance within approved limits
            services:read: Read the selected services
            services:manage: Start, stop, restart and rename the selected services
            applications:read: Read applications on the selected services
            applications:manage: Install and manage applications on the selected services
            networking:read: Read account networking
            networking:manage: Change account networking (no orders or payments)
            functions:read: Read Firecracker Functions
            functions:manage: Manage Firecracker Functions
            functions:invoke: Run Functions with explicit usage-billing consent and a daily account-usage ceiling
            vm:diagnostics: Inspect OS, processes, services, ports and containers with fixed diagnostics
            vm:files:read: Read files on selected Linux servers
            vm:files:write: Create and replace files on selected Linux servers
            services:reinstall: Reinstall the selected server operating system
            services:restore: Restore or delete existing server snapshots
            vm:exec: Run commands as root on the selected Linux servers
            vm:files: Read and write files on the selected Linux servers
    sessionBearer:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Interactive VPSnet portal session; X-API-KEY is not accepted
x-related-apis:
- name: VPSnet AI Inference API
  url: https://www.vpsnet.com/managed-inference-v1.yml