Load Harvest data to Databricks

Build a Harvest to Databricks pipeline with your coding agent. One prompt scaffolds it with the dltHub AI harness, plus the Harvest API base URL, auth, endpoints, and incremental loading.

Source
Harvest
Destination
Databricks
Databricks is a unified, open analytics platform for data, analytics and AI, built on the lakehouse.

Harvest is a time-tracking and project-management service with REST APIs for users, clients, projects, expenses, invoices, time entries, and reporting. Everything needed to build a working Harvest → Databricks pipeline is on this page: the API's base URL, authentication, endpoints, pagination and incremental field — plus a prompt that hands the whole job to your coding agent.


Build your Harvest to Databricks pipeline

Paste this prompt into Claude, Codex, or Cursor. The agent does the rest.

Prompt
Run uvx dlthub-init@latest to build a pipeline from Harvest to Databricks and run it on dltHub

That scaffolds a dltHub workspace and installs the dltHub AI harness — the project rules, the secrets-management skill, and the dlt MCP server your agent needs to work safely. From there it reads the Harvest API, proposes the endpoints to load, then writes, runs and validates the pipeline while you review rather than type. Credentials are inspected through MCP tools, so your agent never reads secrets.toml itself. How the LLM-native workflow works →

Prefer to write it yourself? Every fact the agent uses is below.


Harvest API at a glance

Base URLhttps://api.harvestapp.com/v2
Example endpointGET clients
Records found atclients
Authenticationall requests require a Bearer access token and Harvest-Account-Id header — sent in the Authorization header, prefixed Bearer
Also requiredHarvest-Account-Id, User-Agent
PaginationCursor-based via cursor, next cursor at links.next, page size via per_page (default 2000, max 2000). Harvest API v2 list responses are generally paginated. The documented page-size parameter is per_page, not limit; its default and maximum are 2000 (endpoint tables describe the accepted range as 1–2000). Cursor-based pagination is supported, and page is deprecated on endpoints such as Tasks, Users, and User Project Assignments. The API response includes links.first/next/previous/last; callers should follow links.next rather than construct cursor URLs themselves. The next cursor is therefore obtained from the URL in links.next, and should be sent as the cursor query parameter when making a request manually. page and cursor are mutually exclusive, with cursor taking precedence. The base API URL and authentication headers do not alter pagination. updated_since is a filtering parameter, not a pagination parameter.
Incremental fieldupdated_at
Record idid
API referencehttps://help.getharvest.com/api-v2/authentication-api/authentication/authentication/

These values come from the Harvest API reference — the authoritative source if anything here looks out of date.


How do I authenticate with the Harvest API?

Send the personal access or OAuth2 access token in the HTTP header Authorization: Bearer <access_token>, and send the Harvest account identifier in Harvest-Account-Id: <account_id>. Harvest examples also include a User-Agent header; JSON request bodies require Content-Type: application/json.

1. Get your credentials

  1. Sign in to Harvest ID at https://id.getharvest.com/.
  2. Open the Developers section (also referred to as the Harvest Developer page).
  3. Under Personal access tokens, choose Create New Personal Access Token.
  4. Enter a descriptive name and create the token.
  5. Copy the generated personal access token immediately and securely store it; it is used as the Bearer token.
  6. Record the Harvest account ID(s) shown with the token. A personal access token is associated with the accounts you can access, and every API request must identify the target account with the Harvest-Account-Id header.
  7. Send requests to https://api.harvestapp.com/v2 with Authorization: Bearer <access_token>, Harvest-Account-Id: <account_id>, and a non-empty User-Agent identifying your integration (preferably including a contact email or URL). Harvest API v2 also supports OAuth2 for integrations used by other Harvest users; use a personal access token for a direct, quickest setup.

2. Add them to .dlt/secrets.toml

[sources.harvest_source] access_token = "your_harvest_personal_access_token" account_id = "your_harvest_account_id" user_agent = "YourAppName (https://example.com/contact)"

dlt reads this file automatically at runtime. With the harness, the setup-secrets skill prompts you for the values and never handles the raw credential in chat. For production, see setting up credentials with dlt.


What Harvest data can I load into Databricks?

These are the Harvest endpoints dlt can load into Databricks:

