Platform API reference
Report Usage
Report cumulative per-worker, per-day work totals (time, tasks, labels) on a linked contract. Idempotent upserts — re-POSTing never double counts.
POST
Reports work done on your platform against an OpenTrain contract. Entries are cumulative per-worker, per-day totals: each entry replaces the stored totals for its (worker,
workDate), so re-POSTing the same report — or a corrected one — is idempotent and never double counts. Fields omitted from an entry keep their previously stored values.
The response includes the recomputed budget. Crossing the 80% / 100% consumption thresholds emits milestone.budget_low / milestone.budget_depleted webhooks.
Requirements: usage:write scope, and the contract’s job must be referenced by a project link on the calling token’s install.
Request
string
required
The OpenTrain contract to attribute usage to.
object[]
required
1–100 usage entries. One entry per (worker, day).
Response
string
The contract the usage was recorded against.
integer
Number of entries upserted.
object
The recomputed budget — same shape as
GET /contracts/{contractId}/budget.