### Example Time Entry Response
Source: https://help.getharvest.com/api-v2/timesheets-api/timesheets/time-entries
This is an example of the JSON response received after successfully creating a time entry using start and end times. It includes details of the entry, associated user, project, task, and timestamps.
```json
{
"id":636718192,
"spent_date":"2017-03-21",
"user":{
"id":1782959,
"name":"Kim Allen"
},
"client":{
"id":5735774,
"name":"ABC Corp"
},
"project":{
"id":14307913,
"name":"Marketing Website"
},
"task":{
"id":8083365,
"name":"Graphic Design"
},
"user_assignment":{
"id":125068553,
"is_project_manager":true,
"is_active":true,
"budget":null,
"created_at":"2017-06-26T22:32:52Z",
"updated_at":"2017-06-26T22:32:52Z",
"hourly_rate":100.0
},
"task_assignment":{
"id":155502709,
"billable":true,
"is_active":true,
"created_at":"2017-06-26T21:36:23Z",
"updated_at":"2017-06-26T21:36:23Z",
"hourly_rate":100.0,
"budget":null
},
"hours":1.0,
"hours_without_timer":1.0,
"rounded_hours":1.0,
"notes":null,
"created_at":"2017-06-27T16:01:23Z",
"updated_at":"2017-06-27T16:01:23Z",
"is_locked":false,
"locked_reason":null,
"is_closed":false,
"approval_status":"unsubmitted",
"is_billed":false,
"timer_started_at":null,
"started_time": "8:00am",
"ended_time": "9:00am",
"is_running":false,
"invoice":null,
"external_reference": null,
"billable":true,
"budgeted":true,
"billable_rate":100.0,
"cost_rate":50.0
}
```
--------------------------------
### Example User Response
Source: https://help.getharvest.com/api-v2/users-api/users/users
This is an example of a successful response when creating or retrieving a user, showing their assigned access roles.
```json
{
"id": 3,
"first_name": "George",
"last_name": "Frank",
"email": "george@example.com",
"telephone": "",
"timezone": "Eastern Time (US & Canada)",
"has_access_to_all_future_projects": false,
"is_contractor": false,
"is_active": true,
"weekly_capacity":126000,
"default_hourly_rate": 0,
"cost_rate": 0,
"roles": [],
"access_roles": [
"manager",
"project_creator",
"time_and_expenses_manager"
],
"avatar_url": "https://{ACCOUNT_SUBDOMAIN}.harvestapp.com/assets/profile_images/big_ben.png?1485372046",
"created_at": "2020-01-25T19:20:46Z",
"updated_at": "2020-01-25T19:20:57Z"
}
```
--------------------------------
### Example Response for Authenticated User
Source: https://help.getharvest.com/api-v2/users-api/users/users
This is an example JSON response when retrieving the currently authenticated user.
```json
{
"id":1782884,
"first_name":"Bob",
"last_name":"Powell",
"email":"bobpowell@example.com",
"telephone":"",
"timezone":"Mountain Time (US & Canada)",
"has_access_to_all_future_projects":false,
"is_contractor":false,
"is_active":true,
"created_at":"2020-05-01T20:41:00Z",
"updated_at":"2020-05-01T20:42:25Z",
"weekly_capacity":126000,
"default_hourly_rate":100.0,
"cost_rate":75.0,
"roles":["Founder", "CEO"],
"access_roles": ["administrator"],
"avatar_url":"https://cache.harvestapp.com/assets/profile_images/allen_bradley_clock_tower.png?1498509661"
}
```
--------------------------------
### List All Tasks Response Example
Source: https://help.getharvest.com/api-v2/tasks-api/tasks/tasks
This is an example of the JSON response when listing all tasks. It includes task details, pagination information, and links for navigation.
```json
{
"tasks":[
{
"id":8083800,
"name":"Business Development",
"billable_by_default":false,
"default_hourly_rate":0.0,
"is_default":false,
"is_active":true,
"created_at":"2017-06-26T22:08:25Z",
"updated_at":"2017-06-26T22:08:25Z"
},
{
"id":8083369,
"name":"Research",
"billable_by_default":false,
"default_hourly_rate":0.0,
"is_default":true,
"is_active":true,
"created_at":"2017-06-26T20:41:00Z",
"updated_at":"2017-06-26T21:53:34Z"
},
{
"id":8083368,
"name":"Project Management",
"billable_by_default":true,
"default_hourly_rate":100.0,
"is_default":true,
"is_active":true,
"created_at":"2017-06-26T20:41:00Z",
"updated_at":"2017-06-26T21:14:10Z"
},
{
"id":8083366,
"name":"Programming",
"billable_by_default":true,
"default_hourly_rate":100.0,
"is_default":true,
"is_active":true,
"created_at":"2017-06-26T20:41:00Z",
"updated_at":"2017-06-26T21:14:07Z"
},
{
"id":8083365,
"name":"Graphic Design",
"billable_by_default":true,
"default_hourly_rate":100.0,
"is_default":true,
"is_active":true,
"created_at":"2017-06-26T20:41:00Z",
"updated_at":"2017-06-26T21:14:02Z"
}
],
"per_page":2000,
"total_pages":1,
"total_entries":5,
"next_page":null,
"previous_page":null,
"page":1,
"links":{
"first":"https://api.harvestapp.com/v2/tasks?page=1&per_page=2000",
"next":null,
"previous":null,
"last":"https://api.harvestapp.com/v2/tasks?page=1&per_page=2000"
}
}
```
--------------------------------
### POST Request Example (JSON)
Source: https://help.getharvest.com/api-v2/introduction/overview/general
Example of how to make a POST request using JSON in the request body.
```APIDOC
## POST Request Example (JSON)
### Description
This example shows how to send data to the API using a POST request with a JSON payload.
### Method
POST
### Endpoint
`https://api.harvestapp.com/v2/tasks`
### Headers
- `Authorization`: Bearer $ACCESS_TOKEN
- `Harvest-Account-Id`: $ACCOUNT_ID
- `User-Agent`: MyApp (yourname@example.com)
- `Content-Type`: application/json
### Request Body
- `name` (string) - Required - The name of the task.
### Request Example
```bash
curl -X POST https://api.harvestapp.com/v2/tasks \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Harvest-Account-Id: $ACCOUNT_ID" \
-H "User-Agent: MyApp (yourname@example.com)" \
-H "Content-Type: application/json" \
-d "{\"name\":\"My New Task\"}"
```
```
--------------------------------
### Example Response for Create Estimate
Source: https://help.getharvest.com/api-v2/estimates-api/estimates/estimates
This is an example of the JSON response structure when successfully creating an estimate.
```json
{
"id":1439827,
"client_key":"ddd4504a68fb7339138d0c2ea89ba05a3cf12aa8",
"number":"1002",
"purchase_order":null,
"amount":5000.0,
"tax":null,
"tax_amount":0.0,
"tax2":null,
"tax2_amount":0.0,
"discount":null,
"discount_amount":0.0,
"subject":"Project Quote",
"notes":null,
"state":"draft",
"issue_date":null,
"sent_at":null,
"created_at":"2017-06-27T16:16:24Z",
"updated_at":"2017-06-27T16:16:24Z",
"accepted_at":null,
"declined_at":null,
"currency":"USD",
"client":{
"id":5735774,
"name":"ABC Corp"
},
"creator":{
"id":1782884,
"name":"Bob Powell"
},
"line_items":[
{
"id":53339199,
"kind":"Service",
"description":"Project Description",
"quantity":1.0,
"unit_price":5000.0,
"amount":5000.0,
"taxed":false,
"taxed2":false
}
]
}
```
--------------------------------
### Example Response for Specific User
Source: https://help.getharvest.com/api-v2/users-api/users/users
This is an example JSON response when retrieving a specific user by their ID.
```json
{
"id":3230547,
"first_name":"Jim",
"last_name":"Allen",
"email":"jimallen@example.com",
"telephone":"",
"timezone":"Mountain Time (US & Canada)",
"has_access_to_all_future_projects":false,
"is_contractor":false,
"is_active":true,
"created_at":"2020-05-01T22:34:41Z",
"updated_at":"2020-05-01T22:34:52Z",
"weekly_capacity":126000,
"default_hourly_rate":100.0,
"cost_rate":50.0,
"roles":["Developer"],
"access_roles": ["member"],
"avatar_url":"https://cache.harvestapp.com/assets/profile_images/abraj_albait_towers.png?1498516481"
}
```
--------------------------------
### User Update Response Example
Source: https://help.getharvest.com/api-v2/users-api/users/users
This is an example of a successful response when updating a user. It returns the updated user object with all current details.
```json
{
"id": 3237198,
"first_name": "Gary",
"last_name": "Brookes",
"email": "gary@example.com",
"telephone": "",
"timezone": "Eastern Time (US & Canada)",
"has_access_to_all_future_projects": true,
"is_contractor": false,
"is_active": true,
"weekly_capacity":126000,
"default_hourly_rate": 120,
"cost_rate": 50,
"roles": ["Product Team"],
"access_roles": [
"manager",
"time_and_expenses_manager",
"billable_rates_manager"
],
"avatar_url": "https://{ACCOUNT_SUBDOMAIN}.harvestapp.com/assets/profile_images/big_ben.png?1485372046",
"created_at": "2018-01-01T19:20:46Z",
"updated_at": "2019-01-25T19:20:57Z"
}
```
--------------------------------
### POST Request Example (Form Data)
Source: https://help.getharvest.com/api-v2/introduction/overview/general
Example of how to make a POST request using form data in the request body.
```APIDOC
## POST Request Example (Form Data)
### Description
This example demonstrates how to send data to the API using a POST request with form data.
### Method
POST
### Endpoint
`https://api.harvestapp.com/v2/tasks`
### Headers
- `Authorization`: Bearer $ACCESS_TOKEN
- `Harvest-Account-Id`: $ACCOUNT_ID
- `User-Agent`: MyApp (yourname@example.com)
### Request Body
- `name` (string) - Required - The name of the task.
### Request Example
```bash
curl -X POST https://api.harvestapp.com/v2/tasks \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Harvest-Account-Id: $ACCOUNT_ID" \
-H "User-Agent: MyApp (yourname@example.com)" \
-d name="My New Task"
```
```
--------------------------------
### Example Request to List Project Assignments
Source: https://help.getharvest.com/api-v2/users-api/users/project-assignments
This example demonstrates how to make a request to the API to list project assignments. Ensure you include the necessary Authorization and Harvest-Account-Id headers.
```curl
curl "https://api.harvestapp.com/v2/users/me/project_assignments" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Harvest-Account-Id: $ACCOUNT_ID" \
-H "User-Agent: MyApp (yourname@example.com)"
```
--------------------------------
### Example Estimate Request
Source: https://help.getharvest.com/api-v2/estimates-api/estimates/estimates
This example shows how to make a request to the estimates endpoint using curl, including necessary headers for authentication and account identification.
```curl
curl "https://api.harvestapp.com/v2/estimates" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Harvest-Account-Id: $ACCOUNT_ID" \
-H "User-Agent: MyApp (yourname@example.com)"
```
--------------------------------
### Example Response for Project Assignments
Source: https://help.getharvest.com/api-v2/users-api/users/project-assignments
This is an example of the JSON response you will receive when listing project assignments. It includes details about each assignment, its associated project and client, and task assignments.
```json
{
"project_assignments":[
{
"id":125066109,
"is_project_manager":true,
"is_active":true,
"use_default_rates":true,
"budget":null,
"created_at":"2017-06-26T21:52:18Z",
"updated_at":"2017-06-26T21:52:18Z",
"hourly_rate":100.0,
"project":{
"id":14308069,
"name":"Online Store - Phase 1",
"code":"OS1"
},
"client":{
"id":5735776,
"name":"123 Industries"
},
"task_assignments":[
{
"id":155505013,
"billable":true,
"is_active":true,
"created_at":"2017-06-26T21:52:18Z",
"updated_at":"2017-06-26T21:52:18Z",
"hourly_rate":100.0,
"budget":null,
"task":{
"id":8083365,
"name":"Graphic Design"
}
},
{
"id":155505014,
"billable":true,
"is_active":true,
"created_at":"2017-06-26T21:52:18Z",
"updated_at":"2017-06-26T21:52:18Z",
"hourly_rate":100.0,
"budget":null,
"task":{
"id":8083366,
"name":"Programming"
}
},
{
"id":155505015,
"billable":true,
"is_active":true,
"created_at":"2017-06-26T21:52:18Z",
"updated_at":"2017-06-26T21:52:18Z",
"hourly_rate":100.0,
"budget":null,
"task":{
"id":8083368,
"name":"Project Management"
}
},
{
"id":155505016,
"billable":false,
"is_active":true,
"created_at":"2017-06-26T21:52:18Z",
"updated_at":"2017-06-26T21:54:06Z",
"hourly_rate":100.0,
"budget":null,
"task":{
"id":8083369,
"name":"Research"
}
}
]
},
{
"id":125063975,
"is_project_manager":true,
"is_active":true,
"use_default_rates":false,
"budget":null,
"created_at":"2017-06-26T21:36:23Z",
"updated_at":"2017-06-26T21:36:23Z",
"hourly_rate":100.0,
"project":{
"id":14307913,
"name":"Marketing Website",
"code":"MW"
},
"client":{
"id":5735774,
"name":"ABC Corp"
},
"task_assignments":[
{
"id":155502709,
"billable":true,
"is_active":true,
"created_at":"2017-06-26T21:36:23Z",
"updated_at":"2017-06-26T21:36:23Z",
"hourly_rate":100.0,
"budget":null,
"task":{
"id":8083365,
"name":"Graphic Design"
}
},
{
"id":155502710,
"billable":true,
"is_active":true,
"created_at":"2017-06-26T21:36:23Z",
"updated_at":"2017-06-26T21:36:23Z",
"hourly_rate":100.0,
"budget":null,
"task":{
"id":8083366,
"name":"Programming"
}
},
{
"id":155502711,
"billable":true,
"is_active":true,
"created_at":"2017-06-26T21:36:23Z",
"updated_at":"2017-06-26T21:36:23Z",
"hourly_rate":100.0,
"budget":null,
"task":{
"id":8083368,
"name":"Project Management"
}
},
{
"id":155505153,
"billable":false,
"is_active":true,
"created_at":"2017-06-26T21:53:20Z",
"updated_at":"2017-06-26T21:54:31Z",
"hourly_rate":100.0,
"budget":null,
```
--------------------------------
### Example XML Response for Created Contact
Source: https://help.getharvest.com/api-v2/clients-api/clients/contacts
This is an example of the XML response received after successfully creating a contact. It includes all the details of the newly created contact.
```xml
4706510
5735776
null
George
Frank
georgefrank@example.com
cc
2019-06-26T21:44:57Z
2019-06-26T21:44:57Z
```
--------------------------------
### Example Estimate Response
Source: https://help.getharvest.com/api-v2/estimates-api/estimates/estimates
This is an example of a successful response when listing estimates. It includes details for two estimates, pagination information, and links for navigation.
```json
{
"estimates":[
{
"id":1439818,
"client_key":"13dc088aa7d51ec687f186b146730c3c75dc7423",
"number":"1001",
"purchase_order":"5678",
"amount":9630.0,
"tax":5.0,
"tax_amount":450.0,
"tax2":2.0,
"tax2_amount":180.0,
"discount":10.0,
"discount_amount":1000.0,
"subject":"Online Store - Phase 2",
"notes":"Some notes about the estimate",
"state":"sent",
"issue_date":"2017-06-01",
"sent_at":"2017-06-27T16:11:33Z",
"created_at":"2017-06-27T16:11:24Z",
"updated_at":"2017-06-27T16:13:56Z",
"accepted_at":null,
"declined_at":null,
"currency":"USD",
"client":{
"id":5735776,
"name":"123 Industries"
},
"creator":{
"id":1782884,
"name":"Bob Powell"
},
"line_items":[
{
"id":53334195,
"kind":"Service",
"description":"Phase 2 of the Online Store",
"quantity":100,
"unit_price":100,
"amount":10000,
"taxed":true,
"taxed2":true
}
]
},
{
"id":1439814,
"client_key":"a5ffaeb30c55776270fcd3992b70332d769f97e7",
"number":"1000",
"purchase_order":"1234",
"amount":21000.0,
"tax":5.0,
"tax_amount":1000.0,
"tax2":null,
"tax2_amount":0.0,
"discount":null,
"discount_amount":0.0,
"subject":"Online Store - Phase 1",
"notes":"Some notes about the estimate",
"state":"accepted",
"issue_date":"2017-01-01",
"sent_at":"2017-06-27T16:10:30Z",
"created_at":"2017-06-27T16:09:33Z",
"updated_at":"2017-06-27T16:12:00Z",
"accepted_at":"2017-06-27T16:10:32Z",
"declined_at":null,
"currency":"USD",
"client":{
"id":5735776,
"name":"123 Industries"
},
"creator":{
"id":1782884,
"name":"Bob Powell"
},
"line_items":[
{
"id":57531966,
"kind":"Service",
"description":"Phase 1 of the Online Store",
"quantity":1,
"unit_price":20000,
"amount":20000,
"taxed":true,
"taxed2":false
}
]
}
],
"per_page":2000,
"total_pages":1,
"total_entries":2,
"next_page":null,
"previous_page":null,
"page":1,
"links":{
"first":"https://api.harvestapp.com/v2/estimates?page=1&per_page=2000",
"next":null,
"previous":null,
"last":"https://api.harvestapp.com/v2/estimates?page=1&per_page=2000"
}
}
```
--------------------------------
### Example Response for Accounts Endpoint
Source: https://help.getharvest.com/api-v2/authentication-api/authentication/authentication
This is an example of the JSON response you can expect when calling the accounts endpoint, listing user details and accessible accounts.
```json
{
"user": {
"id": 1,
"first_name": "Albert",
"last_name": "Llop",
"email": "albert@example.com"
},
"accounts": [
{
"id": 10254,
"name": "Sterling Cooper Advertising Agency",
"product": "harvest"
},
{
"id": 88888,
"name": "Iridesco",
"product": "forecast"
},
{
"id": 88903,
"name": "Sterling Cooper Advertising Agency",
"product": "forecast"
}
]
}
```
--------------------------------
### Example Invoice Response
Source: https://help.getharvest.com/api-v2/invoices-api/invoices/invoices
This is an example of the JSON response received after successfully creating an invoice. It includes details of the invoice, client, and line items.
```json
{
"id":13150453,
"client_key":"8b86437630b6c260c1bfa289f0154960f83b606d",
"number":"1002",
"purchase_order":null,
"amount":5000.0,
"due_amount":5000.0,
"tax":null,
"tax_amount":0.0,
"tax2":null,
"tax2_amount":0.0,
"discount":null,
"discount_amount":0.0,
"subject":"ABC Project Quote",
"notes":null,
"state":"draft",
"period_start":null,
"period_end":null,
"issue_date":"2017-06-27",
"due_date":"2017-07-27",
"payment_term":"custom",
"sent_at":null,
"paid_at":null,
"paid_date":null,
"closed_at":null,
"recurring_invoice_id":null,
"created_at":"2017-06-27T16:34:24Z",
"updated_at":"2017-06-27T16:34:24Z",
"currency":"USD",
"payment_options":["credit_card"],
"client":{
"id":5735774,
"name":"ABC Corp"
},
"estimate":null,
"retainer":null,
"creator":{
"id":1782884,
"name":"Bob Powell"
},
"line_items":[
{
"id":53341928,
"kind":"Service",
"description":"ABC Project",
"quantity":1.0,
"unit_price":5000.0,
"amount":5000.0,
"taxed":false,
"taxed2":false,
"project":null
}
]
}
```
--------------------------------
### Example Response for Project Assignments
Source: https://help.getharvest.com/api-v2/users-api/users/project-assignments
This is an example of the JSON response structure when listing active project assignments. It includes details about each assignment, its associated project and client, and task assignments.
```json
{
"project_assignments":[
{
"id":125068554,
"is_project_manager":true,
"is_active":true,
"use_default_rates":true,
"budget":null,
"created_at":"2017-06-26T22:32:52Z",
"updated_at":"2017-06-26T22:32:52Z",
"hourly_rate":100.0,
"project":{
"id":14308069,
"name":"Online Store - Phase 1",
"code":"OS1"
},
"client":{
"id":5735776,
"name":"123 Industries"
},
"task_assignments":[
{
"id":155505013,
"billable":true,
"is_active":true,
"created_at":"2017-06-26T21:52:18Z",
"updated_at":"2017-06-26T21:52:18Z",
"hourly_rate":100.0,
"budget":null,
"task":{
"id":8083365,
"name":"Graphic Design"
}
},
{
"id":155505014,
"billable":true,
"is_active":true,
"created_at":"2017-06-26T21:52:18Z",
"updated_at":"2017-06-26T21:52:18Z",
"hourly_rate":100.0,
"budget":null,
"task":{
"id":8083366,
"name":"Programming"
}
},
{
"id":155505015,
"billable":true,
"is_active":true,
"created_at":"2017-06-26T21:52:18Z",
"updated_at":"2017-06-26T21:52:18Z",
"hourly_rate":100.0,
"budget":null,
"task":{
"id":8083368,
"name":"Project Management"
}
},
{
"id":155505016,
"billable":false,
"is_active":true,
"created_at":"2017-06-26T21:52:18Z",
"updated_at":"2017-06-26T21:54:06Z",
"hourly_rate":100.0,
"budget":null,
"task":{
"id":8083369,
"name":"Research"
}
}
]
},
{
"id":125068553,
"is_project_manager":true,
"is_active":true,
"use_default_rates":false,
"budget":null,
"created_at":"2017-06-26T22:32:52Z",
"updated_at":"2017-06-26T22:32:52Z",
"hourly_rate":100.0,
"project":{
"id":14307913,
"name":"Marketing Website",
"code":"MW"
},
"client":{
"id":5735774,
"name":"ABC Corp"
},
"task_assignments":[
{
"id":155502709,
"billable":true,
"is_active":true,
"created_at":"2017-06-26T21:36:23Z",
"updated_at":"2017-06-26T21:36:23Z",
"hourly_rate":100.0,
"budget":null,
"task":{
"id":8083365,
"name":"Graphic Design"
}
},
{
"id":155502710,
"billable":true,
"is_active":true,
"created_at":"2017-06-26T21:36:23Z",
"updated_at":"2017-06-26T21:36:23Z",
"hourly_rate":100.0,
"budget":null,
"task":{
"id":8083366,
"name":"Programming"
}
},
{
"id":155502711,
"billable":true,
"is_active":true,
"created_at":"2017-06-26T21:36:23Z",
"updated_at":"2017-06-26T21:36:23Z",
"hourly_rate":100.0,
"budget":null,
"task":{
"id":8083368,
"name":"Project Management"
}
}
]
}
]
}
```
--------------------------------
### Example Task Assignments Request
Source: https://help.getharvest.com/api-v2/projects-api/projects/task-assignments
Example of how to make a request to the task assignments endpoint using curl, including necessary authentication and account headers.
```curl
curl "https://api.harvestapp.com/v2/task_assignments" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Harvest-Account-Id: $ACCOUNT_ID" \
-H "User-Agent: MyApp (yourname@example.com)"
```
--------------------------------
### General GET Request Example
Source: https://help.getharvest.com/api-v2/introduction/overview/general
Example of how to make a GET request to the Harvest API V2, including authentication headers and query parameters.
```APIDOC
## GET Request Example
### Description
This example demonstrates how to retrieve data using a GET request. Parameters are included in the URL query string.
### Method
GET
### Endpoint
`https://api.harvestapp.com/v2/tasks?page=2&per_page=10`
### Headers
- `Authorization`: Bearer $ACCESS_TOKEN
- `Harvest-Account-Id`: $ACCOUNT_ID
- `User-Agent`: MyApp (yourname@example.com)
### Request Example
```bash
curl https://api.harvestapp.com/v2/tasks?page=2&per_page=10 \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Harvest-Account-Id: $ACCOUNT_ID" \
-H "User-Agent: MyApp (yourname@example.com)"
```
```
--------------------------------
### Create a Client
Source: https://help.getharvest.com/api-v2/clients-api/clients/clients
Use this endpoint to create a new client object. A `201 Created` response indicates success. Ensure you provide the required `name` parameter.
```bash
curl "https://api.harvestapp.com/v2/clients" \
-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 '{"name":"Your New Client","currency":"EUR"}'
```
--------------------------------
### Retrieve Next Page of Clients
Source: https://help.getharvest.com/api-v2/introduction/overview/pagination
To get the subsequent page of client records, use the 'next' URL provided in the `links` section of the previous response. This example uses cursor-based pagination.
```curl
curl "https://api.harvestapp.com/v2/clients?cursor=eyJhZnRlciI6eyJpZCI6MzAwN319&per_page=2000&ref=next_cursor" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Harvest-Account-Id: $ACCOUNT_ID" \
-H "User-Agent: MyApp (yourname@example.com)"
```
--------------------------------
### Create a Project - API Request
Source: https://help.getharvest.com/api-v2/projects-api/projects/projects
Use this endpoint to create a new project. Ensure you include all required parameters such as client ID, name, billability, and budget details. The response includes the newly created project object.
```bash
curl "https://api.harvestapp.com/v2/projects" \
-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 '{"client_id":5735776,"name":"Your New Project","is_billable":true,"bill_by":"Project","hourly_rate":100.0,"budget_by":"project","budget":10000}'
```
--------------------------------
### Example XML Response
Source: https://help.getharvest.com/api-v2/clients-api/clients/contacts
An example of the XML response structure when listing contacts.
```xml
4706479
5735774
Owner
Jane
Doe
janedoe@example.com
(203) 697-8885
(203) 697-8886
(203) 697-8887
2013-08-12T15:30:14Z
2015-04-16T18:07:28Z
4706453
5735776
Manager
Richard
Roe
richardroe@example.com
(318) 515-5905
(318) 515-5906
(318) 515-5907
```
--------------------------------
### Example response for listing users
Source: https://help.getharvest.com/api-v2/users-api/users/users
A sample JSON response when listing users. It includes user details, pagination information, and links for navigating through the results.
```json
{
"users":[
{
"id":3230547,
"first_name":"Jim",
"last_name":"Allen",
"email":"jimallen@example.com",
"telephone":"",
"timezone":"Mountain Time (US & Canada)",
"has_access_to_all_future_projects":false,
"is_contractor":false,
"is_active":true,
"created_at":"2020-05-01T22:34:41Z",
"updated_at":"2020-05-01T22:34:52Z",
"weekly_capacity":126000,
"default_hourly_rate":100.0,
"cost_rate":50.0,
"roles":["Developer"],
"access_roles": ["member"],
"avatar_url":"https://cache.harvestapp.com/assets/profile_images/abraj_albait_towers.png?1498516481"
},
{
"id":1782959,
"first_name":"Kim",
"last_name":"Allen",
"email":"kimallen@example.com",
"telephone":"",
"timezone":"Eastern Time (US & Canada)",
"has_access_to_all_future_projects":true,
"is_contractor":false,
"is_active":true,
"created_at":"2020-05-01T22:15:45Z",
"updated_at":"2020-05-01T22:32:52Z",
"weekly_capacity":126000,
"default_hourly_rate":100.0,
"cost_rate":50.0,
"roles":["Designer"],
"access_roles": ["member"],
"avatar_url":"https://cache.harvestapp.com/assets/profile_images/cornell_clock_tower.png?1498515345"
},
{
"id":1782884,
"first_name":"Bob",
"last_name":"Powell",
"email":"bobpowell@example.com",
"telephone":"",
"timezone":"Mountain Time (US & Canada)",
"has_access_to_all_future_projects":false,
"is_contractor":false,
"is_active":true,
"created_at":"2020-05-01T20:41:00Z",
"updated_at":"2020-05-01T20:42:25Z",
"weekly_capacity":126000,
"default_hourly_rate":100.0,
"cost_rate":75.0,
"roles":["Founder", "CEO"],
"access_roles": ["administrator"],
"avatar_url":"https://cache.harvestapp.com/assets/profile_images/allen_bradley_clock_tower.png?1498509661"
}
],
"per_page":2000,
"total_pages":1,
"total_entries":3,
"next_page":null,
"previous_page":null,
"page":1,
"links":{
"first":"https://api.harvestapp.com/v2/users?page=1&per_page=2000",
"next":null,
"previous":null,
"last":"https://api.harvestapp.com/v2/users?page=1&per_page=2000"
}
}
```
--------------------------------
### Example Request with Authentication
Source: https://help.getharvest.com/api-v2/projects-api/projects/user-assignments
This `curl` command demonstrates how to authenticate your request to the user assignments endpoint. Ensure you replace placeholders with your actual access token, account ID, and application details.
```curl
curl "https://api.harvestapp.com/v2/user_assignments" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Harvest-Account-Id: $ACCOUNT_ID" \
-H "User-Agent: MyApp (yourname@example.com)"
```
--------------------------------
### Example Response for Retrieve Estimate
Source: https://help.getharvest.com/api-v2/estimates-api/estimates/estimates
This is an example of the JSON response structure when successfully retrieving an estimate.
```json
{
"id":1439818,
"client_key":"13dc088aa7d51ec687f186b146730c3c75dc7423",
"number":"1001",
"purchase_order":"5678",
"amount":9630.0,
"tax":5.0,
"tax_amount":450.0,
"tax2":2.0,
"tax2_amount":180.0,
"discount":10.0,
"discount_amount":1000.0,
"subject":"Online Store - Phase 2",
"notes":"Some notes about the estimate",
"state":"sent",
"issue_date":"2017-06-01",
"sent_at":"2017-06-27T16:11:33Z",
"created_at":"2017-06-27T16:11:24Z",
"updated_at":"2017-06-27T16:13:56Z",
"accepted_at":null,
"declined_at":null,
"currency":"USD",
"client":{
"id":5735776,
"name":"123 Industries"
},
"creator":{
"id":1782884,
"name":"Bob Powell"
},
"line_items":[
{
"id":53334195,
"kind":"Service",
"description":"Phase 2 of the Online Store",
"quantity":100.0,
"unit_price":100.0,
"amount":10000.0,
"taxed":true,
"taxed2":true
}
]
}
```
--------------------------------
### Example JSON Response
Source: https://help.getharvest.com/api-v2/clients-api/clients/contacts
An example of the JSON response structure when listing contacts, including pagination details.
```json
{
"contacts":[
{
"id":4706479,
"title":"Owner",
"first_name":"Jane",
"last_name":"Doe",
"email":"janedoe@example.com",
"phone_office":"(203) 697-8885",
"phone_mobile":"(203) 697-8886",
"fax":"(203) 697-8887",
"created_at":"2017-06-26T21:20:07Z",
"updated_at":"2017-06-26T21:27:07Z",
"client":{
"id":5735774,
"name":"ABC Corp"
}
},
{
"id":4706453,
"title":"Manager",
"first_name":"Richard",
"last_name":"Roe",
"email":"richardroe@example.com",
"phone_office":"(318) 515-5905",
"phone_mobile":"(318) 515-5906",
"fax":"(318) 515-5907",
"created_at":"2017-06-26T21:06:55Z",
"updated_at":"2017-06-26T21:27:20Z",
"client":{
"id":5735776,
"name":"123 Industries"
}
}
],
"per_page":2000,
"total_pages":1,
"total_entries":2,
"next_page":null,
"previous_page":null,
"page":1,
"links":{
"first":"https://api.harvestapp.com/v2/contacts?page=1&per_page=2000",
"next":null,
"previous":null,
"last":"https://api.harvestapp.com/v2/contacts?page=1&per_page=2000"
}
}
```