The
spaces client methods are currently in BETA. The API may change without notice. A one-time warning is emitted on first use. The AddUser and RemoveUser methods are in ALPHA.Get, Update, Delete, AddUser, and RemoveUser methods accept either a space name or an ID, and List/Create accept an organization name or ID — the SDK resolves names to IDs on your behalf. When adding a user, build the role assignment with AssignPredefinedRole (one of the UserSpaceRole values) or AssignCustomRole (an existing custom role ID — see Roles).
List Spaces
List returns a paginated list of spaces. Organization, when non-empty, accepts an organization name or ID and restricts results to that organization.
Signature:
Get a Space
Get returns a single space, resolving by name or ID.
Signature:
Create a Space
Create issues a POST to create a new space in the given organization, resolving the parent organization by name or ID, and returns the created space.
Signature:
Update a Space
Update modifies an existing space, resolving the target by name or ID, and returns the updated space. Name and Description are pointers — nil preserves the existing value, a pointer to an empty string clears the field.
Signature:
Delete a Space
Delete irreversibly removes a space and cascades to all child resources (projects, datasets, monitors, custom metrics, etc.). It returns only an error.
Signature:
Add a User to a Space
AddUser adds a user to a space, or upserts their role if they are already a member. The user must already belong to the space’s parent organization; auto-enrollment is not performed. Build the Role with AssignPredefinedRole (one of the UserSpaceRole values) or AssignCustomRole (an existing custom role ID).
Signature:
Remove a User from a Space
RemoveUser removes a user from a space, clearing both the legacy membership row and any RBAC role bindings for the user on this space. It returns only an error.
Signature: