# Invite User To Workspace

<Heading
  as={"h1"}
  className={"openapi__heading"}
  children={"Invite User To Workspace"}
>
</Heading>

<MethodEndpoint
  method={"post"}
  path={"/api/v1/workspaces/{workspace_name}/invitation"}
  context={"endpoint"}
>
  
</MethodEndpoint>

Invites a user directly to a specific workspace with the specified role.

This endpoint allows workspace administrators to invite users directly to their workspace,
bypassing the organization-level invitation process. The user will be:

1. Created in the Haystack Enterprise Platform if they don't already exist
2. Added to the organization if they're not already a member
3. Assigned the specified role within the target workspace

**Required Permissions:** WORKSPACE_MEMBERS write permission on the target workspace.

**Valid preset roles are:** ADMIN, EDITOR

<Heading
  id={"request"}
  as={"h2"}
  className={"openapi-tabs__heading"}
>
  <Translate id="theme.openapi.request.title">Request</Translate>
</Heading>

<ParamsDetails
  {...require("./invite-user-to-workspace-api-v-1-workspaces-workspace-name-invitation-post.ParamsDetails.json")}
>
  
</ParamsDetails>

<RequestSchema
  {...require("./invite-user-to-workspace-api-v-1-workspaces-workspace-name-invitation-post.RequestSchema.json")}
>
  
</RequestSchema>

<StatusCodes
  {...require("./invite-user-to-workspace-api-v-1-workspaces-workspace-name-invitation-post.StatusCodes.json")}
>
  
</StatusCodes>