ResourceEndpointMethodData selectorDescription
clientsclientsGETclientsList clients; supports updated_since, cursor pagination, and per_page.
projectsprojectsGETprojectsList projects; supports updated_since, cursor pagination, and per_page.
time_entriestime_entriesGETtime_entriesList time entries; supports updated_since, filters, and pagination.
usersusersGETusersList users; supports updated_since, cursor pagination, and per_page.
taskstasksGETtasksList tasks; supports updated_since, cursor pagination, and per_page.
estimatesestimatesGETestimatesList estimates; supports updated_since, date/state filters, and pagination.
project_assignmentsusers/{USER_ID}/project_assignmentsGETproject_assignmentsList a user’s project assignments; documented response selector is project_assignments.

How do I load only new Harvest records?

Harvest exposes updated_at on clients, so dlt can request only the records that changed since the last run. Set it as the cursor_path and dlt tracks the high-water mark for you between runs.

{"name": "clients", "endpoint": { "path": "clients", "data_selector": "clients", "incremental": {"cursor_path": "updated_at", "initial_value": "2024-01-01T00:00:00Z"}, }}

On the first run dlt loads everything from initial_value; on every run after that it requests only what changed and appends with write_disposition="merge" if you set a primary key. See incremental loading.


What does the generated Harvest pipeline look like?

A standard dlt REST API pipeline — the same code you would write by hand, loading users/me and time_entries from the Harvest API into Databricks:

import dlt from dlt.sources.rest_api import RESTAPIConfig, rest_api_resources @dlt.source def harvest_source(access_token=dlt.secrets.value): config: RESTAPIConfig = { "client": { "base_url": "https://api.harvestapp.com/v2", "auth": {"type": "bearer", "token": access_token}, }, "resources": [ {"name": "clients", "endpoint": {"path": "clients", "data_selector": "clients"}}, {"name": "time_entries", "endpoint": {"path": "time_entries", "data_selector": "time_entries"}} ], } yield from rest_api_resources(config) def load_harvest_to_databricks() -> None: pipeline = dlt.pipeline( pipeline_name="harvest_pipeline", destination="databricks", dataset_name="harvest_data", ) load_info = pipeline.run(harvest_source()) print(load_info) if __name__ == "__main__": load_harvest_to_databricks()

Run it with uv run python harvest_pipeline.py. The agent iterates on this until it loads cleanly — you review and approve, rather than write it from scratch.


How do I query Harvest data in Databricks?

dlt creates one table per resource. Query the loaded data with Python or SQL — or ask your agent to, through the MCP server's execute_sql_query tool.

Python (pandas DataFrame):

import dlt data = dlt.pipeline("harvest_pipeline").dataset() df = data.clients.df() print(df.head())

SQL:

SELECT * FROM harvest_data.clients LIMIT 10;

See querying your data with dataset and exploring it in marimo notebooks.


How do I deploy the Harvest to Databricks pipeline in production?

The pipeline runs locally, which is ideal for prototyping and one-off analysis. When you need it on a schedule, monitored on every load, and shared with your team, deploy the same dlt code on the dltHub platform — no infrastructure to maintain. The prompt above already ends with "run it on dltHub", so your agent can take it there directly.

  • Deploy & schedule — run the pipeline as a managed job with automatic retries.
  • Monitor — observable job queues, alerting, and load metrics for every run.
  • Transform — promote raw Harvest loads into governed, documented models.
  • Visualize & share — explore data in notebooks and publish live dashboards instead of static screenshots.

Book a demo →


What other destinations can I load Harvest data to?

dlt loads into any of these — only the destination argument changes:

DestinationExample value
PostgreSQL"postgres"
BigQuery"bigquery"
Snowflake"snowflake"
Redshift"redshift"
Databricks"databricks"
Filesystem (S3, GCS, Azure)"filesystem"

Set dlt.pipeline(destination="snowflake") and add credentials in .dlt/secrets.toml. On the dltHub platform the same pipeline runs against a managed Iceberg lakehouse. See the full destinations list.


Next steps

Was this page helpful?

Community Hub

Need more dlt context for Harvest to Databricks?

Request dlt skills, commands, AGENT.md files, and AI-native context.