Admin permissions required.

The cost rate object

Attribute Type Description
id integer Unique ID for the cost rate.
amount decimal The amount of the cost rate.
start_date date The date the cost rate is effective.
end_date date The date the cost rate is no longer effective. This date is calculated by Harvest.
created_at datetime Date and time the cost rate was created.
updated_at datetime Date and time the cost rate was last updated.

List all cost rates for a specific user

Returns a list of cost rates for the user identified by USER_ID. The cost rates are returned sorted by start_date, with the oldest starting cost rates appearing first.

The response contains an object with a cost_rates property that contains an array of up to per_page cost rates. Each entry in the array is a separate cost rate object. If no more cost rates are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your cost rates.

GET /v2/users/{USER_ID}/cost_rates
Parameter Type Description
page integer The page number to use in pagination. For instance, if you make a list request and receive 100 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)
per_page integer The number of records to return per page. Can range between 1 and 100. (Default: 100)

Example Request:

curl "https://api.harvestapp.com/v2/users/1782974/cost_rates" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Harvest-Account-Id: $ACCOUNT_ID" \
  -H "User-Agent: MyApp (yourname@example.com)"

Example Response:

{
  "cost_rates":[
    {
      "id":125068554,
      "amount":75.0,
      "start_date":null,
      "end_date":"2016-12-31",
      "created_at":"2019-06-26T22:32:52Z",
      "updated_at":"2019-06-26T22:32:52Z"
    },
    {
      "id":125066109,
      "amount":100.0,
      "start_date":"2017-01-01",
      "end_date":"2017-12-31",
      "created_at":"2019-06-26T21:52:18Z",
      "updated_at":"2019-06-26T21:52:18Z"
    },
    {
      "id":125066110,
      "amount":125.0,
      "start_date":"2018-01-01",
      "end_date":null,
      "created_at":"2019-06-26T21:52:18Z",
      "updated_at":"2019-06-26T21:52:18Z"
    }
  ],
  "per_page":100,
  "total_pages":1,
  "total_entries":3,
  "next_page":null,
  "previous_page":null,
  "page":1,
  "links":{
    "first":"https://api.harvestapp.com/v2/users/1782974/cost_rates?page=1&per_page=100",
    "next":null,
    "previous":null,
    "last":"https://api.harvestapp.com/v2/users/1782974/cost_rates?page=1&per_page=100"
  }
}

Retrieve a cost rate

Retrieves the cost rate with the given ID. Returns a cost rate object and a 200 OK response code if a valid identifier was provided.

GET /v2/users/{USER_ID}/cost_rates/{COST_RATE_ID}

Example Request:

curl "https://api.harvestapp.com/v2/users/1782974/cost_rates/125068554" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Harvest-Account-Id: $ACCOUNT_ID" \
  -H "User-Agent: MyApp (yourname@example.com)"

Example Response:

{
  "id":125068554,
  "amount":100.0,
  "start_date":null,
  "end_date":"2016-12-31",
  "created_at":"2017-06-26T22:32:52Z",
  "updated_at":"2017-06-26T22:32:52Z"
}

Create a cost rate

Creates a new cost rate object. Returns a cost rate object and a 201 Created response code if the call succeeded.

  • Creating a cost rate with no start_date will replace a user’s existing rate(s).
  • Creating a cost rate with a start_date that is before a user’s existing rate(s) will replace those cost rates with the new one.
POST /v2/users/{USER_ID}/cost_rates
Parameter Type Required Description
amount decimal required The amount of the cost rate.
start_date date optional The date the cost rate is effective. Cannot be a date in the future.

Example Request:

curl "https://api.harvestapp.com/v2/users/1782974/cost_rates" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Harvest-Account-Id: $ACCOUNT_ID" \
  -H "User-Agent: MyApp (yourname@example.com)" \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{"amount":150.0,"start_date":"2019-01-01"}'

Example Response:

{
  "id":125068758,
  "amount":150.0,
  "start_date":"2019-01-01",
  "end_date":null,
  "created_at":"2019-01-06T22:36:01Z",
  "updated_at":"2019-01-06T22:36:01Z"
}