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

# Add Member to Workspace with Token

> Adds a member to an workspace using an invite token.

<ParamField path="id" type="string" required>
  The ID of the workspace to add the member to.
</ParamField>

<ParamField body="code" type="string" required>
  The invite token code for adding the member.
</ParamField>

<ParamField body="role" type="string">
  The role to assign to the new member. Must be one of: `owner`, `admin`, `developer`, `operator`, `viewer`. Defaults to `viewer`.
</ParamField>

### Response

<ResponseExample>
  ```json Response theme={null}
  {}
  ```
</ResponseExample>

### Error Responses

<ResponseField name="code" type="string">
  The error code indicating the reason for failure. Possible values:

  * `UNAUTHORIZED`: The user is not authenticated or lacks sufficient permissions.
  * `INSUFFICIENT_PERMISSIONS_TO_ADD_MEMBERS`: The user does not have `owner` or `admin` role to add members.
  * `ORGANIZATION_NOT_FOUND`: The specified workspace does not exist.
  * `INVALID_ROLE`: The provided role is invalid.
  * `ORGANIZATION_MEMBER_LIMIT_REACHED`: The workspace has reached its member limit.
  * `INVALID_OR_EXPIRED_TOKEN`: The provided invite token is invalid or expired.
  * `USER_ALREADY_IN_ORGANIZATION`: The user is already a member of the workspace.
  * `CODE_MUST_BE_STRING`: The provided code is not a string.
</ResponseField>

<ResponseField name="message" type="string">
  A descriptive message providing additional details about the error.
</ResponseField>

<ResponseExample>
  ```json Error Response (403) theme={null}
  {
    "code": "UNAUTHORIZED"
  }
  ```

  ```json Error Response (403) theme={null}
  {
    "code": "INSUFFICIENT_PERMISSIONS_TO_ADD_MEMBERS"
  }
  ```

  ```json Error Response (404) theme={null}
  {
    "code": "ORGANIZATION_NOT_FOUND"
  }
  ```
</ResponseExample>
