# Clients and contacts

Clients and their contacts: the people invoices go to. A client owns projects and contacts. Archiving a client archives its projects.

HTML version: https://t.momentic.studio/docs/api/clients

## Endpoints

- `GET /api/v2/clients`: [List clients](https://t.momentic.studio/docs/api/clients#get-clients)
- `GET /api/v2/clients/{client_id}`: [Retrieve a client](https://t.momentic.studio/docs/api/clients#get-clients-client-id)
- `POST /api/v2/clients`: [Create a client](https://t.momentic.studio/docs/api/clients#post-clients)
- `PATCH /api/v2/clients/{client_id}`: [Update a client](https://t.momentic.studio/docs/api/clients#patch-clients-client-id)
- `DELETE /api/v2/clients/{client_id}`: [Delete a client](https://t.momentic.studio/docs/api/clients#delete-clients-client-id)
- `GET /api/v2/contacts`: [List contacts](https://t.momentic.studio/docs/api/clients#get-contacts)
- `GET /api/v2/contacts/{contact_id}`: [Retrieve a contact](https://t.momentic.studio/docs/api/clients#get-contacts-contact-id)
- `POST /api/v2/contacts`: [Create a contact](https://t.momentic.studio/docs/api/clients#post-contacts)
- `PATCH /api/v2/contacts/{contact_id}`: [Update a contact](https://t.momentic.studio/docs/api/clients#patch-contacts-contact-id)
- `DELETE /api/v2/contacts/{contact_id}`: [Delete a contact](https://t.momentic.studio/docs/api/clients#delete-contacts-contact-id)

## List clients

`GET /api/v2/clients`

Supported with differences. Scope: `reports:read`.

Owners, admins and managers; a member is refused (403). address is null and currency is USD.

Query parameters:

| Name            | Type     | Required | Description                                                                                                    |
| --------------- | -------- | -------- | -------------------------------------------------------------------------------------------------------------- |
| `is_active`     | boolean  | no       | true for active records only, false for archived only. Another value is ignored, as in Harvest.                |
| `updated_since` | datetime | no       | Only records changed at or after this ISO 8601 date-time. A value that is not a date-time is refused with 400. |
| `page`          | integer  | no       | The page to return, from 1. Default 1. A page past the end returns no records.                                 |
| `per_page`      | integer  | no       | Records per page, 1 to 2000. Default 2000. Another value is refused with 400.                                  |

Returns 200 with a page of client objects under `clients`.

Example request:

```bash
curl "https://t.momentic.studio/api/v2/clients" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Harvest-Account-Id: $ACCOUNT_ID" \
  -H "User-Agent: MyApp (admin@example.com)"
```

Example response, status 200:

```json
{
  "clients": [
    {
      "id": 2001,
      "name": "Example Client",
      "is_active": true,
      "address": null,
      "statement_key": "",
      "currency": "USD",
      "created_at": "2026-01-05T15:00:00Z",
      "updated_at": "2026-01-05T15:00:00Z"
    }
  ],
  "per_page": 2000,
  "total_pages": 1,
  "total_entries": 1,
  "next_page": null,
  "previous_page": null,
  "page": 1,
  "links": {
    "first": "https://t.momentic.studio/api/v2/clients?page=1&per_page=2000&ref=first",
    "next": null,
    "previous": null,
    "last": "https://t.momentic.studio/api/v2/clients?page=1&per_page=2000&ref=last"
  }
}
```

## Retrieve a client

`GET /api/v2/clients/{client_id}`

Supported with differences. Scope: `reports:read`.

Returns 200 with a client object.

Example request:

```bash
curl "https://t.momentic.studio/api/v2/clients/2001" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Harvest-Account-Id: $ACCOUNT_ID" \
  -H "User-Agent: MyApp (admin@example.com)"
```

Example response, status 200:

```json
{
  "id": 2001,
  "name": "Example Client",
  "is_active": true,
  "address": null,
  "statement_key": "",
  "currency": "USD",
  "created_at": "2026-01-05T15:00:00Z",
  "updated_at": "2026-01-05T15:00:00Z"
}
```

## Create a client

`POST /api/v2/clients`

Supported with differences. Scope: `clients:write`.

address and currency are ignored.

Body, as JSON or form fields:

| Name        | Type    | Required | Description                              |
| ----------- | ------- | -------- | ---------------------------------------- |
| `name`      | string  | yes      | The client's name, up to 200 characters. |
| `is_active` | boolean | no       | false creates it archived.               |

Returns 201 with a client object.

Example request:

```bash
curl -X POST "https://t.momentic.studio/api/v2/clients" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Harvest-Account-Id: $ACCOUNT_ID" \
  -H "User-Agent: MyApp (admin@example.com)" \
  -H "Content-Type: application/json" \
  -d '{"name":"Example Client"}'
```

Example response, status 201:

```json
{
  "id": 2001,
  "name": "Example Client",
  "is_active": true,
  "address": null,
  "statement_key": "",
  "currency": "USD",
  "created_at": "2026-01-05T15:00:00Z",
  "updated_at": "2026-01-05T15:00:00Z"
}
```

## Update a client

`PATCH /api/v2/clients/{client_id}`

Supported with differences. Scope: `clients:write`.

Changes name and is_active. address and currency are ignored.

Body, as JSON or form fields:

| Name        | Type    | Required | Description                                                   |
| ----------- | ------- | -------- | ------------------------------------------------------------- |
| `name`      | string  | no       | The client's name.                                            |
| `is_active` | boolean | no       | false archives the client and its projects; true restores it. |

Returns 200 with a client object.

Example request:

```bash
curl -X PATCH "https://t.momentic.studio/api/v2/clients/2001" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Harvest-Account-Id: $ACCOUNT_ID" \
  -H "User-Agent: MyApp (admin@example.com)"
```

Example response, status 200:

```json
{
  "id": 2001,
  "name": "Example Client",
  "is_active": true,
  "address": null,
  "statement_key": "",
  "currency": "USD",
  "created_at": "2026-01-05T15:00:00Z",
  "updated_at": "2026-01-05T15:00:00Z"
}
```

## Delete a client

`DELETE /api/v2/clients/{client_id}`

Not supported. Scope: `clients:write`.

Archive with is_active false. Deleting clients is not offered by the app.

Returns 200 with no body.

Example request:

```bash
curl -X DELETE "https://t.momentic.studio/api/v2/clients/2001" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Harvest-Account-Id: $ACCOUNT_ID" \
  -H "User-Agent: MyApp (admin@example.com)"
```

## List contacts

`GET /api/v2/contacts`

Supported with differences. Scope: `reports:read`.

Owners, admins and managers; a member is refused (403). A contact has one name and one phone number: first_name is the first word of the name, the phone is phone_office, and phone_mobile and fax are empty. invoice_recipient_status is none: invoice recipients are chosen per client in the app.

Query parameters:

| Name            | Type     | Required | Description                                                                                                    |
| --------------- | -------- | -------- | -------------------------------------------------------------------------------------------------------------- |
| `client_id`     | integer  | no       | Only this client's contacts.                                                                                   |
| `updated_since` | datetime | no       | Only records changed at or after this ISO 8601 date-time. A value that is not a date-time is refused with 400. |
| `page`          | integer  | no       | The page to return, from 1. Default 1. A page past the end returns no records.                                 |
| `per_page`      | integer  | no       | Records per page, 1 to 2000. Default 2000. Another value is refused with 400.                                  |

Returns 200 with a page of contact objects under `contacts`.

Example request:

```bash
curl "https://t.momentic.studio/api/v2/contacts" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Harvest-Account-Id: $ACCOUNT_ID" \
  -H "User-Agent: MyApp (admin@example.com)"
```

Example response, status 200:

```json
{
  "contacts": [
    {
      "id": 8001,
      "client": {
        "id": 2001,
        "name": "Example Client"
      },
      "title": "Finance lead",
      "first_name": "Pat",
      "last_name": "Example",
      "email": "pat@example.com",
      "phone_office": "555-0100",
      "phone_mobile": "",
      "fax": "",
      "invoice_recipient_status": "none",
      "created_at": "2026-01-05T15:00:00Z",
      "updated_at": "2026-01-05T15:00:00Z"
    }
  ],
  "per_page": 2000,
  "total_pages": 1,
  "total_entries": 1,
  "next_page": null,
  "previous_page": null,
  "page": 1,
  "links": {
    "first": "https://t.momentic.studio/api/v2/contacts?page=1&per_page=2000&ref=first",
    "next": null,
    "previous": null,
    "last": "https://t.momentic.studio/api/v2/contacts?page=1&per_page=2000&ref=last"
  }
}
```

## Retrieve a contact

`GET /api/v2/contacts/{contact_id}`

Supported with differences. Scope: `reports:read`.

Returns 200 with a contact object.

Example request:

```bash
curl "https://t.momentic.studio/api/v2/contacts/1" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Harvest-Account-Id: $ACCOUNT_ID" \
  -H "User-Agent: MyApp (admin@example.com)"
```

Example response, status 200:

```json
{
  "id": 8001,
  "client": {
    "id": 2001,
    "name": "Example Client"
  },
  "title": "Finance lead",
  "first_name": "Pat",
  "last_name": "Example",
  "email": "pat@example.com",
  "phone_office": "555-0100",
  "phone_mobile": "",
  "fax": "",
  "invoice_recipient_status": "none",
  "created_at": "2026-01-05T15:00:00Z",
  "updated_at": "2026-01-05T15:00:00Z"
}
```

## Create a contact

`POST /api/v2/contacts`

Supported with differences. Scope: `clients:write`.

email is required here: the app sends invoices to contacts by email. phone_office, or else phone_mobile, is kept as the one phone number; fax is ignored. A client has one contact per email address.

Body, as JSON or form fields:

| Name           | Type    | Required | Description                         |
| -------------- | ------- | -------- | ----------------------------------- |
| `client_id`    | integer | yes      | The client.                         |
| `first_name`   | string  | yes      | First name.                         |
| `last_name`    | string  | no       | Last name.                          |
| `email`        | string  | yes      | Email.                              |
| `title`        | string  | no       | Title.                              |
| `phone_office` | string  | no       | Phone number.                       |
| `phone_mobile` | string  | no       | Used when phone_office is not sent. |

Returns 201 with a contact object.

Example request:

```bash
curl -X POST "https://t.momentic.studio/api/v2/contacts" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Harvest-Account-Id: $ACCOUNT_ID" \
  -H "User-Agent: MyApp (admin@example.com)" \
  -H "Content-Type: application/json" \
  -d '{"client_id":2001,"first_name":"Alex","email":"alex@example.com"}'
```

Example response, status 201:

```json
{
  "id": 8001,
  "client": {
    "id": 2001,
    "name": "Example Client"
  },
  "title": "Finance lead",
  "first_name": "Pat",
  "last_name": "Example",
  "email": "pat@example.com",
  "phone_office": "555-0100",
  "phone_mobile": "",
  "fax": "",
  "invoice_recipient_status": "none",
  "created_at": "2026-01-05T15:00:00Z",
  "updated_at": "2026-01-05T15:00:00Z"
}
```

## Update a contact

`PATCH /api/v2/contacts/{contact_id}`

Supported with differences. Scope: `clients:write`.

Changes first_name, last_name, title, email and the phone number. client_id and fax are ignored: a contact stays with its client.

Body, as JSON or form fields:

| Name           | Type   | Required | Description   |
| -------------- | ------ | -------- | ------------- |
| `first_name`   | string | no       | First name.   |
| `last_name`    | string | no       | Last name.    |
| `email`        | string | no       | Email.        |
| `title`        | string | no       | Title.        |
| `phone_office` | string | no       | Phone number. |

Returns 200 with a contact object.

Example request:

```bash
curl -X PATCH "https://t.momentic.studio/api/v2/contacts/1" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Harvest-Account-Id: $ACCOUNT_ID" \
  -H "User-Agent: MyApp (admin@example.com)"
```

Example response, status 200:

```json
{
  "id": 8001,
  "client": {
    "id": 2001,
    "name": "Example Client"
  },
  "title": "Finance lead",
  "first_name": "Pat",
  "last_name": "Example",
  "email": "pat@example.com",
  "phone_office": "555-0100",
  "phone_mobile": "",
  "fax": "",
  "invoice_recipient_status": "none",
  "created_at": "2026-01-05T15:00:00Z",
  "updated_at": "2026-01-05T15:00:00Z"
}
```

## Delete a contact

`DELETE /api/v2/contacts/{contact_id}`

Supported. Scope: `clients:write`.

Returns 200 with no body.

Example request:

```bash
curl -X DELETE "https://t.momentic.studio/api/v2/contacts/1" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Harvest-Account-Id: $ACCOUNT_ID" \
  -H "User-Agent: MyApp (admin@example.com)"
```

## The client object

| Field           | Type           | Description                                                                     |
| --------------- | -------------- | ------------------------------------------------------------------------------- |
| `id`            | integer        | The client's id.                                                                |
| `name`          | string         | The client's name.                                                              |
| `is_active`     | boolean        | False when the client is archived.                                              |
| `address`       | string or null | Null. The time tracker has no such data, so this is the empty value.            |
| `statement_key` | string         | An empty string. The time tracker has no such data, so this is the empty value. |
| `currency`      | string         | USD.                                                                            |
| `created_at`    | datetime       | When the record was created.                                                    |
| `updated_at`    | datetime       | When the record was last changed.                                               |

## The contact object

| Field                      | Type                | Description                                                                                          |
| -------------------------- | ------------------- | ---------------------------------------------------------------------------------------------------- |
| `id`                       | integer             | The contact's id.                                                                                    |
| `client`                   | object (client_ref) | The contact's client.                                                                                |
| `title`                    | string              | The contact's title, or an empty string.                                                             |
| `first_name`               | string              | The first word of the contact's name.                                                                |
| `last_name`                | string              | The rest of the contact's name.                                                                      |
| `email`                    | string              | The contact's email.                                                                                 |
| `phone_office`             | string              | The contact's phone number, or an empty string. The time tracker keeps one phone number per contact. |
| `phone_mobile`             | string              | An empty string. The time tracker keeps one phone number per contact, returned as phone_office.      |
| `fax`                      | string              | An empty string. The time tracker has no such data, so this is the empty value.                      |
| `invoice_recipient_status` | string              | none. Invoice recipients are chosen per client in the app, not on the contact.                       |
| `created_at`               | datetime            | When the record was created.                                                                         |
| `updated_at`               | datetime            | When the record was last changed.                                                                    |

## The client ref object

| Field  | Type    | Description        |
| ------ | ------- | ------------------ |
| `id`   | integer | The client's id.   |
| `name` | string  | The client's name. |
