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.
/api/partner/v1/project-linksCreates 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.
Request
Section titled “Request”externalProjectIdstringbodyrequiredYour project’s identifier (max 200 chars). Unique per install — reusing one returns 409.
externalProjectNamestringbodyHuman-readable project name (max 300 chars).
externalProjectUrlstringbodyDeep link to the project in your platform (max 2048 chars).
jobIdstringbodyThe 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.
provisioningModestringbodyPARTNER_WEBHOOKPARTNER_WEBHOOK (you provision workspace members from webhook events — recommended) or MANAGED_ADAPTER (the OpenTrain managed-credential path). See provisioning modes.
Response
Section titled “Response”projectLinkobjectThe created link: {id, jobId, externalProjectId, externalProjectName, externalProjectUrl, provisioningMode, createdAt}.
Errors
Section titled “Errors”| Status | code | Meaning |
|---|---|---|
400 | BAD_REQUEST | Body not valid JSON, externalProjectId missing, or a field exceeds its length limit |
401 | UNAUTHORIZED | Missing, invalid, or revoked token |
403 | FORBIDDEN | Token lacks project-links:write |
404 | NOT_FOUND | jobId does not reference a job owned by the installing employer |
409 | CONFLICT | Duplicate externalProjectId for this install, or the install’s link limit is reached |