Skip to main content

Overview

Guardrails endpoints

Available Operations

List

List all guardrails for the authenticated user. Management key required.

Example Usage

Parameters

ParameterTypeRequiredDescriptionExample
ctxcontext.Context:heavy_check_mark:The context to use for the request.
offsetoptionalnullable.OptionalNullable[int64]:heavy_minus_sign:Number of records to skip for pagination0
limit*int64:heavy_minus_sign:Maximum number of records to return (max 100)50
workspaceID*string:heavy_minus_sign:Filter guardrails by workspace ID. By default, guardrails in the default workspace are returned.0df9e665-d932-5740-b2c7-b52af166bc11
opts[]operations.Option:heavy_minus_sign:The options for this request.

Response

*operations.ListGuardrailsResponse, error

Errors

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

Create

Create a new guardrail for the authenticated user. Management key required.

Example Usage

Parameters

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

Response

*components.CreateGuardrailResponse, error

Errors

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

Delete

Delete an existing guardrail. Management key required.

Example Usage

Parameters

ParameterTypeRequiredDescriptionExample
ctxcontext.Context:heavy_check_mark:The context to use for the request.
idstring:heavy_check_mark:The unique identifier of the guardrail to delete550e8400-e29b-41d4-a716-446655440000
opts[]operations.Option:heavy_minus_sign:The options for this request.

Response

*components.DeleteGuardrailResponse, error

Errors

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

Get

Get a single guardrail by ID. Management key required.

Example Usage

Parameters

ParameterTypeRequiredDescriptionExample
ctxcontext.Context:heavy_check_mark:The context to use for the request.
idstring:heavy_check_mark:The unique identifier of the guardrail to retrieve550e8400-e29b-41d4-a716-446655440000
opts[]operations.Option:heavy_minus_sign:The options for this request.

Response

*components.GetGuardrailResponse, error

Errors

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

Update

Update an existing guardrail. Collection fields use replace semantics: send the full desired set on every update. Management key required.

Example Usage

Parameters

ParameterTypeRequiredDescriptionExample
ctxcontext.Context:heavy_check_mark:The context to use for the request.
idstring:heavy_check_mark:The unique identifier of the guardrail to update550e8400-e29b-41d4-a716-446655440000
updateGuardrailRequestcomponents.UpdateGuardrailRequest:heavy_check_mark:N/A{
“description”: “Updated description”,
“limit_usd”: 75,
“name”: “Updated Guardrail Name”,
“reset_interval”: “weekly”
}
opts[]operations.Option:heavy_minus_sign:The options for this request.

Response

*components.UpdateGuardrailResponse, error

Errors

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

ListGuardrailKeyAssignments

List all API key assignments for a specific guardrail. Management key required.

Example Usage

Parameters

ParameterTypeRequiredDescriptionExample
ctxcontext.Context:heavy_check_mark:The context to use for the request.
idstring:heavy_check_mark:The unique identifier of the guardrail550e8400-e29b-41d4-a716-446655440000
offsetoptionalnullable.OptionalNullable[int64]:heavy_minus_sign:Number of records to skip for pagination0
limit*int64:heavy_minus_sign:Maximum number of records to return (max 100)50
opts[]operations.Option:heavy_minus_sign:The options for this request.

Response

*operations.ListGuardrailKeyAssignmentsResponse, error

Errors

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

BulkAssignKeys

Assign multiple API keys to a specific guardrail. A key may hold at most one guardrail; assigning replaces any existing assignment. Management key required.

Example Usage

Parameters

ParameterTypeRequiredDescriptionExample
ctxcontext.Context:heavy_check_mark:The context to use for the request.
idstring:heavy_check_mark:The unique identifier of the guardrail550e8400-e29b-41d4-a716-446655440000
bulkAssignKeysRequestcomponents.BulkAssignKeysRequest:heavy_check_mark:N/A{
“key_hashes”: [
“c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93”
]
}
opts[]operations.Option:heavy_minus_sign:The options for this request.

