API Reference
Project-level API key management
List API keys
Authorization
bearerAuth AuthorizationBearer <token>
In: header
Query Parameters
project_id*string
Response Body
application/json
curl -X GET "http://localhost:8080/v1/api-keys?project_id=string"[
{
"id": "string",
"project_id": "string",
"name": "string",
"key_prefix": "string",
"scopes": [
"string"
],
"expires_at": "2019-08-24T14:15:22Z",
"last_used_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"revoked_at": "2019-08-24T14:15:22Z",
"replaced_by_key_id": "string",
"grace_expires_at": "2019-08-24T14:15:22Z",
"environment_id": "string",
"rotation_interval_days": 0,
"next_rotation_at": "2019-08-24T14:15:22Z",
"rotation_webhook_url": "string"
}
]Create an API key
Authorization
bearerAuth AuthorizationBearer <token>
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "http://localhost:8080/v1/api-keys" \ -H "Content-Type: application/json" \ -d '{ "project_id": "string", "name": "string" }'{
"id": "string",
"project_id": "string",
"name": "string",
"key_prefix": "string",
"scopes": [
"string"
],
"expires_at": "2019-08-24T14:15:22Z",
"last_used_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"revoked_at": "2019-08-24T14:15:22Z",
"replaced_by_key_id": "string",
"grace_expires_at": "2019-08-24T14:15:22Z",
"environment_id": "string",
"rotation_interval_days": 0,
"next_rotation_at": "2019-08-24T14:15:22Z",
"rotation_webhook_url": "string"
}Revoke an API key
Authorization
bearerAuth AuthorizationBearer <token>
In: header
Path Parameters
keyID*string
Response Body
curl -X DELETE "http://localhost:8080/v1/api-keys/string"Empty
Rotate an API key with optional grace period
Authorization
bearerAuth AuthorizationBearer <token>
In: header
Path Parameters
keyID*string
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "http://localhost:8080/v1/api-keys/string/rotate" \ -H "Content-Type: application/json" \ -d '{}'{
"old_key_id": "string",
"new_key_id": "string",
"project_id": "string",
"name": "string",
"key": "string",
"key_prefix": "string",
"scopes": [
"string"
],
"expires_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"grace_expires_at": "2019-08-24T14:15:22Z"
}Was this page helpful?