Attach a subcontractor to a project
Adds the subcontractor to the project. The subcontractor must already be enrolled in the project’s organization (see Create a subcontractor) and that enrollment must be active.
On a new attachment (201) TradeGuard also:
- enrolls the subcontractor in the project’s compliance profile with a
project-scoped enrollment (
complianceProfileEnrollmentId), creating onependingcompliance record per requirement — or, if the subcontractor was on this project before, reactivates the previous enrollment and resets its records topending; - starts an initial compliance run (
trigger: onboarding) whose id is returned ascomplianceRunId; poll it with Get a compliance run or wait for thecompliance.run_completed/compliance.status_changedwebhooks.
The membership is the subcontractor’s assignment on the project.
When the project requires a project-specific COI, its project_coi
slot is opened (or an earlier one adopted) and returned in
projectDocuments.
Only one live assignment per subcontractor and project: attaching again
returns 409 assignment_exists with the existing assignment’s id in
details (path assignmentId). A project whose setup is not Ready
(e.g. it requires a project COI but has no project number yet) returns
409 project_not_ready.
400 is returned with code: bad_request when the subcontractor is
not enrolled in the organization or its enrollment is inactive, and
with code: validation_failed when subcontractorId is missing or not
a UUID. Requires scope projects:write.
Authentication
Session JWT or API key (ak_...)
Path parameters
Request
Response
Attached; project-scoped enrollment created and initial compliance run started
