This endpoint can be used to authenticate a user, and retrieve a token to use in endpoints which require an authenticated user.
When login device verification is enabled, a correct password from a device that is not trusted yet is answered
with HTTP 403, ER921 and a challengeId: the user received a 6-digit code by email. Complete the login with
POST /api/v1/user/login/verify, which returns the tokens plus a deviceToken. Send that token as the
X-Btcd-Device-Token header on every later login from the same device to skip the code. The device stays
trusted for 90 days after its last use, until the password changes.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Header Parameters
Section titled “Header Parameters ”Device token from an earlier POST /api/v1/user/login/verify on this device.
Request Body required
Section titled “Request Body required ”object
Password of the user.
Example
kDWPe4qf$&mgM26&8hXResponses
Section titled “ Responses ”User logged in successfully.
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_adQssw5cA list of possible errors for this endpoint.
object
Example
{ "errors": { "ER001": { "code": "ER001", "message": "Email address is invalid.", "solution": "Provide a valid email address." }, "ER003": { "code": "ER003", "message": "No email address provided.", "solution": "Provide a valid email address." }, "ER004": { "code": "ER004", "message": "No password provided.", "solution": "Provide the password of the user." }, "ER005": { "code": "ER005", "message": "Invalid login details provided.", "solution": "Tell the user to provide valid authentication details, or inform them about the 'forgot password' functionality." }, "ER700": { "code": "ER700", "message": "User authorization token not found.", "solution": "Provide a user authorization token." }, "ER701": { "code": "ER701", "message": "User authorization token has expired.", "solution": "Request a new authorization token, or refresh the token." }, "ER702": { "code": "ER702", "message": "User authorization token is invalid.", "solution": "Provide a valid user authorization token." }, "ER703": { "code": "ER703", "message": "User identifier does not belong to the user in the user authorization token.", "solution": "Provide a valid user identifier, or remove the user identifier header." }, "ER704": { "code": "ER704", "message": "No user identifier found in headers.", "solution": "Provide a valid user identifier, or use the user/password authentication mechanism to request a user token and send that." }, "ER705": { "code": "ER705", "message": "User identifier is not linked to a user.", "solution": "Provide a valid user identifier, link this user identifier to a user account, or use the user/password authentication mechanism." }, "ER706": { "code": "ER706", "message": "User identifier is invalid.", "solution": "Provide a valid user identifier, a unique identifier string for the user account that is not already in use." }, "ER707": { "code": "ER707", "message": "User identifier is invalid.", "solution": "Please provide an identifier, consisting of 36 - 255 characters, numeric or alphanumeric only." }, "ER708": { "code": "ER708", "message": "There is a pending document for this side.", "solution": "Wait for the pending document to be reviewed." }, "ER709": { "code": "ER709", "message": "User not found, or user has been deleted.", "solution": "Provide a valid user identifier." }, "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." }, "ER999": { "code": "ER999", "message": "A general error has occurred. Please contact our support team.", "solution": "Contact our support team." } }}ER921: correct password, but the device must be verified with the code that was emailed to the user. No tokens are returned.
object
object
Example
{ "ER921": { "code": "ER921", "message": "Device verification required.", "solution": "..." }}Pass to POST /api/v1/user/login/verify and /api/v1/user/login/verify/resend.
Example
9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08ER920: too many login attempts, or too many verification codes were emailed to this account. See the Retry-After header.