> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.cadrooms.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.cadrooms.com/_mcp/server.

# Add members

POST https://api.cadrooms.workers.dev/v1/members
Content-Type: application/json

Adds people to a workspace or project by email address. Specify either `workspaceId` or `projectId`.

**Workspace**

Adds people to a workspace by email address. Users with an existing CAD ROOMS account become members immediately. Invitations are created for email addresses not associated with an existing account. Email addresses with pending invitations are skipped.

CAD ROOMS validates all specified roles before adding any members. The entire request fails if any specified role is not a valid workspace role or if you do not have permission to grant it.

A workspace owner can grant any workspace role. A workspace admin can grant the Member, Viewer, and Guest roles.

CAD ROOMS sends invitation emails only after the invitations have been created.

Members added as Owners or Admins are also assigned the Admin role in every project within the workspace.

The request returns `403` if the workspace does not have enough available seats for the invitations. Guests do not occupy seats.

**Project**

Adds people to a project by email address. Users with an existing CAD ROOMS account become members immediately, and CAD ROOMS records a `member.added` entry in the project's activity. Invitations are created for email addresses not associated with an existing account. Email addresses with pending invitations are skipped.

CAD ROOMS validates all specified roles before adding any members. The entire request fails if any specified role is not a valid project role.

CAD ROOMS sends invitation emails only after the invitations have been created.

People who could not be added are listed in `errors`. The remaining people are added successfully.

Required permission: Workspace owner or admin for a workspace. Admin in the project for a project.


Reference: https://docs.cadrooms.com/api-reference/members/create-members

## Authentication

- `Authorization` header (bearer token, required) — An API key associated with your user account and workspace. API requests inherit your existing workspace permissions.
- `Authorization` header (bearer token, required) — The session token of a user signed in to the CAD ROOMS app. Every endpoint accepts it in place of an API key.

## Request

### Body (application/json)

This endpoint expects an object.

- `members` (list of MemberAddition, required) — The people to add.
- `workspaceId` (string, optional) — The workspace to add people to. Send either this or `projectId`.
- `projectId` (string, optional) — The project to add people to. Send either this or `workspaceId`.

## Response

### 201

Returns the people added and the invites created in `data`. An email that failed is listed in `errors`.

- `data` (list of MemberAdditionResultDataItems, required) — The people added, and the invites created for emails with no CAD ROOMS account.
- `errors` (list of MemberAdditionResultErrorsItems, optional) — Emails that could not be added, and emails whose invite could not be sent.

## Errors

### 400 Bad Request Error

The request contains invalid or missing parameters. See `details` for specific validation errors.

- `error` (ErrorError, required)

### 401 Unauthorized Error

The API key is missing, invalid, expired, or revoked.

- `error` (ErrorError, required)

### 403 Forbidden Error

The workspace plan does not support the requested feature.

- `error` (ErrorError, required)

### 404 Not Found Error

The requested resource does not exist or is not accessible to your account. Both cases return the same response.

- `error` (ErrorError, required)

### 429 Too Many Requests Error

The rate limit has been exceeded. Wait for the duration specified in the `Retry-After` header before retrying.

- `error` (ErrorError, required)

### 500 Internal Server Error

An unexpected server error occurred. Retry later. Include the `requestId` when contacting support.

- `error` (ErrorError, required)

## Types

### MemberAddition

One person to add to a workspace or project.

- `email` (string, required) — Email of the person.
- `role` (enum, required) — Name of a role. A workspace accepts `owner`, `admin`, `member`, `viewer` and `guest`. A project accepts `admin`, `collaborator` and `viewer`.
  - Allowed values: `owner`, `admin`, `member`, `viewer`, `guest`, `collaborator`

### MemberAdditionResultDataItems

- `user` (User, required, nullable) — The member, or `null` for a pending invite.
- `email` (string, required) — Email of the member or the invited person.
- `role` (enum, required) — Name of a role. A workspace accepts `owner`, `admin`, `member`, `viewer` and `guest`. A project accepts `admin`, `collaborator` and `viewer`.
  - Allowed values: `owner`, `admin`, `member`, `viewer`, `guest`, `collaborator`
- `status` (enum, required) — Whether the person is a member, or has a pending invite.
  - Allowed values: `confirmed`, `pending`
- `inviteId` (string, required, nullable) — ID of the pending invite, or `null` for a member.

### MemberAdditionResultErrorsItems

- `email` (string, required) — The email.
- `reason` (string, required) — Why the email failed.

### ErrorError

