Skip to main content
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.
A space groups projects, datasets, and monitors under an organization. The 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:
Usage Example:

Get a Space

Get returns a single space, resolving by name or ID. Signature:
Usage Example:

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:
Usage Example:

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:
Usage Example:

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:
Usage Example:

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:
Usage Example:

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:
Usage Example: