API ReferenceApi keys
List API keys for a project
Returns every key on the project, revoked ones included — filter on revokedAt to show only live keys. Never returns a token or its hash: lastFour is the only fragment of the secret that survives creation.
Requires the api-keys:read scope — See which API keys exist, including what each one is allowed to do.
better-auth.session_token<token>
BetterAuth session cookie. Used by the dashboard / browser clients. When present, the active project is taken from the x-project-id header.
In: cookie
Path Parameters
id*string
Project id.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/api/projects/string/api-keys"{
"success": true,
"data": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"projectId": "5a8591dd-4039-49df-9202-96385ba3eff8",
"name": "string",
"lastFour": "string",
"legacyGrantPreset": "FULL",
"mode": "LIVE",
"scopes": [
"emails:send"
],
"domainId": "8a0b02c3-fdd8-452e-bc6e-ef07a335ec7e",
"lastUsedAt": "2019-08-24T14:15:22Z",
"createdAt": "2019-08-24T14:15:22Z",
"revokedAt": "2019-08-24T14:15:22Z"
}
]
}{
"success": false,
"error": {
"message": "string",
"code": "string",
"details": {
"errors": [
null
]
}
}
}{
"success": false,
"error": {
"message": "string",
"code": "string",
"details": {
"errors": [
null
]
}
}
}{
"success": false,
"error": {
"message": "string",
"code": "string",
"details": {
"errors": [
null
]
}
}
}{
"success": false,
"error": {
"message": "string",
"code": "string",
"details": {
"errors": [
null
]
}
}
}{
"success": false,
"error": {
"message": "string",
"code": "string",
"details": {
"errors": [
null
]
}
}
}{
"success": false,
"error": {
"message": "string",
"code": "string",
"details": {
"errors": [
null
]
}
}
}