Clear an account lockout with an emailed unlock token.
const url = 'https://api.tradr.cloud/api/auth/unlock';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"token":"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.tradr.cloud/api/auth/unlock \ --header 'Content-Type: application/json' \ --data '{ "token": "example" }'Public. Rate limited by client IP (10 / 15 min, the login posture — token guessing is primarily throttled by the token’s 256-bit entropy + 15 min TTL), tightening to 5 while the shared rate-limit store is unavailable. Atomically consumes the single-use account_unlock token and clears the per-address lock for its owner. Expired, already-consumed, unrecognized, and wrong-purpose tokens are indistinguishable: one generic 400 INVALID_OR_EXPIRED_TOKEN. An unlock for an address that is no longer locked still returns 200 — the token was spent. Sends no mail and stays functional when the instance has no email configured.
Request Bodyrequired
Section titled “Request Bodyrequired”object
The raw token from the emailed link’s URL fragment.
Examplegenerated
{ "token": "example"}Responses
Section titled “ Responses ”{ success: true } — the lock (if any) was cleared.
Validation error, or INVALID_OR_EXPIRED_TOKEN (expired / consumed / unknown / wrong purpose — one generic body).
Rate limit reached (IP-keyed).