Start activating 2FA

POST/users/{userId}/activate2FA/start

Base URL: https://api.tinkermode.com

To activate 2FA, a user must first obtain a time-based one-time passcode (TOTP) secret from this endpoint, and enter the secret into an authenticator app. Once the authenticator is seeded, the user should use the TOTP generated by the authenticator to complete the activation.

Authentication

Send an Authorization header of the form ModeCloud <AUTH_CODE>.

Must contain API key of the matching user.

Path parameters

NameTypeRequiredConstraintsDescription
userIdintegerYesThe unique ID for the specified user.

Request body

Content type: application/json

PropertyTypeRequiredConstraintsDescription
passwordstringYesUser's password.

Request example

{
  "password": "userpassword"
}

Responses

200 Activation process started. The returned object contains both the TOTP secret and a special otpauth URI. The URI embeds both the secret and other essential information about the TOTP. It is meant to be rendered as a QR code on a frontend application so that it can be easily consumed by an authenticator app.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
otpAuthUristringYesread-only (server-generated)An otpauth URI with the TOTP secret and other essential info embedded. It should be rendered as a QR code so that it can be easily consumed by an authenticator app.
secretstringYesread-only (server-generated)TOTP secret to be entered into an authenticator app.

401 Authorization is required to access this resource.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

403 Request failed because of invalid data or denied permission.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

429 Request failed because of rate limit.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

500 An unexpected error has occurred.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

503 The service is temporarily unavailable.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.