# User profiles

User profiles

Endpoint: `https://api.bookingmood.com/v1/user_profiles`, supporting `GET`. Authenticate with the header `Authorization: Bearer YOUR_API_KEY` (see [authentication](https://www.bookingmood.com/bg-BG/api-reference/authentication.md)).

## The user profile object

| Attribute | Type | Description |
| --- | --- | --- |
| `referrer_id` | `uuid \| null` | Identifier of the user that referred the user. |
| `user_id` | `uuid` | Unique identifier. |
| `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. |
| `avatar` | `text \| null` | URL of the avatar image. |
| `email` | `text` | Email address of the user. |
| `first_week_contains_date` | `1 \| 4 \| null` | Day of January the first week of the year contains: `1`, or `4` as in ISO 8601. |
| `fts` | `tsvector` | Full text search index. Read-only: set by the database. |
| `language` | `Language` | Language of the user. |
| `last_login_at` | `timestamp with time zone \| null` | Timestamp at which the user last logged in. |
| `name` | `text \| null` | Name of the user. |
| `source` | `text \| null` | Source of the user. |
| `week_starts_on` | `Day \| null` | First day of the week: `0` for Sunday or `1` for Monday. |

```json
{
  "referrer_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",
  "avatar": "",
  "email": "guest@example.com",
  "first_week_contains_date": 0,
  "language": "en-US",
  "last_login_at": "2026-10-30T23:37:06.667Z",
  "name": "Summer cottage",
  "source": "",
  "week_starts_on": 0
}
```

### Types

```typescript
type Day = 6 | 0 | 1 | 2 | 3 | 4 | 5;

type Language = 
  | "be-BY"
  | "bg-BG"
  | "cs-CZ"
  | "da-DK"
  | "de-DE"
  | "en-GB"
  | "en-NZ"
  | "en-US"
  | "es-ES"
  | "eu-ES"
  | "fr-FR"
  | "gr-EL"
  | "he-IL"
  | "hr-HR"
  | "hu-HU"
  | "it-IT"
  | "ja-JP"
  | "lt-LT"
  | "lv-LV"
  | "nl-NL"
  | "nn-NO"
  | "pl-PL"
  | "pt-BR"
  | "ro-RO"
  | "ru-RU"
  | "sk-SK"
  | "sl-SI"
  | "sr-Cyrl"
  | "sr-Latn"
  | "sv-SE"
  | "tr-TR"
  | "uk-UA";
```

### Related resources

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

| Embed | Type | Description |
| --- | --- | --- |
| `calendar_event_notes(*)` | `array` | The [calendar event notes](https://www.bookingmood.com/bg-BG/api-reference/calendar_event_notes.md) referencing this user profile through `calendar_event_notes.author_id`. |
| `calendar_events!creator_id(*)` | `array` | The [calendar events](https://www.bookingmood.com/bg-BG/api-reference/calendar_events.md) referencing this user profile through `calendar_events.creator_id`. |
| `contacts(*)` | `array` | The [contacts](https://www.bookingmood.com/bg-BG/api-reference/contacts.md) referencing this user profile through `contacts.creator_id`. |
| `members(*)` | `array` | The [members](https://www.bookingmood.com/bg-BG/api-reference/members.md) referencing this user profile through `members.user_id`. |
| `organizations!referrer_id(*)` | `array` | The [organizations](https://www.bookingmood.com/bg-BG/api-reference/organizations.md) referencing this user profile through `organizations.referrer_id`. |

## List user profiles

`GET /v1/user_profiles`

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

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

Responses:

- `200`: A list of user profiles 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.

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