Client Contacts
The contact object
Attribute | Type | Description |
---|---|---|
id |
integer | Unique ID for the contact. |
client |
object | An object containing the contact’s client id and name. |
title |
string | The title of the contact. |
first_name |
string | The first name of the contact. |
last_name |
string | The last name of the contact. |
email |
string | The contact’s email address. |
phone_office |
string | The contact’s office phone number. |
phone_mobile |
string | The contact’s mobile phone number. |
fax |
string | The contact’s fax number. |
created_at |
datetime | Date and time the contact was created. |
updated_at |
datetime | Date and time the contact was last updated. |
Required permissions
You must be an Administrator or Manager with permission to create and edit clients in order to interact with the /v2/contacts
endpoint. Insufficient permissions will result in a 403 Forbidden
status code.
List all contacts
Returns a list of your contacts. The contacts are returned sorted by creation date, with the most recently created contacts appearing first.
The response contains an object with a contacts
property that contains an array of up to per_page
contacts. Each entry in the array is a separate contact object. If no more contacts are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your contacts.
GET /v2/contacts
Parameter | Type | Description |
---|---|---|
client_id |
integer | Only return contacts belonging to the client with the given ID. |
updated_since |
datetime | Only return contacts that have been updated since the given date and time. |
page |
integer | DEPRECATED The page number to use in pagination. For instance, if you make a list request and receive 2000 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 2000. (Default: 2000) |
page
parameter.
For more information, visit the pagination guide.
Example requests
We have a collection of API requests in Postman that makes it easy to try this out. Click here to learn more!
curl "https://api.harvestapp.com/v2/contacts" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Harvest-Account-Id: $ACCOUNT_ID" \
-H "User-Agent: MyApp ([email protected])"
Example responses
Retrieve a contact
Retrieves the contact with the given ID. Returns a contact object and a 200 OK
response code if a valid identifier was provided.
GET /v2/contacts/{CONTACT_ID}
Example requests
We have a collection of API requests in Postman that makes it easy to try this out. Click here to learn more!
curl "https://api.harvestapp.com/v2/contacts/4706479" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Harvest-Account-Id: $ACCOUNT_ID" \
-H "User-Agent: MyApp ([email protected])"
Example responses
Create a contact
Creates a new contact object. Returns a contact object and a 201 Created
response code if the call succeeded.
POST /v2/contacts
Parameter | Type | Required | Description |
---|---|---|---|
client_id |
integer | required | The ID of the client associated with this contact. |
title |
string | optional | The title of the contact. |
first_name |
string | required | The first name of the contact. |
last_name |
string | optional | The last name of the contact. |
email |
string | optional | The contact’s email address. |
phone_office |
string | optional | The contact’s office phone number. |
phone_mobile |
string | optional | The contact’s mobile phone number. |
fax |
string | optional | The contact’s fax number. |
Example requests
We have a collection of API requests in Postman that makes it easy to try this out. Click here to learn more!
curl "https://api.harvestapp.com/v2/contacts" \
-H "Harvest-Account-Id: $ACCOUNT_ID" \
-H "User-Agent: MyApp ([email protected])" \
-X POST \
-H "Content-Type: application/json" \
-d '{"client_id":5735776,"first_name":"George","last_name":"Frank","email":"[email protected]"}'
Example responses
Update a contact
Updates the specific contact by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns a contact object and a 200 OK
response code if the call succeeded.
PATCH /v2/contacts/{CONTACT_ID}
Parameter | Type | Description |
---|---|---|
client_id |
integer | The ID of the client associated with this contact. |
title |
string | The title of the contact. |
first_name |
string | The first name of the contact. |
last_name |
string | The last name of the contact. |
email |
string | The contact’s email address. |
phone_office |
string | The contact’s office phone number. |
phone_mobile |
string | The contact’s mobile phone number. |
fax |
string | The contact’s fax number. |
Example requests
We have a collection of API requests in Postman that makes it easy to try this out. Click here to learn more!
curl "https://api.harvestapp.com/v2/contacts/4706510" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Harvest-Account-Id: $ACCOUNT_ID" \
-H "User-Agent: MyApp ([email protected])" \
-X PATCH \
-H "Content-Type: application/json" \
-d '{"title":"Owner"}'
Example responses
Delete a contact
Delete a contact. Returns a 200 OK
response code if the call succeeded.
DELETE /v2/contacts/{CONTACT_ID}
Example requests
We have a collection of API requests in Postman that makes it easy to try this out. Click here to learn more!
curl "https://api.harvestapp.com/v2/contacts/4706510" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Harvest-Account-Id: $ACCOUNT_ID" \
-H "User-Agent: MyApp ([email protected])" \
-X DELETE