Skip to content

Check that the key still works

GET/api/v1/account/status

Access
API key

Whether this API key still works (a light check for apps)

Bearer key only, any scope, no body. Answers 200 while the key works and 401 with the code of the first reason it does not — the order of every other request: API_KEY_INVALID (unknown key or deleted account), API_KEY_REVOKED, API_KEY_EXPIRED, ACCOUNT_BANNED (with reason when the account is shown one), ACCOUNT_ACCESS_CHANGED (the account was unblocked or «Выйти везде» was used: sign in again). The Windows app asks every 60 seconds while its window is open, every 120 in the tray and at once when its window comes to the front, and locks on a 401; network errors, 429 and 5xx never lock. Built to be cheap: the answer for a working key may come from memory for up to five minutes, but any ban, unblock or revoked key ends that at once, so a refusal is always current. Not written to the request log. The app's own User-Agent («lacuna-desktop/<version> (Windows <major.minor.build>)») is recorded for the console's list of computers at most every five minutes; nothing is decided by it. At most 20 checks per key and 600 per network per minute.

Example request

curl "https://lac.pics/api/v1/account/status" \
  -H "Authorization: Bearer lac_api_YOUR_KEY"

Responses

  • 200The key worksAccountCheck
    • okbooleanrequired

      values: true

    • checkAfterintegerrequired

      Seconds the server asks an app to wait before the next check while its window is open (the Windows app waits twice as long in the tray and clamps the value to 30–600).

      at least 1

  • 400Invalid trusted client address or malformed JSON before authentication; otherwise invalid request fields.
  • 401BEARER_REQUIRED, API_KEY_INVALID, API_KEY_REVOKED, API_KEY_EXPIRED, ACCOUNT_BANNED (optional reason), ACCOUNT_ACCESS_CHANGED.BEARER_REQUIRED
  • 413JSON body exceeds 1 MB before authentication; upload and quota limits may also refuse this operation.
  • 429RATE_LIMITED: the key or the network checks too often.
  • 500Unexpected failure; keep the key and check again later.
  • 503The required rate-limit service is unavailable; keep the key and check later.

Example response

200 · application/json
{
  "ok": true,
  "checkAfter": 1
}

Error codes

CodeStatusMessage
BEARER_REQUIRED401A Bearer key is required.

Answers of any method with a key (an invalid or expired key, a missing permission, too many requests) are in Errors.

Check that the key still works: GET /api/v1/account/status · lacuna API