- `code` (string, required) — Stable error identifier for programmatic error handling. Every endpoint can return the general codes listed on the Errors page. Where a business condition applies, an endpoint returns a more specific code, documented on that endpoint.
- `message` (string, required) — Human-readable error description. May change over time.
- `requestId` (string, required) — Unique request identifier used for troubleshooting. The same value is returned in the `Request-Id` header of every response. Include this when contacting support.
- `details` (list of ErrorErrorDetailsItems, optional) — Optional. Contains field-level validation errors for `400` responses.

### User

Represents a CAD ROOMS user.

- `id` (string, required) — Unique identifier for the user.
- `displayName` (string, required) — User's display name in the CAD ROOMS app.

### ErrorErrorDetailsItems

- `field` (string, required) — Name of the request field that failed validation.
- `message` (string, required) — Description of the validation issue.

## Examples

**Request**

```json
{
  "members": [
    {
      "email": "jane.doe@example.com",
      "role": "viewer"
    }
  ],
  "workspaceId": "1fb60bd2-19f9-47a9-bea9-27898f43a0d5"
}
```

**Response**

```json
{
  "data": [
    {
      "user": {
        "id": "40a078d1-1f99-459a-a09a-f21da9c5dce4",
        "displayName": "John Doe"
      },
      "email": "jane.doe@example.com",
      "role": "viewer",
      "status": "pending",
      "inviteId": "fd0877a8-700e-4b6f-9bd1-fc4566d6fe90"
    }
  ],
  "errors": []
}
```

**SDK Code**

```python Members_createMembers_example
import requests

url = "https://api.cadrooms.workers.dev/v1/members"

payload = {
    "members": [
        {
            "email": "jane.doe@example.com",
            "role": "viewer"
        }
    ],
    "workspaceId": "1fb60bd2-19f9-47a9-bea9-27898f43a0d5"
}
headers = {
    "Authorization": "Bearer <API key>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Members_createMembers_example
const url = 'https://api.cadrooms.workers.dev/v1/members';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <API key>', 'Content-Type': 'application/json'},
  body: '{"members":[{"email":"jane.doe@example.com","role":"viewer"}],"workspaceId":"1fb60bd2-19f9-47a9-bea9-27898f43a0d5"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Members_createMembers_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.cadrooms.workers.dev/v1/members"

	payload := strings.NewReader("{\n  \"members\": [\n    {\n      \"email\": \"jane.doe@example.com\",\n      \"role\": \"viewer\"\n    }\n  ],\n  \"workspaceId\": \"1fb60bd2-19f9-47a9-bea9-27898f43a0d5\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <API key>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Members_createMembers_example
require 'uri'
require 'net/http'

url = URI("https://api.cadrooms.workers.dev/v1/members")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <API key>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"members\": [\n    {\n      \"email\": \"jane.doe@example.com\",\n      \"role\": \"viewer\"\n    }\n  ],\n  \"workspaceId\": \"1fb60bd2-19f9-47a9-bea9-27898f43a0d5\"\n}"

response = http.request(request)
puts response.read_body
```

```java Members_createMembers_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.cadrooms.workers.dev/v1/members")
  .header("Authorization", "Bearer <API key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"members\": [\n    {\n      \"email\": \"jane.doe@example.com\",\n      \"role\": \"viewer\"\n    }\n  ],\n  \"workspaceId\": \"1fb60bd2-19f9-47a9-bea9-27898f43a0d5\"\n}")
  .asString();
```

```php Members_createMembers_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.cadrooms.workers.dev/v1/members', [
  'body' => '{
  "members": [
    {
      "email": "jane.doe@example.com",
      "role": "viewer"
    }
  ],
  "workspaceId": "1fb60bd2-19f9-47a9-bea9-27898f43a0d5"
}',
  'headers' => [
    'Authorization' => 'Bearer <API key>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Members_createMembers_example
using RestSharp;

var client = new RestClient("https://api.cadrooms.workers.dev/v1/members");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <API key>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"members\": [\n    {\n      \"email\": \"jane.doe@example.com\",\n      \"role\": \"viewer\"\n    }\n  ],\n  \"workspaceId\": \"1fb60bd2-19f9-47a9-bea9-27898f43a0d5\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Members_createMembers_example
import Foundation

let headers = [
  "Authorization": "Bearer <API key>",
  "Content-Type": "application/json"
]
let parameters = [
  "members": [
    [
      "email": "jane.doe@example.com",
      "role": "viewer"
    ]
  ],
  "workspaceId": "1fb60bd2-19f9-47a9-bea9-27898f43a0d5"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.cadrooms.workers.dev/v1/members")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```