Imports

The import object

An import is an asynchronous run that imports records into Harvest from a CSV file. Each run reports the number of rows it imported or failed, so a client can poll it to completion.

Attribute Type Description
id integer Unique ID for the import run.
import_type string The kind of import: client, contact, expense, person, project, or timesheet.
status string Status of the run: queued, working, completed, completed_with_errors, reverting, reverted, or expired.
csv_file_name string Name of the uploaded CSV file.
imported_rows_count integer Number of rows imported. Defaults to 0.
imported_hours decimal Number of hours imported.
error_rows_count integer Number of rows that failed. Defaults to 0.
csv_errors_available boolean true when a CSV file of failed rows is available to download. Reflects whether the file exists, not the error_rows_count.
created_at datetime Date and time the run was created. Use the ISO 8601 Format.
updated_at datetime Date and time the run was last updated. This is the timestamp the updated_since filter compares against. Use the ISO 8601 Format.
started_at datetime Date and time the run started. null before it starts.
completed_at datetime Date and time the run completed. null until it completes.
reverted_at datetime Date and time the run was reverted. null unless it has been reverted.

Required permissions

Data import is available only to paying accounts. Free-plan accounts receive a 403 Forbidden.

Listing all imports and reverting an import require the permission to manage the account’s settings. A caller with permission to manage all clients, but not the account’s settings, can retrieve only their own client and contact runs. Downloading the CSV errors of a run is limited to the caller’s own runs, and without permission to manage the account’s settings, to client and contact runs.

The permission required to create an import depends on its import_type:

  • person requires permission to view all people.
  • project requires permission to manage all projects.
  • client and contact require permission to manage all clients or to manage account settings.
  • timesheet and expense require permission to manage account settings.

A caller who can create a person or project import without permission to manage the account’s settings cannot retrieve that run or download its CSV errors. Those requests return 403 or 404.

List all imports

Beta endpoint. Fully available, but the response shape may still change. Until it is frozen, every response includes Harvest-Api-Stability: beta.

Returns the account’s recent import runs, newest first. The listing is limited to runs created in the last 30 days.

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

GET /v2/imports
Parameter Type Description
updated_since datetime Only return runs updated since this timestamp. The listing is still limited to runs created in the last 30 days.
page integer The page number to use in pagination. (Default: 1)
per_page integer The number of records to return per page. Can range between 1 and 2000. (Default: 2000)
cursor string Cursor for cursor-based pagination. A malformed value returns 422.

Example Request:

curl "https://api.harvestapp.com/v2/imports?updated_since=2026-10-01T00:00:00Z" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Harvest-Account-Id: $ACCOUNT_ID" \
  -H "User-Agent: MyApp ([email protected])"

Example Response:

{
  "imports": [
    {
      "id": 1057,
      "import_type": "project",
      "status": "completed",
      "csv_file_name": "iridesco-projects.csv",
      "imported_rows_count": 12,
      "imported_hours": 0.0,
      "error_rows_count": 0,
      "csv_errors_available": false,
      "created_at": "2026-10-15T09:00:00Z",
      "updated_at": "2026-10-15T09:02:00Z",
      "started_at": "2026-10-15T09:00:05Z",
      "completed_at": "2026-10-15T09:02:00Z",
      "reverted_at": null
    },
    {
      "id": 1056,
      "import_type": "client",
      "status": "queued",
      "csv_file_name": "clients.csv",
      "imported_rows_count": 0,
      "imported_hours": 0.0,
      "error_rows_count": 0,
      "csv_errors_available": false,
      "created_at": "2026-10-14T16:45:00Z",
      "updated_at": "2026-10-14T16:45:00Z",
      "started_at": null,
      "completed_at": null,
      "reverted_at": null
    }
  ],
  "per_page": 2000,
  "total_pages": 1,
  "total_entries": 2,
  "next_page": null,
  "previous_page": null,
  "page": 1,
  "links": {
    "first": "https://api.harvestapp.com/v2/imports?page=1&per_page=2000",
    "next": null,
    "previous": null,
    "last": "https://api.harvestapp.com/v2/imports?page=1&per_page=2000"
  }
}

