Dashboard API
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
}
}| Field | Description |
|---|---|
hasKey | true if a valid, non-revoked key exists |
maskedKey | Preview for UI display — e.g. liya_F9y-...o4k |
lastUsedAt | Timestamp of the last successful API call |
revokedAt | Non-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_KEYimmediately - All active integrations using the old key will fail until updated
lastUsedAtresets tonullfor the new key