> ## Documentation Index
> Fetch the complete documentation index at: https://docs.squarecloud.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Invite Member

> Invite someone to a workspace.

<ParamField header="Authorization" type="string" placeholder="API Key" required>
  The API key for your account. You can find this in your [account settings](https://squarecloud.app/en/account/security).
</ParamField>

Adds a member to a workspace using a short-lived code from [Get Invite Code](/en/api-reference/endpoint/workspace/members/code): the invited user is identified by the code, and the caller assigns their role with `group`. Only the workspace owner can call this endpoint, and the workspace's member count is capped by the owner's plan tier.

The four assignable roles control what a member can do to the workspace's shared applications: `view` is read-only; `manager` can trigger app actions (start/stop/restart) and see deployment info but not commit or touch files; `maintain` adds file management, DNS, cache purge, and commits; `admin` adds environment variables, snapshots, custom domains, and the deploy webhook. Change a role later with [Change Permissions](/en/api-reference/endpoint/workspace/members/perms). An owner cannot invite themselves. Rate limited to 1 addition every 5 seconds per user.

### Parameters

<ParamField body="workspaceId" type="string" placeholder="Workspace Id">
  The ID of the workspace.
</ParamField>

<ParamField body="code" type="string" placeholder="Invite code">
  A string with the member invite code.
</ParamField>

<ParamField body="group" type="string" placeholder="Permission name">
  The member permissions on the workspace applications
</ParamField>

### Response

<ResponseField name="status" type="string">
  Indicates whether the call was successful.. `success` if successful, `error` if not.
</ResponseField>

<ResponseExample>
  ```json theme={null}
  {
    "status": "success"
  }
  ```
</ResponseExample>

### Common errors

| Code                    | HTTP | Meaning                                                                |
| ----------------------- | ---- | ---------------------------------------------------------------------- |
| `INVALID_ID`            | 400  | `workspaceId` is missing.                                              |
| `INVALID_CODE`          | 400  | The invite code is missing, malformed, or has expired.                 |
| `CANNOT_INVITE_OWNER`   | 400  | The invite code belongs to the caller, who already owns the workspace. |
| `INVALID_GROUP`         | 400  | `group` is not one of `view`, `manager`, `maintain`, `admin`.          |
| `MEMBERS_LIMIT_REACHED` | 400  | The workspace already has the plan's maximum number of members.        |
| `MEMBER_ALREADY_ADDED`  | 400  | The invited user is already a member of this workspace.                |
| `WORKSPACE_NOT_FOUND`   | 404  | The workspace does not exist.                                          |