Create an import

Beta endpoint. Fully available, but the response shape may still change. Until it is frozen, every response includes Harvest-Api-Stability: beta.

Starts a CSV import and returns the import object and a 201 Created response code. The response includes a Location header with the URL of the created run. The run starts as queued; retrieve it to poll its progress.

The CSV file must be sent as a multipart/form-data request, in a file part. A file value that is not an uploaded file part returns 422. A blank CSV is rejected during pre-flight, and a file larger than 10 MB is rejected.

POST /v2/imports
Parameter Type Description
import_type string Required. The kind of import to run: client, contact, expense, person, project, or timesheet.
file file Required. The CSV file to import, sent as a file part in a multipart/form-data request.
ignore_blank_entries_for_existing_users boolean person imports only. true (the default) leaves existing values in place when a CSV cell is blank; false resets them. Accepts only true or false; any other value returns 422. Sending this parameter for another import type returns 422.

Example Request:

curl -X POST "https://api.harvestapp.com/v2/imports" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Harvest-Account-Id: $ACCOUNT_ID" \
  -H "User-Agent: MyApp ([email protected])" \
  -F "import_type=client" \
  -F "[email protected];type=text/csv"

Example Response:

{
  "id": 1058,
  "import_type": "client",
  "status": "queued",
  "csv_file_name": "clients.csv",
  "imported_rows_count": 0,
  "imported_hours": 0.0,
  "error_rows_count": 0,
  "csv_errors_available": false,
  "created_at": "2026-10-16T09:30:00Z",
  "updated_at": "2026-10-16T09:30:00Z",
  "started_at": null,
  "completed_at": null,
  "reverted_at": null
}

A CSV that fails pre-flight validation returns 422 with a message and an errors array. Each entry names the failing row and its reason; a whole-file failure has a null row.

{
  "message": "Date, Client, Project, Task, Hours, First Name, and Last Name fields cannot be blank.",
  "errors": [
    {
      "row": "2008-08-02,Iridesco,,Backend Programming,CSV import,1.02,Shawn,Liu\n",
      "error": "Date, Client, Project, Task, Hours, First Name, and Last Name fields cannot be blank."
    }
  ]
}

Retrieve an import

Beta endpoint. Fully available, but the response shape may still change. Until it is frozen, every response includes Harvest-Api-Stability: beta.

Retrieves the details of an existing import run. Returns an import object and a 200 OK response code. Poll this endpoint to follow a run to completion.

GET /v2/imports/{IMPORT_ID}

Example Request:

curl "https://api.harvestapp.com/v2/imports/1057" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Harvest-Account-Id: $ACCOUNT_ID" \
  -H "User-Agent: MyApp ([email protected])"

Example Response:

{
  "id": 1057,
  "import_type": "project",
  "status": "completed",
  "csv_file_name": "iridesco-projects.csv",
  "imported_rows_count": 12,
  "imported_hours": 0.0,
  "error_rows_count": 1,
  "csv_errors_available": true,
  "created_at": "2026-10-15T09:00:00Z",
  "updated_at": "2026-10-15T09:02:00Z",
  "started_at": "2026-10-15T09:00:05Z",
  "completed_at": "2026-10-15T09:02:00Z",
  "reverted_at": null
}

Download the CSV errors for an import

Beta endpoint. Fully available, but the response shape may still change. Until it is frozen, every response includes Harvest-Api-Stability: beta.

Downloads the rows that failed to import, as a text/csv file. The response has a Content-Disposition: attachment header. Only the caller’s own runs can be downloaded. If the run has no error file, the endpoint returns 404; check csv_errors_available before requesting the file.

GET /v2/imports/{IMPORT_ID}/csv_errors

Example Request:

