# Team members

> List the members of your workspace with their ids and roles, and use those ids to assign leads from your CRM.

Source: https://docs.whatsetter.com/developers/guides/team/

A team member is a person who has access to your WhatSetter workspace. The API lists them so your tools can put a name on an owner and assign leads by id.

## Endpoints

| Method | Path | Scope |
|---|---|---|
| GET | [`/team/members`](/api-reference/operations/listteammembers/) | `team:read` |

## List members

**cURL**

```bash
curl "https://app.whatsetter.com/api/v1/team/members" \
  -H "Authorization: Bearer ws_live_…"
```

**JavaScript**

```js
const res = await fetch('https://app.whatsetter.com/api/v1/team/members', {
  headers: { Authorization: 'Bearer ws_live_…' },
});
const { data: members } = await res.json();
```

**Python**

```python
import requests

r = requests.get(
    "https://app.whatsetter.com/api/v1/team/members",
    headers={"Authorization": "Bearer ws_live_…"},
)
members = r.json()["data"]
```

```json
{
  "data": [
    {
      "id": "66a1b2c3d4e5f6a7b8c9d0e1",
      "name": "Julien Martin",
      "email": "julien@acme.com",
      "role": "editor",
      "is_owner": false
    },
    {
      "id": "66a1b2c3d4e5f6a7b8c9d0e2",
      "name": "Marie Dupont",
      "email": "marie@acme.com",
      "role": "owner",
      "is_owner": true
    }
  ]
}
```

There is no pagination: teams are small, and a workspace holds at most 200 members. The source is the same membership list the dashboard's **Team** page shows.

## Assign leads with these ids

`id` is what [`PATCH /leads/{id}`](/developers/guides/leads/) expects in `assigned_to`:

```bash
curl -X PATCH "https://app.whatsetter.com/api/v1/leads/66f1a2b3c4d5e6f7a8b9c0d1" \
  -H "Authorization: Bearer ws_live_…" \
  -H "Content-Type: application/json" \
  -d '{"assigned_to":"66a1b2c3d4e5f6a7b8c9d0e1"}'
```

An id that is not a member of the workspace answers `422 validation_error`. Cache the list on your side and refresh it when an assignment fails: someone may have left the team.

## What the role means

`role` is the dashboard preset the member's permissions match: `owner`, `admin`, `editor`, `responder`, `viewer`, or `custom` when the permissions were adjusted by hand. `is_owner` is `true` for the person who owns the workspace. People invited but not confirmed yet are not listed: they cannot own a lead. Owner comes first, then names in alphabetical order.

| Role | In two words |
|---|---|
| `owner` | Everything, including billing and workspace deletion. |
| `admin` | Manages campaigns, team and integrations, not billing. |
| `editor` | Day-to-day work: campaigns, conversations, leads. |
| `responder` | Answers conversations and handles the leads in scope. |
| `viewer` | Reads everything, changes nothing. |
| `custom` | Permissions adjusted by hand in the dashboard. |

Permissions are enforced server-side on every action in the dashboard. The API key itself has its own scopes and does not inherit any member's role. See [Team and roles](/dashboard/team/) for the details.

## Errors you will meet

| HTTP | `code` | When |
|---|---|---|
| 401 | `missing_api_key`, `invalid_api_key` | Key absent, unknown or revoked. |
| 403 | `insufficient_scope` | The key lacks `team:read`. |
| 429 | `rate_limited` | Too many requests this minute. Honor `Retry-After`. |

## Related

- [Leads: assign an owner](/developers/guides/leads/)
- [Team and roles in the dashboard](/dashboard/team/)
- [Authentication and scopes](/developers/authentication/)
