Skip to main content

Overview

API key management endpoints

Available Operations

GetCurrentKeyMetadata

Get information on the API key associated with the current authentication session

Example Usage

Parameters

ParameterTypeRequiredDescription
ctxcontext.Context:heavy_check_mark:The context to use for the request.
opts[]operations.Option:heavy_minus_sign:The options for this request.

Response

*operations.GetCurrentKeyResponse, error

Errors

Error TypeStatus CodeContent Type
sdkerrors.UnauthorizedResponseError401application/json
sdkerrors.InternalServerResponseError500application/json
sdkerrors.APIError4XX, 5XX*/*

List

List all API keys for the authenticated user. Management key required.

Example Usage

Parameters

ParameterTypeRequiredDescriptionExample
ctxcontext.Context:heavy_check_mark:The context to use for the request.
includeDisabled*bool:heavy_minus_sign:Whether to include disabled API keys in the responsefalse
offsetoptionalnullable.OptionalNullable[int64]:heavy_minus_sign:Number of API keys to skip for pagination0
workspaceID*string:heavy_minus_sign:Filter API keys by workspace ID. By default, keys in the default workspace are returned.0df9e665-d932-5740-b2c7-b52af166bc11
opts[]operations.Option:heavy_minus_sign:The options for this request.

Response

*operations.ListResponse, error

Errors

Error TypeStatus CodeContent Type
sdkerrors.UnauthorizedResponseError401application/json
sdkerrors.TooManyRequestsResponseError429application/json
sdkerrors.InternalServerResponseError500application/json
sdkerrors.APIError4XX, 5XX*/*

Create

Create a new API key for the authenticated user. The plaintext key is returned only in this response. Treat it as a write-only, sensitive value; it cannot be retrieved later. Management key required.

Example Usage

Parameters

ParameterTypeRequiredDescription
ctxcontext.Context:heavy_check_mark:The context to use for the request.
requestoperations.CreateKeysRequest:heavy_check_mark:The request object to use for the request.
opts[]operations.Option:heavy_minus_sign:The options for this request.

Response

*operations.CreateKeysResponse, error

Errors

Error TypeStatus CodeContent Type
sdkerrors.BadRequestResponseError400application/json
sdkerrors.UnauthorizedResponseError401application/json
sdkerrors.ForbiddenResponseError403application/json
sdkerrors.TooManyRequestsResponseError429application/json
sdkerrors.InternalServerResponseError500application/json
sdkerrors.APIError4XX, 5XX*/*

Delete

Delete an existing API key. Management key required.

Example Usage

Parameters

ParameterTypeRequiredDescriptionExample
ctxcontext.Context:heavy_check_mark:The context to use for the request.
hashstring:heavy_check_mark:The hash identifier of the API key to deletef01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943
opts[]operations.Option:heavy_minus_sign:The options for this request.

Response

*operations.DeleteKeysResponse, error

Errors

Error TypeStatus CodeContent Type
sdkerrors.UnauthorizedResponseError401application/json
sdkerrors.NotFoundResponseError404application/json
sdkerrors.TooManyRequestsResponseError429application/json
sdkerrors.InternalServerResponseError500application/json
sdkerrors.APIError4XX, 5XX*/*

Get

Get a single API key by hash. Management key required.

Example Usage

Parameters

ParameterTypeRequiredDescriptionExample
ctxcontext.Context:heavy_check_mark:The context to use for the request.
hashstring:heavy_check_mark:The hash identifier of the API key to retrievef01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943
opts[]operations.Option:heavy_minus_sign:The options for this request.

Response

*operations.GetKeyResponse, error

Errors

Error TypeStatus CodeContent Type
sdkerrors.UnauthorizedResponseError401application/json
sdkerrors.NotFoundResponseError404application/json
sdkerrors.TooManyRequestsResponseError429application/json
sdkerrors.InternalServerResponseError500application/json
sdkerrors.APIError4XX, 5XX*/*

Update

Update an existing API key. Management key required.

Example Usage

Parameters

ParameterTypeRequiredDescriptionExample
ctxcontext.Context:heavy_check_mark:The context to use for the request.
hashstring:heavy_check_mark:The hash identifier of the API key to updatef01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943
requestBodyoperations.UpdateKeysRequestBody:heavy_check_mark:N/A{
“disabled”: false,
“include_byok_in_limit”: true,
“limit”: 75,
“limit_reset”: “daily”,
“name”: “Updated API Key Name”
}
opts[]operations.Option:heavy_minus_sign:The options for this request.

Response

*operations.UpdateKeysResponse, error

Errors

Error TypeStatus CodeContent Type
sdkerrors.BadRequestResponseError400application/json
sdkerrors.UnauthorizedResponseError401application/json
sdkerrors.NotFoundResponseError404application/json
sdkerrors.TooManyRequestsResponseError429application/json
sdkerrors.InternalServerResponseError500application/json
sdkerrors.APIError4XX, 5XX*/*