curl "https://api.harvestapp.com/v2/imports/1057/csv_errors" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Harvest-Account-Id: $ACCOUNT_ID" \
  -H "User-Agent: MyApp ([email protected])"

The file starts with the import type’s own CSV header row, followed by each failed row as it was uploaded. It has no error column, and errors that apply to the whole file are not included.

Example Response for a project import:

Client,Project,Project Code,Start Date,End Date,Project Notes
,Website Redesign,WR-01,2026-10-01,2026-12-31,Q4 refresh

Revert an import

Beta endpoint. Fully available, but the response shape may still change. Until it is frozen, every response includes Harvest-Api-Stability: beta.

Undoes a finished import by deleting the records it created. Returns the import object with a reverting status and a 200 OK response code. A run can be reverted only after it has finished. A run that is already reverting or has already been reverted returns 409, as does a run that has not finished.

POST /v2/imports/{IMPORT_ID}/revert

Example Request:

curl -X POST "https://api.harvestapp.com/v2/imports/1057/revert" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Harvest-Account-Id: $ACCOUNT_ID" \
  -H "User-Agent: MyApp ([email protected])"

Example Response:

{
  "id": 1057,
  "import_type": "project",
  "status": "reverting",
  "csv_file_name": "iridesco-projects.csv",
  "imported_rows_count": 12,
  "imported_hours": 0.0,
  "error_rows_count": 1,
  "csv_errors_available": true,
  "created_at": "2026-10-15T09:00:00Z",
  "updated_at": "2026-10-16T10:00:00Z",
  "started_at": "2026-10-15T09:00:05Z",
  "completed_at": "2026-10-15T09:02:00Z",
  "reverted_at": null
}

The revert runs in the background. Records that cannot be removed are skipped and their reasons are recorded. The requester is notified by email when the revert completes.

Errors

The following status codes are returned for the import endpoints:

Status Description
400 An updated_since value is not a valid ISO 8601 datetime (Invalid updated_since datetime provided: <value>), or a page or per_page value is outside its allowed range (Invalid page parameter: must be greater than 0, Invalid page parameter: must be an integer, Invalid per_page parameter: must be from 1 to 2000, Invalid per_page parameter: must be an integer).
401 Authentication failed: Authentication failed for API request.
403 The account is on a free plan (Data import is only available to paying accounts.), or the caller is not authorized (Not authorized!).
404 The run does not exist, is outside the caller’s scope, has a malformed ID, or has an ID beyond the supported width: Record not found. For GET /v2/imports/{IMPORT_ID}/csv_errors, also returned when the run has no error file: This import has no CSV error file.
406 The Accept header admits neither JSON nor */*.
409 The run is already being reverted (This import is already being reverted.), has already been reverted (This import has already been reverted.), or is in another state that cannot be reverted, including queued, working, and expired (This import cannot be reverted.).
415 A request body was sent with a media type other than JSON or form data: Content-Type header required to be application/json, got ...
422 An import_type is missing, blank, or not one of the supported types (Invalid import_type parameter: <value> is not a supported import type); a file value is not an uploaded file part (Invalid file parameter: must be an uploaded file part); ignore_blank_entries_for_existing_users is sent for a non-person import (Invalid ignore_blank_entries_for_existing_users parameter: only supported for import_type=person) or is not true or false (Invalid ignore_blank_entries_for_existing_users parameter: must be true or false); a CSV fails pre-flight; a run fails validation (file must be less than 10 megabytes in size); the account already has two queued or working runs (You can only run two imports at once, and you’ve hit the limit! Please wait until one of your current imports finishes before starting another.); or a cursor is malformed (Invalid cursor parameter: must not be empty, Invalid cursor parameter, or Invalid cursor parameter: must be a valid base64 encoded JSON string).
503 A storage error prevented the upload from being saved (There was an error importing the file, please try again in a few minutes.), or the revert could not be started (There was an error reverting the import, please try again in a few minutes.).
500 An unexpected error occurred after the run was queued.

Still have questions? We’re happy to help!

Contact Us