Verifies the code that was mailed to the user after a login from an unknown device, and logs the user in.
The response is the normal login response plus a deviceToken. Send that token as the X-Btcd-Device-Token
header with every following login from this device: it keeps the device trusted for 90 days after its last
use, until the user changes their password.
A wrong code, an unknown or an expired challenge all give ER922. After 5 wrong attempts on the same code the challenge is gone and the user has to log in again. A challenge expires 10 minutes after the login.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”object
The challengeId from the ER921 login response.
Example
9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08The 6-digit verification code the user received by email.
Example
123456Responses
Section titled “ Responses ”Code verified, user logged in. Same body as a successful POST /api/v1/user/login, plus deviceToken.
object
UUID of the user.
Example
60bd85f1-1b05-427f-9226-915b6b13f39eAuthentication token. Use this to request resources requiring user authentication.
Example
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5cRefresh token. Use this to request a new authenticatoin token.
Example
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5cSend as the X-Btcd-Device-Token header on the next logins from this device.
Example
b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944cA list of possible errors for this endpoint.
object
Example
{ "errors": { "ER048": { "code": "ER048", "message": "Invalid JSON data provided.", "solution": "Provide valid JSON data." }, "ER800": { "code": "ER800", "message": "Authorization token is invalid.", "solution": "Provide a valid authorization token." }, "ER801": { "code": "ER801", "message": "Authorization token has expired.", "solution": "Request a new authorization token." }, "ER802": { "code": "ER802", "message": "Authorization token not found.", "solution": "Provide an authorization token." }, "ER803": { "code": "ER803", "message": "Multiple authorization methods used.", "solution": "Use exactly one authorization method." }, "ER805": { "code": "ER805", "message": "API key is invalid.", "solution": "Provide a valid API key." }, "ER806": { "code": "ER806", "message": "API key not found.", "solution": "Provide an API key." }, "ER922": { "code": "ER922", "message": "Invalid or expired verification code.", "solution": "Ask the user to check the code, request a new one via POST /api/v1/user/login/verify/resend, or log in again." }, "ER999": { "code": "ER999", "message": "A general error has occurred. Please contact our support team.", "solution": "Contact our support team." } }}