# Circles # API Keys ## List API keys for a circle **get** `/api/circles/{id}/api-keys` Returns metadata for all API keys scoped to a circle. Caller must be the circle owner or an admin. ### Path Parameters - `id: string` ### Returns - `keys: optional array of object { id, createdAt, lastUsedAt, 2 more }` - `id: optional string` - `createdAt: optional string` - `lastUsedAt: optional string` - `name: optional string` - `prefix: optional string` ### Example ```http curl https://racks.cash/api/circles/$ID/api-keys ``` #### Response ```json { "keys": [ { "id": "id", "createdAt": "2019-12-27T18:11:19.117Z", "lastUsedAt": "2019-12-27T18:11:19.117Z", "name": "name", "prefix": "prefix" } ] } ``` ## Create a circle API key **post** `/api/circles/{id}/api-keys` Creates a new `racks_circle_…` API key for the circle. Caller must be the owner or an admin. The full key is returned once. ### Path Parameters - `id: string` ### Body Parameters - `name: optional string` ### Returns - `id: optional string` - `key: optional string` Full `racks_circle_…` token — store it now ### Example ```http curl https://racks.cash/api/circles/$ID/api-keys \ -X POST ``` #### Response ```json { "id": "id", "key": "key" } ``` ## Revoke a circle API key **delete** `/api/circles/{id}/api-keys/{keyId}` Permanently revokes a circle API key. Caller must be the circle owner or an admin. ### Path Parameters - `id: string` - `keyId: string` ### Returns - `deleted: optional boolean` ### Example ```http curl https://racks.cash/api/circles/$ID/api-keys/$KEY_ID \ -X DELETE ``` #### Response ```json { "deleted": true } ```