CapyDB Docs
ReferenceAPI

A P I Keys

Org and project-scoped API key management.

GET
/v1/organizations/{orgID}/api-keys

Authorization

AuthorizationBearer <token>

Org or project-scoped API key, format capy_live_...; Clerk session tokens also accepted.

In: header

Path Parameters

orgID*string

Organization id.

Response Body

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/v1/organizations/string/api-keys"
{  "api_keys": [    {      "created_at": "2019-08-24T14:15:22Z",      "created_by_user_id": "string",      "device_name": "string",      "expires_at": "2019-08-24T14:15:22Z",      "id": "string",      "is_active": true,      "key_prefix": "string",      "last_used_at": "2019-08-24T14:15:22Z",      "name": "string",      "organization_id": "string",      "project_id": "string",      "revoked_at": "2019-08-24T14:15:22Z",      "scopes": [        "string"      ],      "source": "string"    }  ]}
{  "error": "string"}
{  "error": "string"}
{  "error": "string"}
POST
/v1/organizations/{orgID}/api-keys

Authorization

AuthorizationBearer <token>

Org or project-scoped API key, format capy_live_...; Clerk session tokens also accepted.

In: header

Path Parameters

orgID*string

Organization id.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/organizations/string/api-keys" \  -H "Content-Type: application/json" \  -d '{    "name": "string",    "scopes": [      "string"    ]  }'
{  "api_key": {    "created_at": "2019-08-24T14:15:22Z",    "created_by_user_id": "string",    "device_name": "string",    "expires_at": "2019-08-24T14:15:22Z",    "id": "string",    "is_active": true,    "key_prefix": "string",    "last_used_at": "2019-08-24T14:15:22Z",    "name": "string",    "organization_id": "string",    "project_id": "string",    "revoked_at": "2019-08-24T14:15:22Z",    "scopes": [      "string"    ],    "source": "string"  },  "plaintext_api_key": "string"}
{  "error": "string"}
{  "error": "string"}
{  "error": "string"}
{  "error": "string"}
DELETE
/v1/organizations/{orgID}/api-keys/{keyID}

Authorization

AuthorizationBearer <token>

Org or project-scoped API key, format capy_live_...; Clerk session tokens also accepted.

In: header

Path Parameters

orgID*string

Organization id.

keyID*string

API key id.

Response Body

application/json

application/json

application/json

application/json

curl -X DELETE "https://example.com/v1/organizations/string/api-keys/string"
{  "revoked": true}
{  "error": "string"}
{  "error": "string"}
{  "error": "string"}