Skip to main content

Overview

Workspaces endpoints

Available Operations

List

List all workspaces 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.ListWorkspacesResponse, error

Errors

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

Create

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

Example Usage

Parameters

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

Response

*components.CreateWorkspaceResponse, 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 workspace. The default workspace cannot be deleted. Workspaces with active API keys cannot be deleted; remove the keys first. Management key required.

Example Usage

Parameters

ParameterTypeRequiredDescriptionExample
ctxcontext.Context:heavy_check_mark:The context to use for the request.
idstring:heavy_check_mark:The workspace ID (UUID) or slugproduction
opts[]operations.Option:heavy_minus_sign:The options for this request.

Response

*components.DeleteWorkspaceResponse, error

Errors

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

Get

Get a single workspace by ID or slug. Management key required.

Example Usage

Parameters

ParameterTypeRequiredDescriptionExample
ctxcontext.Context:heavy_check_mark:The context to use for the request.
idstring:heavy_check_mark:The workspace ID (UUID) or slugproduction
opts[]operations.Option:heavy_minus_sign:The options for this request.

Response

*components.GetWorkspaceResponse, error

Errors

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

Update

Update an existing workspace by ID or slug. Management key required.

Example Usage

Parameters

ParameterTypeRequiredDescriptionExample
ctxcontext.Context:heavy_check_mark:The context to use for the request.
idstring:heavy_check_mark:The workspace ID (UUID) or slugproduction
updateWorkspaceRequestcomponents.UpdateWorkspaceRequest:heavy_check_mark:N/A{
“name”: “Updated Workspace”,
“slug”: “updated-workspace”
}
opts[]operations.Option:heavy_minus_sign:The options for this request.

Response

*components.UpdateWorkspaceResponse, error

Errors

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

ListBudgets

List all budgets configured for a workspace. Management key required.

Example Usage

Parameters

ParameterTypeRequiredDescriptionExample
ctxcontext.Context:heavy_check_mark:The context to use for the request.
idstring:heavy_check_mark:The workspace ID (UUID) or slugproduction
opts[]operations.Option:heavy_minus_sign:The options for this request.

Response

*components.ListWorkspaceBudgetsResponse, error

Errors

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

DeleteBudget

Remove the budget for a given interval. Management key required.

Example Usage

Parameters

ParameterTypeRequiredDescriptionExample
ctxcontext.Context:heavy_check_mark:The context to use for the request.
idstring:heavy_check_mark:The workspace ID (UUID) or slugproduction
intervalcomponents.WorkspaceBudgetInterval:heavy_check_mark:Budget reset interval. Use “lifetime” for a one-time budget that never resets.monthly
opts[]operations.Option:heavy_minus_sign:The options for this request.

Response

*components.DeleteWorkspaceBudgetResponse, error

Errors

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

SetBudget

Create or update the budget for a given interval. Budget limits must strictly decrease as the interval narrows (lifetime > monthly > weekly > daily). Management key required.

Example Usage

Parameters

ParameterTypeRequiredDescriptionExample
ctxcontext.Context:heavy_check_mark:The context to use for the request.
idstring:heavy_check_mark:The workspace ID (UUID) or slugproduction
intervalcomponents.WorkspaceBudgetInterval:heavy_check_mark:Budget reset interval. Use “lifetime” for a one-time budget that never resets.monthly
upsertWorkspaceBudgetRequestcomponents.UpsertWorkspaceBudgetRequest:heavy_check_mark:N/A{
“limit_usd”: 100
}
opts[]operations.Option:heavy_minus_sign:The options for this request.

Response

*components.UpsertWorkspaceBudgetResponse, error

Errors

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

ListMembers

List all members of a workspace. Returns paginated results. For the default workspace, returns all organization members (implicit membership). Management key required.

Example Usage

Parameters

ParameterTypeRequiredDescriptionExample
ctxcontext.Context:heavy_check_mark:The context to use for the request.
idstring:heavy_check_mark:The workspace ID (UUID) or slugproduction
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.ListWorkspaceMembersResponse, error

Errors

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

BulkAddMembers

Add multiple organization members to a workspace. Members are assigned the same role they hold in the organization. Management key required.

Example Usage

Parameters

ParameterTypeRequiredDescriptionExample
ctxcontext.Context:heavy_check_mark:The context to use for the request.
idstring:heavy_check_mark:The workspace ID (UUID) or slugproduction
bulkAddWorkspaceMembersRequestcomponents.BulkAddWorkspaceMembersRequest:heavy_check_mark:N/A{
“user_ids”: [
“user_abc123”,
“user_def456”
]
}
opts[]operations.Option:heavy_minus_sign:The options for this request.

Response

*components.BulkAddWorkspaceMembersResponse, error

Errors

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

BulkRemoveMembers

Remove multiple members from a workspace. Members with active API keys in the workspace cannot be removed. Management key required.

Example Usage

Parameters

ParameterTypeRequiredDescriptionExample
ctxcontext.Context:heavy_check_mark:The context to use for the request.
idstring:heavy_check_mark:The workspace ID (UUID) or slugproduction
bulkRemoveWorkspaceMembersRequestcomponents.BulkRemoveWorkspaceMembersRequest:heavy_check_mark:N/A{
“user_ids”: [
“user_abc123”,
“user_def456”
]
}
opts[]operations.Option:heavy_minus_sign:The options for this request.

Response

*components.BulkRemoveWorkspaceMembersResponse, error

Errors

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