Complete login with a recovery code
const url = 'https://api.aetherpush.com/v1/auth/mfa/recovery';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"pendingToken":"example","code":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.aetherpush.com/v1/auth/mfa/recovery \ --header 'Content-Type: application/json' \ --data '{ "pendingToken": "example", "code": "example" }'Consumes one unused recovery code for a pending login and, on success, issues the session access key. Each code works once. The response includes how many codes remain; when it reaches zero, the account owner should regenerate codes from the security settings.
Request Bodyrequired
Section titled “Request Bodyrequired”object
One of the recovery codes shown when they were generated.
Examplegenerated
{ "pendingToken": "example", "code": "example"}Responses
Section titled “Responses”MFA satisfied. Use the returned access key as a Bearer token.
object
Unused recovery codes left after consuming this one.
Examplegenerated
{ "accessKey": "example", "expires": 1, "remainingCodes": 1}Pending token or recovery code missing.
object
Human-readable error message.
Unique identifier for the request, also exposed as the X-Request-Id response header.
Example
{ "error": "The requested resource was not found.", "requestId": "req_abc123"}The pending login is invalid or the recovery code is wrong or already used.
object
Human-readable error message.
Unique identifier for the request, also exposed as the X-Request-Id response header.
Example
{ "error": "The requested resource was not found.", "requestId": "req_abc123"}Too many MFA attempts.
Returned with HTTP 429 when an endpoint-specific rate limit is hit.
retryAfterSeconds indicates how long the client should wait
before retrying.
object
Example
{ "error": "Too many login attempts. Please try again later.", "retryAfterSeconds": 900, "requestId": "req_abc123"}