Response

*components.BulkAssignKeysResponse, error

Errors

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

BulkUnassignKeys

Unassign multiple API keys from a specific guardrail. Management key required.

Example Usage

Parameters

ParameterTypeRequiredDescriptionExample
ctxcontext.Context:heavy_check_mark:The context to use for the request.
idstring:heavy_check_mark:The unique identifier of the guardrail550e8400-e29b-41d4-a716-446655440000
bulkUnassignKeysRequestcomponents.BulkUnassignKeysRequest:heavy_check_mark:N/A{
“key_hashes”: [
“c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93”
]
}
opts[]operations.Option:heavy_minus_sign:The options for this request.

Response

*components.BulkUnassignKeysResponse, error

Errors

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

ListGuardrailMemberAssignments

List all organization member assignments for a specific guardrail. Management key required.

Example Usage

Parameters

ParameterTypeRequiredDescriptionExample
ctxcontext.Context:heavy_check_mark:The context to use for the request.
idstring:heavy_check_mark:The unique identifier of the guardrail550e8400-e29b-41d4-a716-446655440000
offsetoptionalnullable.OptionalNullable[int64]:heavy_minus_sign:Number of records to skip for pagination0
limit*int64:heavy_minus_sign:Maximum number of records to return (max 100)50
opts[]operations.Option:heavy_minus_sign:The options for this request.

Response

*operations.ListGuardrailMemberAssignmentsResponse, error

Errors

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

BulkAssignMembers

Assign multiple organization members to a specific guardrail. Management key required.

Example Usage

Parameters

ParameterTypeRequiredDescriptionExample
ctxcontext.Context:heavy_check_mark:The context to use for the request.
idstring:heavy_check_mark:The unique identifier of the guardrail550e8400-e29b-41d4-a716-446655440000
bulkAssignMembersRequestcomponents.BulkAssignMembersRequest:heavy_check_mark:N/A{
“member_user_ids”: [
“user_abc123”,
“user_def456”
]
}
opts[]operations.Option:heavy_minus_sign:The options for this request.

Response

*components.BulkAssignMembersResponse, error

Errors

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

BulkUnassignMembers

Unassign multiple organization members from a specific guardrail. Management key required.

Example Usage

Parameters

ParameterTypeRequiredDescriptionExample
ctxcontext.Context:heavy_check_mark:The context to use for the request.
idstring:heavy_check_mark:The unique identifier of the guardrail550e8400-e29b-41d4-a716-446655440000
bulkUnassignMembersRequestcomponents.BulkUnassignMembersRequest:heavy_check_mark:N/A{
“member_user_ids”: [
“user_abc123”,
“user_def456”
]
}
opts[]operations.Option:heavy_minus_sign:The options for this request.

Response

*components.BulkUnassignMembersResponse, error

Errors

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

ListKeyAssignments

List all API key guardrail assignments for the authenticated user. Management key required.

Example Usage

Parameters

ParameterTypeRequiredDescriptionExample
ctxcontext.Context:heavy_check_mark:The context to use for the request.
offsetoptionalnullable.OptionalNullable[int64]:heavy_minus_sign:Number of records to skip for pagination0
limit*int64:heavy_minus_sign:Maximum number of records to return (max 100)50
opts[]operations.Option:heavy_minus_sign:The options for this request.

Response

*operations.ListKeyAssignmentsResponse, error

Errors

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

ListMemberAssignments

List all organization member guardrail assignments for the authenticated user. Management key required.

Example Usage

Parameters

ParameterTypeRequiredDescriptionExample
ctxcontext.Context:heavy_check_mark:The context to use for the request.
offsetoptionalnullable.OptionalNullable[int64]:heavy_minus_sign:Number of records to skip for pagination0
limit*int64:heavy_minus_sign:Maximum number of records to return (max 100)50
opts[]operations.Option:heavy_minus_sign:The options for this request.

Response

*operations.ListMemberAssignmentsResponse, error

Errors

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