API Key#

Operations related to API key management

List API keys for a user#

GET/users/{userName}/api-keys

Returns all API keys owned by the specified user. Secrets are never included.

Security#

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer YOUR_API_KEY

Code Examples#

curl -X GET "/api/v1/users/{userName}/api-keys" \
    -H "Authorization: Bearer YOUR_API_KEY"

Responses#

[
  {
    "key_id": "aBcDeFgHiJkLmNoPqRsT",
    "name": "CI pipeline key",
    "username": "johndoe",
    "permissions": [
      {
        "resource": "orders_table",
        "resource_type": "table",
        "type": "read"
      }
    ],
    "created_at": "2024-01-01T00:00:00Z",
    "expires_at": "2024-01-01T00:00:00Z"
  }
]

Create a new API key#

POST/users/{userName}/api-keys

Creates a new API key for the specified user. The cleartext secret is returned only in this response.

Security#

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer YOUR_API_KEY

Request Body#

Example:

{
    "name": "CI pipeline key",
    "expires_in": "720h",
    "permissions": [
        {
            "resource": "orders_table",
            "resource_type": "table",
            "type": "read"
        }
    ]
}

Code Examples#

curl -X POST "/api/v1/users/{userName}/api-keys" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
    "name": "CI pipeline key",
    "expires_in": "720h",
    "permissions": [
        {
            "resource": "orders_table",
            "resource_type": "table",
            "type": "read"
        }
    ]
}'

Responses#

{
  "key_id": "aBcDeFgHiJkLmNoPqRsT",
  "name": "CI pipeline key",
  "username": "johndoe",
  "permissions": [
    {
      "resource": "orders_table",
      "resource_type": "table",
      "type": "read"
    }
  ],
  "created_at": "2024-01-01T00:00:00Z",
  "expires_at": "2024-01-01T00:00:00Z"
}

Delete an API key#

DELETE/users/{userName}/api-keys/{keyId}

Permanently deletes the specified API key. Subsequent requests using this key will be rejected.

Security#

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer YOUR_API_KEY

Code Examples#

curl -X DELETE "/api/v1/users/{userName}/api-keys/{keyId}" \
    -H "Authorization: Bearer YOUR_API_KEY"

Responses#

No response body