Overview
Guardrails endpointsAvailable Operations
- List - List guardrails
- Create - Create a guardrail
- Delete - Delete a guardrail
- Get - Get a guardrail
- Update - Update a guardrail
- ListGuardrailKeyAssignments - List key assignments for a guardrail
- BulkAssignKeys - Bulk assign keys to a guardrail
- BulkUnassignKeys - Bulk unassign keys from a guardrail
- ListGuardrailMemberAssignments - List member assignments for a guardrail
- BulkAssignMembers - Bulk assign members to a guardrail
- BulkUnassignMembers - Bulk unassign members from a guardrail
- ListKeyAssignments - List all key assignments
- ListMemberAssignments - List all member assignments
List
List all guardrails for the authenticated user. Management key required.Example Usage
Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
ctx | context.Context | :heavy_check_mark: | The context to use for the request. | |
offset | optionalnullable.OptionalNullable[int64] | :heavy_minus_sign: | Number of records to skip for pagination | 0 |
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, errorErrors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.UnauthorizedResponseError | 401 | application/json |
| sdkerrors.InternalServerResponseError | 500 | application/json |
| sdkerrors.APIError | 4XX, 5XX | */* |
Create
Create a new guardrail for the authenticated user. Management key required.Example Usage
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ctx | context.Context | :heavy_check_mark: | The context to use for the request. |
request | components.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, errorErrors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.BadRequestResponseError | 400 | application/json |
| sdkerrors.UnauthorizedResponseError | 401 | application/json |
| sdkerrors.ForbiddenResponseError | 403 | application/json |
| sdkerrors.InternalServerResponseError | 500 | application/json |
| sdkerrors.APIError | 4XX, 5XX | */* |
Delete
Delete an existing guardrail. Management key required.Example Usage
Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
ctx | context.Context | :heavy_check_mark: | The context to use for the request. | |
id | string | :heavy_check_mark: | The unique identifier of the guardrail to delete | 550e8400-e29b-41d4-a716-446655440000 |
opts | []operations.Option | :heavy_minus_sign: | The options for this request. |
Response
*components.DeleteGuardrailResponse, errorErrors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.UnauthorizedResponseError | 401 | application/json |
| sdkerrors.NotFoundResponseError | 404 | application/json |
| sdkerrors.InternalServerResponseError | 500 | application/json |
| sdkerrors.APIError | 4XX, 5XX | */* |
Get
Get a single guardrail by ID. Management key required.Example Usage
Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
ctx | context.Context | :heavy_check_mark: | The context to use for the request. | |
id | string | :heavy_check_mark: | The unique identifier of the guardrail to retrieve | 550e8400-e29b-41d4-a716-446655440000 |
opts | []operations.Option | :heavy_minus_sign: | The options for this request. |
Response
*components.GetGuardrailResponse, errorErrors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.UnauthorizedResponseError | 401 | application/json |
| sdkerrors.NotFoundResponseError | 404 | application/json |
| sdkerrors.InternalServerResponseError | 500 | application/json |
| sdkerrors.APIError | 4XX, 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
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
ctx | context.Context | :heavy_check_mark: | The context to use for the request. | |
id | string | :heavy_check_mark: | The unique identifier of the guardrail to update | 550e8400-e29b-41d4-a716-446655440000 |
updateGuardrailRequest | components.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, errorErrors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.BadRequestResponseError | 400 | application/json |
| sdkerrors.UnauthorizedResponseError | 401 | application/json |
| sdkerrors.NotFoundResponseError | 404 | application/json |
| sdkerrors.InternalServerResponseError | 500 | application/json |
| sdkerrors.APIError | 4XX, 5XX | */* |
ListGuardrailKeyAssignments
List all API key assignments for a specific guardrail. Management key required.Example Usage
Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
ctx | context.Context | :heavy_check_mark: | The context to use for the request. | |
id | string | :heavy_check_mark: | The unique identifier of the guardrail | 550e8400-e29b-41d4-a716-446655440000 |
offset | optionalnullable.OptionalNullable[int64] | :heavy_minus_sign: | Number of records to skip for pagination | 0 |
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, errorErrors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.UnauthorizedResponseError | 401 | application/json |
| sdkerrors.NotFoundResponseError | 404 | application/json |
| sdkerrors.InternalServerResponseError | 500 | application/json |
| sdkerrors.APIError | 4XX, 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
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
ctx | context.Context | :heavy_check_mark: | The context to use for the request. | |
id | string | :heavy_check_mark: | The unique identifier of the guardrail | 550e8400-e29b-41d4-a716-446655440000 |
bulkAssignKeysRequest | components.BulkAssignKeysRequest | :heavy_check_mark: | N/A | { “key_hashes”: [ “c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93” ] } |
opts | []operations.Option | :heavy_minus_sign: | The options for this request. |
Response
*components.BulkAssignKeysResponse, errorErrors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.BadRequestResponseError | 400 | application/json |
| sdkerrors.UnauthorizedResponseError | 401 | application/json |
| sdkerrors.NotFoundResponseError | 404 | application/json |
| sdkerrors.InternalServerResponseError | 500 | application/json |
| sdkerrors.APIError | 4XX, 5XX | */* |
BulkUnassignKeys
Unassign multiple API keys from a specific guardrail. Management key required.Example Usage
Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
ctx | context.Context | :heavy_check_mark: | The context to use for the request. | |
id | string | :heavy_check_mark: | The unique identifier of the guardrail | 550e8400-e29b-41d4-a716-446655440000 |
bulkUnassignKeysRequest | components.BulkUnassignKeysRequest | :heavy_check_mark: | N/A | { “key_hashes”: [ “c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93” ] } |
opts | []operations.Option | :heavy_minus_sign: | The options for this request. |
Response
*components.BulkUnassignKeysResponse, errorErrors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.BadRequestResponseError | 400 | application/json |
| sdkerrors.UnauthorizedResponseError | 401 | application/json |
| sdkerrors.NotFoundResponseError | 404 | application/json |
| sdkerrors.InternalServerResponseError | 500 | application/json |
| sdkerrors.APIError | 4XX, 5XX | */* |
ListGuardrailMemberAssignments
List all organization member assignments for a specific guardrail. Management key required.Example Usage
Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
ctx | context.Context | :heavy_check_mark: | The context to use for the request. | |
id | string | :heavy_check_mark: | The unique identifier of the guardrail | 550e8400-e29b-41d4-a716-446655440000 |
offset | optionalnullable.OptionalNullable[int64] | :heavy_minus_sign: | Number of records to skip for pagination | 0 |
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, errorErrors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.UnauthorizedResponseError | 401 | application/json |
| sdkerrors.NotFoundResponseError | 404 | application/json |
| sdkerrors.InternalServerResponseError | 500 | application/json |
| sdkerrors.APIError | 4XX, 5XX | */* |
BulkAssignMembers
Assign multiple organization members to a specific guardrail. Management key required.Example Usage
Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
ctx | context.Context | :heavy_check_mark: | The context to use for the request. | |
id | string | :heavy_check_mark: | The unique identifier of the guardrail | 550e8400-e29b-41d4-a716-446655440000 |
bulkAssignMembersRequest | components.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, errorErrors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.BadRequestResponseError | 400 | application/json |
| sdkerrors.UnauthorizedResponseError | 401 | application/json |
| sdkerrors.NotFoundResponseError | 404 | application/json |
| sdkerrors.InternalServerResponseError | 500 | application/json |
| sdkerrors.APIError | 4XX, 5XX | */* |
BulkUnassignMembers
Unassign multiple organization members from a specific guardrail. Management key required.Example Usage
Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
ctx | context.Context | :heavy_check_mark: | The context to use for the request. | |
id | string | :heavy_check_mark: | The unique identifier of the guardrail | 550e8400-e29b-41d4-a716-446655440000 |
bulkUnassignMembersRequest | components.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, errorErrors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.BadRequestResponseError | 400 | application/json |
| sdkerrors.UnauthorizedResponseError | 401 | application/json |
| sdkerrors.NotFoundResponseError | 404 | application/json |
| sdkerrors.InternalServerResponseError | 500 | application/json |
| sdkerrors.APIError | 4XX, 5XX | */* |
ListKeyAssignments
List all API key guardrail assignments for the authenticated user. Management key required.Example Usage
Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
ctx | context.Context | :heavy_check_mark: | The context to use for the request. | |
offset | optionalnullable.OptionalNullable[int64] | :heavy_minus_sign: | Number of records to skip for pagination | 0 |
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, errorErrors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.UnauthorizedResponseError | 401 | application/json |
| sdkerrors.InternalServerResponseError | 500 | application/json |
| sdkerrors.APIError | 4XX, 5XX | */* |
ListMemberAssignments
List all organization member guardrail assignments for the authenticated user. Management key required.Example Usage
Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
ctx | context.Context | :heavy_check_mark: | The context to use for the request. | |
offset | optionalnullable.OptionalNullable[int64] | :heavy_minus_sign: | Number of records to skip for pagination | 0 |
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, errorErrors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.UnauthorizedResponseError | 401 | application/json |
| sdkerrors.InternalServerResponseError | 500 | application/json |
| sdkerrors.APIError | 4XX, 5XX | */* |