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
| Name | Type | Required | Constraints | Description |
|---|---|---|---|---|
userId | integer | Yes | The unique ID for the specified user. |
Request body
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
password | string | Yes | User'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
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
otpAuthUri | string | Yes | read-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. |
secret | string | Yes | read-only (server-generated) | TOTP secret to be entered into an authenticator app. |
401 Authorization is required to access this resource.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
403 Request failed because of invalid data or denied permission.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
429 Request failed because of rate limit.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
500 An unexpected error has occurred.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
503 The service is temporarily unavailable.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |