Liya Engine

API Keys

Retrieve API key status and rotate your key.

GET /dashboard/api-key

Returns API key metadata. The full key is never returned — only the masked preview.

GET https://api.liyaengine.ai/dashboard/api-key
Authorization: Bearer <jwt>

Response:

{
  "success": true,
  "data": {
    "hasKey": true,
    "maskedKey": "liya_F9y-...o4k",
    "createdAt": "2026-01-15T08:00:00Z",
    "lastUsedAt": "2026-03-14T22:41:07Z",
    "revokedAt": null
  }
}
FieldDescription
hasKeytrue if a valid, non-revoked key exists
maskedKeyPreview for UI display — e.g. liya_F9y-...o4k
lastUsedAtTimestamp of the last successful API call
revokedAtNon-null if the key was revoked

POST /dashboard/api-key/rotate

Generates a new API key and immediately invalidates the old one. The full key is returned once — save it.

POST https://api.liyaengine.ai/dashboard/api-key/rotate
Authorization: Bearer <jwt>

Response:

{
  "success": true,
  "data": {
    "apiKey": "liya_prod_a1b2c3d4e5f6...",
    "maskedKey": "liya_a1b-...f6g"
  },
  "message": "Save this key now — it will not be shown again."
}

After rotation:

  • The old key returns 401 INVALID_API_KEY immediately
  • All active integrations using the old key will fail until updated
  • lastUsedAt resets to null for the new key

On this page