Skip to main content
SONZAI
Api

A P I Keys

List API keys for a project

GET
/projects/{projectId}/keys

Authorization

bearerClerk
AuthorizationBearer <token>

Clerk session JWT from an authenticated dashboard user. Format: Bearer eyJ....

In: header

Path Parameters

projectId*string

Project UUID

Response Body

application/json

application/problem+json

curl -X GET "https://loading/api/v1/projects/string/keys"
[
  {
    "created_at": "2019-08-24T14:15:22Z",
    "created_by": "string",
    "expires_at": "2019-08-24T14:15:22Z",
    "is_active": true,
    "is_admin_managed": true,
    "key_id": "string",
    "key_prefix": "string",
    "last_used_at": "2019-08-24T14:15:22Z",
    "name": "string",
    "project_id": "string",
    "scopes": [
      "string"
    ],
    "tenant_id": "string"
  }
]
{
  "$schema": "/api/v1/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [
    {
      "location": "string",
      "message": "string",
      "value": null
    }
  ],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}

Create an API key

POST
/projects/{projectId}/keys

Authorization

bearerClerk
AuthorizationBearer <token>

Clerk session JWT from an authenticated dashboard user. Format: Bearer eyJ....

In: header

Path Parameters

projectId*string

Project UUID

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/problem+json

curl -X POST "https://loading/api/v1/projects/string/keys" \  -H "Content-Type: application/json" \  -d '{}'
{
  "$schema": "/api/v1/schemas/CreateAPIKeyOutputBody.json",
  "created_at": "2019-08-24T14:15:22Z",
  "created_by": "string",
  "expires_at": "2019-08-24T14:15:22Z",
  "is_active": true,
  "key": "string",
  "key_id": "string",
  "key_prefix": "string",
  "name": "string",
  "project_id": "string",
  "scopes": [
    "string"
  ],
  "tenant_id": "string"
}
{
  "$schema": "/api/v1/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [
    {
      "location": "string",
      "message": "string",
      "value": null
    }
  ],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}

Revoke an API key

DELETE
/projects/{projectId}/keys/{keyId}

Authorization

bearerClerk
AuthorizationBearer <token>

Clerk session JWT from an authenticated dashboard user. Format: Bearer eyJ....

In: header

Path Parameters

projectId*string

Project UUID

keyId*string

API key UUID

Response Body

application/json

application/problem+json

curl -X DELETE "https://loading/api/v1/projects/string/keys/string"
{
  "$schema": "/api/v1/schemas/RevokeAPIKeyOutputBody.json",
  "success": true
}
{
  "$schema": "/api/v1/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [
    {
      "location": "string",
      "message": "string",
      "value": null
    }
  ],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}