Skip to content
OpenTrain AIOpenTrain AIOpenTrain AIDocs

Ask OpenTrain

Answers from the documentation, with sources.

What would you like to do with OpenTrain?

AI answers can be mistaken. Check the linked sources. Don’t include private account information.

Open app

DEVELOPER DOCUMENTATION

Platform API Reference Overview

Base URL, ot_ptk_ bearer authentication, the error envelope, scopes, and a map of every OpenTrain Platform API endpoint.

Every page in this reference documents one Platform API endpoint by hand: parameters, response fields, scope requirements, examples, and the errors you can actually hit. The machine-readable contract of record is the served spec — if a page and the spec ever disagree, the spec wins:

GET https://app.opentrain.ai/api/partner/v1/openapi.json

(The spec endpoint itself requires no authentication.)

https://app.opentrain.ai/api/partner/v1

Every endpoint requires an install-scoped platform token in the Authorization header:

Terminal window
curl -sS https://app.opentrain.ai/api/partner/v1/installs/current \
-H "Authorization: Bearer $OT_PARTNER_TOKEN"

Tokens start with ot_ptk_ and are minted when a customer installs your app via the consent flow — shown once, on the consent screen only.

Beyond the per-endpoint scope, every request additionally requires a live (non-revoked) token, an ACTIVE install, an ACTIVE platform app, and the annotation-platform feature enabled on the granting employer’s account. Any of those failing yields 401 or 403.

Non-2xx responses share the same JSON shape as the Public API:

{
"error": "Human-readable message",
"code": "FORBIDDEN",
"requestId": "9d1f3a8e-...",
"details": { "...": "endpoint-specific context" }
}

code is one of BAD_REQUEST, UNAUTHORIZED, FORBIDDEN, NOT_FOUND, CONFLICT, RATE_LIMITED, INTERNAL_ERROR. Include requestId when contacting support.

ScopeEndpoints it unlocks
(any valid token)GET /installs/current
project-links:readList and get project links
project-links:write (implies read)Create and delete project links
contracts:readList contracts and read contract budgets
participants:readList contract participants
participants:emailThe workEmail field on participants and webhook payloads — also requires install PII consent
usage:writeReport per-day work usage on linked contracts
webhooks:manageAll six webhook-endpoint operations
FamilyEndpointsWhat it covers
Installs1The install (consent grant) this token belongs to
Project links4Links between your projects and OpenTrain jobs
Contracts4Hired contracts on linked jobs, participants, budget, and usage reporting
Webhook endpoints6Endpoint CRUD, re-enable, and redelivery