List API keys
const url = 'https://api.deploybase.eu/api/v1/api/v1/api-keys';const options = {method: 'GET', headers: {Authorization: '<Authorization>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.deploybase.eu/api/v1/api/v1/api-keys \ --header 'Authorization: <Authorization>'Returns every API key of the current team, active, expired and revoked, newest first. Secrets are never returned; key_prefix identifies a key. expires_at is set only on agent keys. Each key carries last_event, its most recent request from the audit log (null when none in the 90-day retention), and requests_7d, its request count over the last 7 days; both include refused and failed requests. When activity cannot be read the keys are still returned, with activity_unavailable true.
Authorizations
Section titled “ Authorizations ”Responses
Section titled “ Responses ”OK
object
object
object
ActivityUnavailable is true when the keys’ activity could not be read: every last_event is then null and every requests_7d 0, which says nothing about usage.
object
LastEvent is the key’s most recent request in the audit log’s 90-day retention, failed ones included; null when it made none.
object
Client is the client the request claimed to come from (unverified); null when it named none.
CreatedAt is when the request was made, in UTC.
Outcome is “done” below 400, “refused” for 4xx and “failed” for 5xx.
Path is the route pattern (“/api/v1/projects/:id”), never a concrete URL. Empty when the stored path is not a known pattern.
Phrase is lowercase-first plain English: “created a deployment of {project}”, or “tried to create a deployment of {project}” when the request was refused or failed. It holds “{project}” if and only if project is non-null; render the name there.
Project is the project the request acted on; null when unknown or deleted.
object
Requests7d counts the key’s requests in the last 7 days (rolling), failed ones included. A lower bound: the audit writer sheds rows under load.
Example
{ "data": { "api_keys": [ { "kind": "standard", "last_event": { "client": "dashboard", "method": "POST", "outcome": "done", "path": "/api/v1/deployments", "phrase": "created a deployment of {project}", "status_code": 201 }, "requests_7d": 42 } ] }}Unauthorized
object
object
Example generated
{ "code": "example", "details": "example", "error": "example", "meta": { "request_id": "example", "timestamp": "example", "trace_id": "example" }}Forbidden
object
object
Example generated
{ "code": "example", "details": "example", "error": "example", "meta": { "request_id": "example", "timestamp": "example", "trace_id": "example" }}Internal Server Error
object
object
Example generated
{ "code": "example", "details": "example", "error": "example", "meta": { "request_id": "example", "timestamp": "example", "trace_id": "example" }}Live 174db30c built