# Members

Members of organizations

Endpoint: `https://api.bookingmood.com/v1/members`, supporting `GET`, `POST`, `DELETE`. Authenticate with the header `Authorization: Bearer YOUR_API_KEY` (see [authentication](https://www.bookingmood.com/sr-Cyrl/api-reference/authentication.md)).

## The member object

| Attribute | Type | Description |
| --- | --- | --- |
| `id` | `uuid` | Unique identifier. |
| `organization_id` | `uuid` | Identifier of the organization this member is defined in. References [`organizations.id`](https://www.bookingmood.com/sr-Cyrl/api-reference/organizations.md). |
| `user_id` | `uuid` | Identifier of the related user. References [`user_profiles.user_id`](https://www.bookingmood.com/sr-Cyrl/api-reference/user_profiles.md). |
| `created_at` | `timestamp with time zone` | Creation timestamp. Read-only: set by the database. |
| `updated_at` | `timestamp with time zone` | Last modification timestamp. Read-only: set by the database. |
| `role` | `Role` | Role of the member. |

```json
{
  "id": "00000000-0000-0000-0000-000000000000",
  "organization_id": "00000000-0000-0000-0000-000000000000",
  "user_id": "00000000-0000-0000-0000-000000000000",
  "created_at": "2026-10-30T23:37:06.667Z",
  "updated_at": "2026-10-30T23:37:06.667Z",
  "role": "user"
}
```

### Types

```typescript
type Role = "user" | "admin" | "superuser";
```

### Related resources

Embed related resources with the [`select` parameter](https://www.bookingmood.com/sr-Cyrl/api-reference/selecting.md), e.g. `select=*,organizations(*)`. Resources related through more than one column need the column as a hint, like `table!column(*)`.

| Embed | Type | Description |
| --- | --- | --- |
| `organizations(*)` | `object \| null` | The [organization](https://www.bookingmood.com/sr-Cyrl/api-reference/organizations.md) referenced by `organization_id`. |
| `user_profiles(*)` | `object \| null` | The [user profile](https://www.bookingmood.com/sr-Cyrl/api-reference/user_profiles.md) referenced by `user_id`. |
| `permissions(*)` | `array` | The [permissions](https://www.bookingmood.com/sr-Cyrl/api-reference/permissions.md) referencing this member through `permissions.member_id`. |
| `task_assignees(*)` | `array` | The [task assignees](https://www.bookingmood.com/sr-Cyrl/api-reference/task_assignees.md) referencing this member through `task_assignees.member_id`. |
| `task_template_assignees(*)` | `array` | The [task template assignees](https://www.bookingmood.com/sr-Cyrl/api-reference/task_template_assignees.md) referencing this member through `task_template_assignees.member_id`. |

## List members

`GET /v1/members`

Filter on any attribute with `column=operator.value` (see [filtering](https://www.bookingmood.com/sr-Cyrl/api-reference/filtering.md)). Choose columns and embed related resources with `select` (see [selecting](https://www.bookingmood.com/sr-Cyrl/api-reference/selecting.md)), and sort and paginate with `order`, `limit` and `offset` (see [sorting and pagination](https://www.bookingmood.com/sr-Cyrl/api-reference/sorting-pagination.md)).

```bash
curl -X GET "https://api.bookingmood.com/v1/members?select=*&limit=10" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

Responses:

- `200`: A list of members with the selected columns. `206` when the list is a partial range.
- `400`: The request is malformed, for example an unknown column or an invalid filter.
- `401`: The API key is missing or invalid.

## Invite member

`POST /v1/members`

Invite a new member with the user role to your organization. An invitation email is sent to the given address.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `email` | `string` | Yes | The email address of the member to invite. |
| `language` | `Language` | No | The member's preferred language. |
| `name` | `string` | No | The name of the member to invite. |

```bash
curl -X POST "https://api.bookingmood.com/v1/members" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "john@example.com",
    "name": "John Doe"
  }'
```

## Revoke member

`DELETE /v1/members?id={id}`

Revoke a member's access to your organization. Only works for members with the user role. To revoke admins or superusers, use the dashboard. Responds with the deleted member.

```bash
curl -X DELETE "https://api.bookingmood.com/v1/members?id=00000000-0000-0000-0000-000000000000" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

Errors have a JSON body with a `code`, `message`, `details` and `hint`. See the [introduction](https://www.bookingmood.com/sr-Cyrl/api-reference.md) for more on errors. The full API is described by the OpenAPI spec at https://api.bookingmood.com/v1/openapi.json.
