Skip to main content

API Keys

These endpoints manage the client API keys (ptlc_ keys) on your own account. See authentication for how keys are built and used.

None of these endpoints need a subuser permission.

List API keys​

GET /api/client/account/api-keys

Returns every client API key on the account. The list is not paginated. The secret part of a key is never returned.

curl "https://panel.example.com/api/client/account/api-keys" \
-H "Authorization: Bearer $API_KEY" \
-H "Accept: application/json"

Response​

200 OK

{
"object": "list",
"data": [
{
"object": "api_key",
"attributes": {
"identifier": "ptlc_Xk2mP9qL7vR",
"description": "Deploy script",
"allowed_ips": ["203.0.113.10", "198.51.100.0/24"],
"last_used_at": "2026-11-25T18:02:41.000000Z",
"created_at": "2026-09-14T12:00:00+00:00"
}
}
]
}
AttributeTypeDescription
identifierstringThe 16 character identifier: ptlc_ followed by 11 random characters. Use it to delete the key.
descriptionstringThe key's description.
allowed_ipsarray of stringsIP addresses and CIDR ranges allowed to use the key. An empty array means any address.
last_used_atstring or nullWhen the key was last used, as an ISO 8601 string with microseconds in UTC, or null if never.
created_atstringISO 8601.

Create an API key​

POST /api/client/account/api-keys

Creates a new client API key. An account can have at most 25 client API keys.

Request body​

JSON body.

FieldTypeRequiredDescription
descriptionstringYesAt most 500 characters. Must not be empty.
allowed_ipsarray of stringsNoUp to 50 entries. Each must be a valid IPv4 or IPv6 address or CIDR range. May be null. Omit it, or send an empty array, to allow any address.

Response​

200 OK

{
"object": "api_key",
"attributes": {
"identifier": "ptlc_Xk2mP9qL7vR",
"description": "Deploy script",
"allowed_ips": [],
"last_used_at": null,
"created_at": "2026-11-26T10:12:09+00:00"
},
"meta": {
"secret_token": "a8Df0QwZ3npL4sT9rB2cGm7hY1uK5eVn"
}
}

meta.secret_token is the 32 character secret only. The full API key is the identifier followed directly by secret_token:

ptlc_Xk2mP9qL7vRa8Df0QwZ3npL4sT9rB2cGm7hY1uK5eVn

The secret is returned only in this response. Store it now: the Panel cannot show it again.

Logs the activity event user:api-key.create with the property identifier.

Errors​

StatusWhen
400The account already has 25 client API keys. detail: You have reached the account limit for number of API keys.
422An allowed_ips entry is not a valid address or range. The error is on allowed_ips.<index> with the detail "<value>" is not a valid IP address or CIDR range.

Delete an API key​

DELETE /api/client/account/api-keys/{identifier}

Deletes one of your client API keys. The key stops working immediately. You can delete the key you are using to make the request.

Path parameters​

ParameterDescription
identifierThe key's 16 character identifier, for example ptlc_Xk2mP9qL7vR.

Response​

204 No Content

Logs the activity event user:api-key.delete with the property identifier.

Errors​

StatusWhen
404No client API key on your account has that identifier.