API keys
List, create and revoke API keys.
A key acts as the user who owns it, with that user's permissions. You only see and manage your own user's keys. Up to 25 usable keys; expired and revoked keys do not count. See Authentication.
Keys look like omk_1a2b3c4d.<secret>. The part before the dot is the public keyPrefix. Only a hash is stored, so a lost secret cannot be recovered.
List keys
Returns your keys. The secret is never listed.
{
"ok": true,
"items": [
{
"id": "c7a2...",
"name": "Production backend",
"keyPrefix": "omk_1a2b3c4d",
"description": null,
"expiresAt": null,
"lastUsedAt": "2026-10-21T09:58:00.000Z",
"createdAt": "2026-10-01T12:00:00.000Z"
}
],
"total": 1,
"page": 1,
"pageSize": 20
}Create a key
Creates a key and returns its secret once. Dashboard session only, so a leaked key cannot mint keys that outlive its own revocation. The dashboard calls this when you click Create key.
SESSION_REQUIRED.curl -X POST "https://apiv2.tronergy.io/api/customer_api_keys/portal/keys" \
-H "Cookie: <portal-session-cookie>" \
-H "Content-Type: application/json" \
-d '{
"name": "Production backend",
"expiresAt": "2027-10-01T00:00:00Z"
}'namestringrequired1-120 characters.
descriptionstring | nullUp to 1000 characters.
expiresAtstring | nullISO date in the future. Leave out or null for no expiry.
{
"ok": true,
"id": "d81f...",
"name": "Production backend",
"keyPrefix": "omk_9f8e7d6c",
"secret": "omk_9f8e7d6c.<48 hex characters>",
"expiresAt": "2027-10-01T00:00:00.000Z",
"createdAt": "2026-10-21T10:00:00.000Z"
}secret is shown once. Store it in your secret manager right away.
Errors: 422 limit_reached (25 usable keys already), 422 Validation failed, 403 SESSION_REQUIRED.
Revoke a key
The key stops working immediately. You can revoke the key you are calling with. Pass id in the query string: DELETE /api/customer_api_keys/portal/keys?id=<id>.
{ "ok": true, "success": true }Errors: 404 Missing or invalid id parameter, 404 Key not found (unknown, already revoked or not yours).