Create a subcontractor
Creates a subcontractor and enrolls it in your organization.
Subcontractor records are shared across TradeGuard within an environment (sandbox subcontractors are separate from production ones).
To add one that is already on TradeGuard, find it with
Look up subcontractors and send its
id as existingSubcontractorId: it is added to your organization, the
response has matchedExisting: true, and its stored company details
are not overwritten by this request (use
Update a subcontractor).
Without existingSubcontractorId, a new subcontractor is created. If
one with the same contactEmail (case-insensitive) or contactPhone
already exists, nothing is linked automatically and the call fails with
409 subcontractor_match: the message names that subcontractor (and its
city and state, when on file), and details holds its id (path
existingSubcontractorId) and the field that matched. Send the request
again with that existingSubcontractorId to add it, or with
createNew: true if it is a different company. If the match is already
enrolled with your organization the call fails with 409 conflict
instead: details holds its id (path subcontractorId) and the field
that matched. The match never checks the contact another organization
set privately for a subcontractor.
Shared vs. your own. Company details (name, entity type, EIN, owner,
address, website, licenses, trade) are shared by every organization that
enrolls the subcontractor; any of them can edit those, and each edit is
recorded in the subcontractor’s activity. Your contact person
(contactName, contactEmail, contactPhone), externalId and
metadata are your organization’s own: when you join an existing
subcontractor your contact is the one you sent (its default contact fills
any field you left out), and no other organization sees or changes these
fields.
The given complianceProfileId — or, when omitted, your organization’s
default profile (if one is set) — is attached right away, creating its
compliance records and starting an onboarding compliance run.
Secretary of State and license checks. If the profile includes one,
it runs automatically once the subcontractor has the information it
needs: a Secretary of State check needs companyName (or firstName +
lastName) and businessAddress.state; a license check needs
tradeCategory and businessAddress.state (plus the license’s state
when you send licenses). data.informationNeeded lists what is still
missing; until it’s added the requirement reads pending with
statusReason “Waiting on information: …”. See the “Secretary of State
and License Checks” guide.
Invite. When TradeGuard collects documents for your organization,
adding the subcontractor also invites it: Jake from TradeGuard emails
your contactEmail for it with what’s needed and a link to its portal,
in the next sending window, then follows up. data.invite says what
happened; the add never fails because of the invite. If your
organization collects documents itself, nothing is sent
(invite.status: skipped, reason: customer_collects). See
Invite a subcontractor.
422 is returned for a malformed ein, more than one primary license,
or a duplicate (state, licenseNumber) pair. Its details names the
field: ein, licenses, or licenses.{index}.licenseNumber.
contactEmail is trimmed before it is checked, so a stray space
pasted with the address is not an error.
Requires scope subcontractors:write. Returns 404 if organizationId
is not one of the caller’s organizations or the caller’s organization has
not been provisioned.
Authentication
Session JWT or API key (ak_...)
Request
Adds a subcontractor already on TradeGuard to your organization. Its shared company details are kept as they are; name, entity type and intake fields in this request are ignored (use Update a subcontractor to change them). Your contact fields are optional: any you leave out start as the subcontractor’s default contact.
Response
Subcontractor created, or an existing subcontractor added to your organization (matchedExisting)
Shared company details plus your organization’s own contact, externalId and metadata (never another organization’s).
True when you added an existing subcontractor with existingSubcontractorId instead of creating a new one; its stored company details are not overwritten by this request.
