Forecast API Overview

The Forecast API is the public interface to Forecast, Harvest’s resource planning product. It publishes the board — the projects, people and placeholders a plan is drawn on — together with the work scheduled on them, and it writes the plan back.

Every endpoint is under /v2/forecast. Authentication, the Harvest-Account-Id header, the User-Agent requirement and the error envelope are the same as for the rest of the API v2.

What the API covers

Area Endpoints Reference
The board over a date window GET /v2/forecast/window Board Window
The bars scheduled on the board GET, POST /v2/forecast/assignments
GET, PATCH, DELETE /v2/forecast/assignments/{ASSIGNMENT_ID}
POST /v2/forecast/assignments/{ASSIGNMENT_ID}/divide
Scheduled Assignments
Repeating bars and the series behind them GET, POST /v2/forecast/repeated_assignment_sets
GET, PATCH, DELETE /v2/forecast/repeated_assignment_sets/{ID}
POST /v2/forecast/repeated_assignment_sets/{ID}/split
Repeating Assignments
Planned hours, time off and capacity per person GET /v2/forecast/heatmap Availability Heatmap
Approved time off and company-wide closures GET /v2/forecast/time_off
POST /v2/forecast/holidays
PATCH, DELETE /v2/forecast/holidays/{ID}
Time Off and Company Holidays
Named date markers on a project GET, POST /v2/forecast/milestones
GET, PATCH, DELETE /v2/forecast/milestones/{ID}
Milestones
Committed future spend on a project GET, POST /v2/forecast/planned_expenses
GET, PATCH, DELETE /v2/forecast/planned_expenses/{ID}
Planned Expenses
Revenue, cost and fee per board project GET /v2/forecast/financials Project Financials
Whether a project is on the board, and its colour POST /v2/forecast/projects
DELETE /v2/forecast/projects/{PROJECT_ID}
PATCH /v2/forecast/projects/{PROJECT_ID}/color
Board Projects
The named, unfilled slots a bar can point at GET, POST /v2/forecast/placeholders
GET, PATCH /v2/forecast/placeholders/{ID}
Placeholders
The Configure switches GET /v2/forecast/settings
PATCH /v2/forecast/settings/{financial_estimates, weekly_digest, financials_preference, weekly_digest_subscription}
Forecast Settings
The schedule export as structured JSON GET /v2/forecast/schedule Schedule Export

Required permissions

Four things decide what a caller may read and write, and all four are facts about the person the access token belongs to:

  • The Forecast module must be enabled for the account.
  • A Forecast seat. Seats are administered per person; a claim without a seat is dormant, and a seat without a claim makes someone plannable by others while they themselves see nothing.
  • A Forecast claim. Reads take forecast:read:all, forecast:read:managed or forecast:read:own. Writes take forecast:write:all, forecast:write:managed or forecast:write:own. A write claim implies the read at the same scope.
  • A write scope. all reaches the whole account, managed the projects the person manages, self their own row. all wins over managed, which wins over self.

The read scope is resolved from the token’s user on every request and is never a parameter: there is no way to ask for a wider board than the caller holds. An account in Forecast read-only mode accepts no writes at all, whatever claims the caller holds.

Some writes need the company-wide tier — the all write scope — rather than the scope of one project, because the thing they change is not tied to a project:

  • the Configure switches,
  • placeholders, which are shared by every project they are scheduled on,
  • Company Calendar holidays, which are company-wide closures.

Planned expenses are cost data, so reading them needs cost-rate visibility as well as board access.

Beta

Every endpoint on these pages is beta. The responses are fully available, but the shape of a response body may still change. Until an endpoint is frozen, every response carries:

Harvest-Api-Stability: beta

Date windows

The reads that take a date range accept from and to, both inclusive:

  • Give both bounds, or neither. One bound alone is refused.
  • from must not be later than to.
  • A window may not span more than 24 months.
  • With neither bound, the window defaults to nine months either side of today, in the account’s own timezone.

A malformed window answers 422 with error_code: "invalid_window" and one of these messages: missing window bound, invalid date: <value>, from must precede to, or window exceeds 24 months.

Pagination

The collections are paged by offset. page defaults to 1 and must be greater than zero. per_page defaults to and cannot exceed 2000 unless the endpoint’s own page says otherwise.

A read that returns one whole window in a single body is not paged: it either refuses a page or per_page it cannot honour, or validates both and returns the same body either way. Its own page says which, and what it refuses.

These endpoints are windowed by date rather than by row write time, so a cursor and a delta are not something they can generally honour. A malformed cursor is refused everywhere, with 422 and one of Invalid cursor parameter, Invalid cursor parameter: must not be empty, or Invalid cursor parameter: must be a valid base64 encoded JSON string.

Past that, what an endpoint does with a well-formed cursor and with updated_since is the endpoint’s own, and its page says which:

  • it refuses both, with 422 Invalid cursor parameter: this endpoint does not support cursor pagination and 422 The updated_since parameter is not supported on this endpoint;
  • it accepts and ignores a well-formed cursor — a client that sends one on every call is not asking for cursor paging — and refuses updated_since alone;
  • it refuses both with a message that names what the read is instead, such as Invalid cursor parameter: this endpoint returns the whole window and has no cursor;
  • it reads neither parameter at all, so both are ignored.

Units

Units are not interchangeable across this API. A capacity is published in seconds per week, planned work in decimal hours, and an amount in the account’s currency. Each attribute table states the unit of the field it describes.

Errors

Status When
400 A parameter is malformed: Invalid page parameter: must be greater than 0, Invalid per_page parameter: must be from 1 to 2000, or a value of the wrong shape.
401 Authentication failed.
403 The caller may not do this: the account has no Forecast module, the caller holds no Forecast seat or claim, the write scope is too narrow, an account switch is off, or the account is in Forecast read-only mode.
404 The record does not exist, belongs to another account, or is outside the caller’s scope. The three answer the same message, Record not found, so an id cannot be probed.
409 A concurrent write holds the row (error_code: "locked"), or the account’s schedule is being imported (error_code: "migration_in_progress"). Both are retryable.
422 The request is well formed but refused: a malformed window, a value outside its accepted set, a body the endpoint cannot read, or a record the write may not touch.
503 The account’s Forecast state could not be read. Retry in a few minutes.

A 403 names what is missing, so read its message rather than matching on the status alone. The wording is the controller’s own and differs between endpoints — Forecast is not enabled for this user and Forecast access is required are the same refusal — so each reference page states the messages its endpoints answer.

Still have questions? We’re happy to help!

Contact Us