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

Create Project Link

Link one of your platform's projects to an OpenTrain job. externalProjectId must be unique per install; emits project_link.created.

POST/api/partner/v1/project-links

Creates a project link mapping one of your projects to an OpenTrain job. Contract lifecycle events are emitted only for linked jobs, so this is the routing step of the integration. Emits a project_link.created event.

Requirements: project-links:write scope.

externalProjectIdstringbodyrequired

Your project’s identifier (max 200 chars). Unique per install — reusing one returns 409.

externalProjectNamestringbody

Human-readable project name (max 300 chars).

externalProjectUrlstringbody

Deep link to the project in your platform (max 2048 chars).

jobIdstringbody

The OpenTrain job to link. Must be a job owned by the installing employer — anything else returns 404. A link without a job receives no contract events until it points at one.

provisioningModestringbody
Default: PARTNER_WEBHOOK

PARTNER_WEBHOOK (you provision workspace members from webhook events — recommended) or MANAGED_ADAPTER (the OpenTrain managed-credential path). See provisioning modes.

StatuscodeMeaning
400BAD_REQUESTBody not valid JSON, externalProjectId missing, or a field exceeds its length limit
401UNAUTHORIZEDMissing, invalid, or revoked token
403FORBIDDENToken lacks project-links:write
404NOT_FOUNDjobId does not reference a job owned by the installing employer
409CONFLICTDuplicate externalProjectId for this install, or the install’s link limit is reached