Skip to navigation

Attach a subcontractor to a project

Beta

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 one pending compliance record per requirement — or, if the subcontractor was on this project before, reactivates the previous enrollment and resets its records to pending;
  • starts an initial compliance run (trigger: onboarding) whose id is returned as complianceRunId; poll it with Get a compliance run or wait for the compliance.run_completed / compliance.status_changed webhooks.

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

AuthorizationBearer

Session JWT or API key (ak_...)

Path parameters

projectIdstringRequiredformat: "uuid"

Request

This endpoint expects an object.
subcontractorIdstringRequiredformat: "uuid"

Response

Attached; project-scoped enrollment created and initial compliance run started

dataobjectOptional
A subcontractor's membership on a project.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error
429
Too Many Requests Error