---
title: "Create the signed-in user default workspace"
description: "Verified session only; requested user must equal the session subject. Existing membership prevents default creation."
---

> Documentation Index
> Fetch the complete documentation index at: https://developer.channelautomations.com/llms.txt
> Use this file to discover all available pages before exploring further.

Path: Channel Automation API › Workspaces

`POST /api/workspace-members/create-default`

Verified session only; requested user must equal the session subject. Existing membership prevents default creation.

## Authentication

- `BearerAuth`, http, header `Authorization`, format `JWT`

## Request body

_Required._

- `workspace_id` (`post/api/workspace-members/create-default.workspace_id`; string, optional)
- `user_id` (`post/api/workspace-members/create-default.user_id`; string, optional)
- `role` (`post/api/workspace-members/create-default.role`; string, optional)
  - one of `"owner"`, `"admin"`, `"manager"`, `"agent"`, `"viewer"`

## Example request

```json
{
  "workspace_id": "string",
  "user_id": "string",
  "role": "owner"
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url https://api.channelautomation.com/api/workspace-members/create-default \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "workspace_id": "string",
  "user_id": "string",
  "role": "owner"
}
'
```

### TypeScript

```typescript
const url = 'https://api.channelautomation.com/api/workspace-members/create-default';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({workspace_id: 'string', user_id: 'string', role: 'owner'})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.channelautomation.com/api/workspace-members/create-default"

payload = {
    "workspace_id": "string",
    "user_id": "string",
    "role": "owner"
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

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

print(response.text)
```

## Responses

### 200

Operation completed

### 201

Member or workspace created

### 400

Invalid request

### 401

Invalid or missing verified identity

### 403

Current authority denied

### 404

Workspace or member not found

### 409

Existing member or workspace

### 503

Authority verification unavailable


Source: https://developer.channelautomations.com/api/post-api-workspace-members-create-default/index.md
