Overview
Workspaces endpointsAvailable Operations
- List - List workspaces
- Create - Create a workspace
- Delete - Delete a workspace
- Get - Get a workspace
- Update - Update a workspace
- ListBudgets - List workspace budgets
- DeleteBudget - Delete a workspace budget
- SetBudget - Create or update a workspace budget
- ListMembers - List workspace members
- BulkAddMembers - Bulk add members to a workspace
- BulkRemoveMembers - Bulk remove members from a workspace
List
List all workspaces 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.ListWorkspacesResponse, 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 workspace 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.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, 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 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
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
ctx | context.Context | :heavy_check_mark: | The context to use for the request. | |
id | string | :heavy_check_mark: | The workspace ID (UUID) or slug | production |
opts | []operations.Option | :heavy_minus_sign: | The options for this request. |
Response
*components.DeleteWorkspaceResponse, errorErrors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.BadRequestResponseError | 400 | application/json |
| sdkerrors.UnauthorizedResponseError | 401 | application/json |
| sdkerrors.ForbiddenResponseError | 403 | application/json |
| sdkerrors.NotFoundResponseError | 404 | application/json |
| sdkerrors.InternalServerResponseError | 500 | application/json |
| sdkerrors.APIError | 4XX, 5XX | */* |
Get
Get a single workspace by ID or slug. 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 workspace ID (UUID) or slug | production |
opts | []operations.Option | :heavy_minus_sign: | The options for this request. |
Response
*components.GetWorkspaceResponse, 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 workspace by ID or slug. 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 workspace ID (UUID) or slug | production |
updateWorkspaceRequest | components.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, errorErrors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.BadRequestResponseError | 400 | application/json |
| sdkerrors.UnauthorizedResponseError | 401 | application/json |
| sdkerrors.ForbiddenResponseError | 403 | application/json |
| sdkerrors.NotFoundResponseError | 404 | application/json |
| sdkerrors.InternalServerResponseError | 500 | application/json |
| sdkerrors.APIError | 4XX, 5XX | */* |
ListBudgets
List all budgets configured for a workspace. 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 workspace ID (UUID) or slug | production |
opts | []operations.Option | :heavy_minus_sign: | The options for this request. |
Response
*components.ListWorkspaceBudgetsResponse, 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 | */* |
DeleteBudget
Remove the budget for a given interval. 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 workspace ID (UUID) or slug | production |
interval | components.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, 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 | */* |
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
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
ctx | context.Context | :heavy_check_mark: | The context to use for the request. | |
id | string | :heavy_check_mark: | The workspace ID (UUID) or slug | production |
interval | components.WorkspaceBudgetInterval | :heavy_check_mark: | Budget reset interval. Use “lifetime” for a one-time budget that never resets. | monthly |
upsertWorkspaceBudgetRequest | components.UpsertWorkspaceBudgetRequest | :heavy_check_mark: | N/A | { “limit_usd”: 100 } |
opts | []operations.Option | :heavy_minus_sign: | The options for this request. |
Response
*components.UpsertWorkspaceBudgetResponse, 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 | */* |
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
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
ctx | context.Context | :heavy_check_mark: | The context to use for the request. | |
id | string | :heavy_check_mark: | The workspace ID (UUID) or slug | production |
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.ListWorkspaceMembersResponse, errorErrors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.UnauthorizedResponseError | 401 | application/json |
| sdkerrors.ForbiddenResponseError | 403 | application/json |
| sdkerrors.NotFoundResponseError | 404 | application/json |
| sdkerrors.InternalServerResponseError | 500 | application/json |
| sdkerrors.APIError | 4XX, 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
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
ctx | context.Context | :heavy_check_mark: | The context to use for the request. | |
id | string | :heavy_check_mark: | The workspace ID (UUID) or slug | production |
bulkAddWorkspaceMembersRequest | components.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, errorErrors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.BadRequestResponseError | 400 | application/json |
| sdkerrors.UnauthorizedResponseError | 401 | application/json |
| sdkerrors.ForbiddenResponseError | 403 | application/json |
| sdkerrors.NotFoundResponseError | 404 | application/json |
| sdkerrors.InternalServerResponseError | 500 | application/json |
| sdkerrors.APIError | 4XX, 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
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
ctx | context.Context | :heavy_check_mark: | The context to use for the request. | |
id | string | :heavy_check_mark: | The workspace ID (UUID) or slug | production |
bulkRemoveWorkspaceMembersRequest | components.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, errorErrors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.BadRequestResponseError | 400 | application/json |
| sdkerrors.UnauthorizedResponseError | 401 | application/json |
| sdkerrors.ForbiddenResponseError | 403 | application/json |
| sdkerrors.NotFoundResponseError | 404 | application/json |
| sdkerrors.InternalServerResponseError | 500 | application/json |
| sdkerrors.APIError | 4XX, 5XX | */* |