Skip to main content

API Keys

These endpoints manage application API keys (keys with the ptla_ prefix). See authentication for how keys are used.

info

An application key has the access of the account that owns it. The legacy r_* permission columns can still be set when creating a key, but the Panel never checks them. Nothing in the Panel calls AdminAcl::check(), and the Application API only looks at the key owner's root admin flag and admin role.

List application keys​

GET /api/application/api

Admin permission: api.read

Returns a paginated list of all application keys on the Panel, whichever account owns them. Client (ptlc_) keys are not included.

curl "https://panel.example.com/api/application/api?per_page=50" \
-H "Authorization: Bearer $API_KEY" \
-H "Accept: application/json"

Query parameters​

ParameterTypeRequiredDescription
per_pageintegerNo1 to 100. Defaults to 20. See pagination.
pageintegerNoPage number.
filter[id]stringNoPartial match on the key ID.
filter[identifier]stringNoPartial match on the identifier.
filter[last_used_at]stringNoPartial match on the last used date.
sortstringNoid, identifier or last_used_at, optionally prefixed with -. See filtering and sorting.

Response​

200 OK

{
"object": "list",
"data": [
{
"object": "api_key",
"attributes": {
"id": 4,
"identifier": "ptla_aB3dE5fG7hJ",
"description": "Billing integration",
"allowed_ips": null,
"created_at": "2026-11-20T14:02:11+00:00",
"last_used_at": "2026-11-26T09:12:40Z"
}
}
],
"meta": {
"pagination": {
"total": 1,
"count": 1,
"per_page": 20,
"current_page": 1,
"total_pages": 1,
"links": []
}
}
}
AttributeTypeDescription
idintegerKey ID. Use it to delete the key.
identifierstringThe first 16 characters of the key: ptla_ and 11 random characters.
descriptionstringThe key's memo.
allowed_ipsarray or nullIP restrictions. Keys created with this API have null.
created_atstringISO 8601 date with offset.
last_used_atstring or nullISO 8601 date in UTC with a Z suffix, or null if the key was never used.

The secret part of the key is never returned.

Create an application key​

POST /api/application/api

Admin permission: api.create

Creates an application key owned by the calling account and returns the full key.

Request body​

JSON body.

FieldTypeRequiredDescription
memostringYesA description of the key. At most 500 characters.
permissionsobject or nullNoLegacy permission columns. See below.

The permissions field​

permissions may only contain the legacy columns r_servers, r_nodes, r_allocations, r_users, r_locations, r_nests, r_eggs, r_database_hosts and r_server_databases. Each value must be an integer from 0 to 3 (the Panel UI sends "0", "1" or "2"). Any other key is rejected with 422. The values are stored but not enforced.

Leave permissions out, or send null or {}, to set none of them. The columns then use their database default of 0. Only these columns are taken from permissions, so it cannot change the key's owner, type, identifier or secret. The new key is always owned by the calling account.

Example:

{
"memo": "Billing integration",
"permissions": { "r_servers": 3 }
}

Logs the activity event admin:api-keys:create with the new key as the subject.

Response​

200 OK

{
"token": "ptla_aB3dE5fG7hJx9Kp2Lq8Rt4Vw6Yz1Ac3Ef5Gh7Jk9M"
}

token is the full 48 character key: the 16 character identifier followed by the 32 character secret. It is shown only in this response.

Delete an application key​

DELETE /api/application/api/{key}

Admin permission: api.delete

Deletes an application API key.

Path parameters​

ParameterDescription
keyThe key's numeric id.

Logs the activity event admin:api-keys:delete with the key as the subject.

Response​

204 No Content

Errors​

StatusWhen
404No API key has this ID, or the key is not an application (ptla_) key. Client keys cannot be deleted here.