Skip to content
Get started

Workspace Admin

Administer workspaces across the account: create and archive workspaces and manage their membership. These operations are account-scoped and require the admin role (a token whose profile holds the WorkOS admin role); they live under /v1/account/workspaces rather than the workspace-scoped /v1/workspaces tree so an admin can manage any workspace in the account, including ones they are not themselves a member of.

List all workspaces in the account
client.WorkspaceAdmin.List(ctx, query) (*CursorPagination[Workspace], error)
GET/v1/account/workspaces
Create a workspace
client.WorkspaceAdmin.New(ctx, body) (*Workspace, error)
POST/v1/account/workspaces
Get a workspace by ID
client.WorkspaceAdmin.Get(ctx, workspaceID) (*Workspace, error)
GET/v1/account/workspaces/{workspaceId}
Update a workspace
client.WorkspaceAdmin.Update(ctx, workspaceID, body) (*Workspace, error)
PATCH/v1/account/workspaces/{workspaceId}
Archive a workspace
client.WorkspaceAdmin.Archive(ctx, workspaceID) error
DELETE/v1/account/workspaces/{workspaceId}
ModelsExpand Collapse
type WorkspaceMember struct{…}

A member of a workspace: the profile granted access plus the actor row that links it to the workspace. Returned by member list/add operations.

ActorID string

The actor row linking the profile to the workspace (the junction record).

ProfileID string

The account profile that has access to the workspace.

AddedAt TimeOptional

When the member was added to the workspace.

formatdate-time
Email stringOptional

Email address of the member’s profile.

Name stringOptional

Display name of the member’s profile.

Workspace AdminMembers

Administer workspaces across the account: create and archive workspaces and manage their membership. These operations are account-scoped and require the admin role (a token whose profile holds the WorkOS admin role); they live under /v1/account/workspaces rather than the workspace-scoped /v1/workspaces tree so an admin can manage any workspace in the account, including ones they are not themselves a member of.

List workspace members
client.WorkspaceAdmin.Members.List(ctx, workspaceID, query) (*CursorPagination[WorkspaceMember], error)
GET/v1/account/workspaces/{workspaceId}/members
Add a member to a workspace
client.WorkspaceAdmin.Members.Add(ctx, workspaceID, body) (*WorkspaceMember, error)
POST/v1/account/workspaces/{workspaceId}/members
Remove a member from a workspace
client.WorkspaceAdmin.Members.Remove(ctx, workspaceID, profileID) error
DELETE/v1/account/workspaces/{workspaceId}/members/{profileId}

Workspace AdminProfiles

Administer workspaces across the account: create and archive workspaces and manage their membership. These operations are account-scoped and require the admin role (a token whose profile holds the WorkOS admin role); they live under /v1/account/workspaces rather than the workspace-scoped /v1/workspaces tree so an admin can manage any workspace in the account, including ones they are not themselves a member of.

Search account profiles
client.WorkspaceAdmin.Profiles.List(ctx, query) (*CursorPagination[Profile], error)
GET/v1/account/profiles