Magidoc

createWorkspaceUser
Mutation

Add a person to a workspace by creating a WorkspaceUser membership. Identify the person with workspaceUser.userId (existing user) or workspaceUser.user (email plus optional profile fields). An email matching no account creates a placeholder user and sends an invite email with a sign-up link; an email matching an existing account adds that account directly. Pass workspaceUser.id as the string "new"; duplicate memberships in the same workspace are rejected.

permissions may contain "admin", "project_creator", "recipe_creator", "viewer", "internal_rates", and "billing_rates"; unknown values are dropped and "admin" supersedes the creator/viewer values. Granting any permission requires workspace admin or organization admin rights. hourlyBillingRate and hourlyInternalRate set the member's default rates in cents. The optional todoId, projectId, stackId, or recipeId argument supports adding someone from within that context; the caller then needs assignment-creation rights there instead of workspace-level rights. Every supplied context must be authorized and belong to the requested workspace. Explicitly supplied rate fields, including zero or null, require the corresponding billing_rates or internal_rates permission together with a workspace admin or viewer role, or organization admin. Project administration alone does not grant these rates. Omitting rate fields does not require rate permissions. Invalid creation commands leave no partial invitee account or membership.

Without a context argument the caller must be a workspace admin or viewer, or an organization admin. On free and trial organizations the call fails with the error "max_users_per_organization_reached" once 20 distinct users exist across the organization. Returns the created WorkspaceUser.

Arguments

#

projectId

Project context the person is being added from.

recipeId

Recipe context the person is being added from.

stackId

Stack context the person is being added from.

todoId

Todo context the person is being added from.

workspaceUser

Non-null

Workspace user payload.

Response

#

Returns WorkspaceUser .

Example

#