# Billable and cost rates

Read and add a person's billable rates over time. The API does not return cost rates. A billable rate applies from its start date until the next rate starts.

HTML version: https://t.momentic.studio/docs/api/billable-rates

## Endpoints

- `GET /api/v2/users/{user_id}/billable_rates`: [List a user's billable rates](https://t.momentic.studio/docs/api/billable-rates#get-users-user-id-billable-rates)
- `GET /api/v2/users/{user_id}/billable_rates/{billable_rate_id}`: [Retrieve a billable rate](https://t.momentic.studio/docs/api/billable-rates#get-users-user-id-billable-rates-billable-rate-id)
- `POST /api/v2/users/{user_id}/billable_rates`: [Create a billable rate](https://t.momentic.studio/docs/api/billable-rates#post-users-user-id-billable-rates)
- `GET /api/v2/users/{user_id}/cost_rates`: [List a user's cost rates](https://t.momentic.studio/docs/api/billable-rates#get-users-user-id-cost-rates)
- `GET /api/v2/users/{user_id}/cost_rates/{cost_rate_id}`: [Retrieve a cost rate](https://t.momentic.studio/docs/api/billable-rates#get-users-user-id-cost-rates-cost-rate-id)
- `POST /api/v2/users/{user_id}/cost_rates`: [Create a cost rate](https://t.momentic.studio/docs/api/billable-rates#post-users-user-id-cost-rates)

## List a user's billable rates

`GET /api/v2/users/{user_id}/billable_rates`

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

Needs rates:read, and an owner, admin or manager token, as in the app.

Query parameters:

| Name       | Type    | Required | Description                                                                    |
| ---------- | ------- | -------- | ------------------------------------------------------------------------------ |
| `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 billable rate objects under `billable_rates`.

Example request:

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

Example response, status 200:

```json
{
  "billable_rates": [
    {
      "id": 7,
      "amount": 150,
      "start_date": "2026-01-01",
      "end_date": null,
      "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/users/1001/billable_rates?page=1&per_page=2000&ref=first",
    "next": null,
    "previous": null,
    "last": "https://t.momentic.studio/api/v2/users/1001/billable_rates?page=1&per_page=2000&ref=last"
  }
}
```

## Retrieve a billable rate

`GET /api/v2/users/{user_id}/billable_rates/{billable_rate_id}`

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

Returns 200 with a billable rate object.

Example request:

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

Example response, status 200:

```json
{
  "id": 7,
  "amount": 150,
  "start_date": "2026-01-01",
  "end_date": null,
  "created_at": "2026-01-05T15:00:00Z",
  "updated_at": "2026-01-05T15:00:00Z"
}
```

## Create a billable rate

`POST /api/v2/users/{user_id}/billable_rates`

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

start_date is required here: the app keeps rate history from a date and does not replace it.

Body, as JSON or form fields:

| Name         | Type   | Required | Description                     |
| ------------ | ------ | -------- | ------------------------------- |
| `amount`     | number | yes      | The hourly rate in dollars.     |
| `start_date` | date   | yes      | The first day the rate applies. |

Returns 201 with a billable rate object.

Example request:

```bash
curl -X POST "https://t.momentic.studio/api/v2/users/1001/billable_rates" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Harvest-Account-Id: $ACCOUNT_ID" \
  -H "User-Agent: MyApp (admin@example.com)" \
  -H "Content-Type: application/json" \
  -d '{"amount":150,"start_date":"2026-03-01"}'
```

Example response, status 201:

```json
{
  "id": 7,
  "amount": 150,
  "start_date": "2026-01-01",
  "end_date": null,
  "created_at": "2026-01-05T15:00:00Z",
  "updated_at": "2026-01-05T15:00:00Z"
}
```

## List a user's cost rates

`GET /api/v2/users/{user_id}/cost_rates`

Not supported. Scope: `reports:read`.

This API does not return cost rates, for any role or scope: the list is empty, a single rate is not found (404) and a write is refused (403).

Query parameters:

| Name       | Type    | Required | Description                                                                    |
| ---------- | ------- | -------- | ------------------------------------------------------------------------------ |
| `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 cost rate objects under `cost_rates`.

Example request:

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

Example response, status 200:

```json
{
  "cost_rates": [],
  "per_page": 2000,
  "total_pages": 1,
  "total_entries": 0,
  "next_page": null,
  "previous_page": null,
  "page": 1,
  "links": {
    "first": "https://t.momentic.studio/api/v2/users/1001/cost_rates?page=1&per_page=2000&ref=first",
    "next": null,
    "previous": null,
    "last": "https://t.momentic.studio/api/v2/users/1001/cost_rates?page=1&per_page=2000&ref=last"
  }
}
```

## Retrieve a cost rate

`GET /api/v2/users/{user_id}/cost_rates/{cost_rate_id}`

Not supported. Scope: `reports:read`.

This API does not return cost rates, for any role or scope: the list is empty, a single rate is not found (404) and a write is refused (403).

Returns 200 with a cost rate object.

Example request:

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

## Create a cost rate

`POST /api/v2/users/{user_id}/cost_rates`

Not supported. Scope: `time:write`.

This API does not return cost rates, for any role or scope: the list is empty, a single rate is not found (404) and a write is refused (403).

Returns 200 with no body.

Example request:

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

## The billable rate object

| Field        | Type         | Description                                                  |
| ------------ | ------------ | ------------------------------------------------------------ |
| `id`         | integer      | The rate's id.                                               |
| `amount`     | number       | The hourly rate in dollars.                                  |
| `start_date` | date or null | The first day the rate applies.                              |
| `end_date`   | date or null | The last day the rate applies, or null for the current rate. |
| `created_at` | datetime     | When the record was created.                                 |
| `updated_at` | datetime     | When the record was last changed.                            |
