staqlydocs
REST APIAPI referenceAuth

Recover access with the recovery key

Recover access with the recovery key (lost API key)

Every request sends Authorization: Bearer ...: the access token in local mode, an API key stk_... in cloud mode. Use Send to try it against your cloud instance with your API key.

POST
/v1/sessions/recover

The recovery key is single-use. In one transaction this sets a session cookie, creates a new admin API key (not counted against the plan's key limit), replaces the recovery key with a new one (the old one stops working) and signs out every other session of the workspace. On a plan with a key limit (Starter, Plus) the new admin key replaces the old admin keys, which are revoked; otherwise existing API keys keep working. The new API key and recovery key are returned only in this response. Rate-limited per client IP (429). Cloud only: the Community Edition (local mode) has no recovery key and no API keys (409); it signs in with its access token.

Request Body

application/json
  1. body
recovery_key*string

Response Body

Session cookie set; the new admin key and the next recovery key, shown once

application/json
  1. response
csrf_token*string
api_key*
recovery_key*string

Replaces the recovery key that was just used

curl -X POST 'https://staqly.example.com/v1/sessions/recover' \  -H 'Content-Type: application/json' \  -d '{  "recovery_key": "string"}'
{  "csrf_token": "string",  "api_key": {    "id": "string",    "name": "string",    "prefix": "string",    "scopes": [      "collections:read"    ],    "created_at": "string",    "last_used_at": "string",    "expires_at": "string",    "revoked_at": "string",    "key": "string"  },  "recovery_key": "string"}