Skip to navigation

Set Up a Compliance Profile by API

Set up a compliance profile by API

A compliance profile is the list of requirements a subcontractor is checked against. You can build one in the dashboard’s profile builder or through the API; both see the same profiles, and a profile made one way can be edited the other way.

This page walks through creating a profile with all of its requirements in one call, then changing it later. Every example is a complete request you can paste into a terminal.

You need: an API key with the scopes compliance_profiles:write and requirements:write (add them when you create the key in the dashboard), and your organization ID.

export TG="https://api.tradeguardins.com"
export TG_KEY="tg_..." # a sandbox key while you're testing
export ORG_ID=$(curl -s "$TG/v1/organizations" -H "Authorization: Bearer $TG_KEY" | jq -r '.data[0].id')

1. Create the profile and its requirements together

Send the profile with a requirements list. The call is all or nothing: TradeGuard checks every requirement first, and if any of them has a problem, nothing is saved and the error tells you which one (see When something is wrong). Otherwise the profile and all of its requirements are saved together.

curl -s -X POST "$TG/v1/organizations/$ORG_ID/compliance-profiles" \
-H "Authorization: Bearer $TG_KEY" -H "Content-Type: application/json" \
-d '{
"name": "Standard subcontractor",
"requiredAdditionalInsuredName": "Arise Homes LLC",
"requirements": [
{
"title": "General Liability $1M / $2M",
"scopeLevel": "entity",
"documentCategory": "insurance",
"policyType": "general_liability",
"trackExpiration": true,
"criteria": {
"limits": {
"each_occurrence": { "min": 1000000 },
"general_aggregate": { "min": 2000000 },
"products_completed_ops_aggregate": { "min": 2000000 }
},
"expiration": { "must_be_active": true }
}
},
{
"title": "Auto Liability $1M CSL",
"scopeLevel": "entity",
"documentCategory": "insurance",
"policyType": "automobile_liability",
"trackExpiration": true,
"criteria": {
"limits": { "combined_single_limit": { "min": 1000000 } },
"expiration": { "must_be_active": true }
}
},
{
"title": "Workers Comp & Employer'"'"'s Liability $1M",
"scopeLevel": "entity",
"documentCategory": "insurance",
"policyType": "workers_comp",
"trackExpiration": true,
"criteria": {
"limits": {
"each_accident": { "min": 1000000 },
"disease_each_employee": { "min": 1000000 },
"disease_policy_limit": { "min": 1000000 }
},
"expiration": { "must_be_active": true },
"accept_exemption": true
}
},
{
"title": "Additional Insured (GL)",
"scopeLevel": "entity",
"documentCategory": "endorsement",
"criteria": {
"endorsement": { "token": "additional_insured", "appliesTo": ["general_liability"] }
}
},
{
"title": "30-day notice of cancellation",
"scopeLevel": "entity",
"documentCategory": "notice_of_cancellation",
"criteria": { "noticeOfCancellation": { "minimumDaysNotice": 30 } }
}
]
}' | jq '.data | {id, name, requirements: [.requirements[] | {id, title, documentCategory}]}'

What you get back (201):

  • The profile, with its id. Save it: you’ll use it to enroll subcontractors.

  • requirements: first the profile’s Certificate checks requirement, which every new profile gets automatically, then your requirements in the order you sent them.

  • Defaults filled in where you left a rule out (the response shows the values that were saved):

    • General liability checks that the policy is written on an occurrence basis.
    • Auto checks covered autos (any auto, or owned + hired + non-owned), with the “owns no company vehicles” exception on.
    • Workers comp checks that per statute is ticked.
    • An additional insured on general liability must cover ongoing and completed operations.
    • Every endorsement must name the certificate holder.

    To switch a default off, send it yourself: "policyRules": {} for no policy rules, or "coverageBasis": null / "namedParties": null on an endorsement.

Make it your default profile with "isDefault": true. Every active subcontractor is then enrolled in it right away, and new subcontractors are enrolled automatically. Otherwise, enroll subcontractors one at a time with Attach a compliance profile.

2. Requirement examples

Each block below is one item for the requirements list. You can also add it to an existing profile on its own with Create a requirement:

curl -s -X POST "$TG/v1/compliance-profiles/$PROFILE_ID/requirements" \
-H "Authorization: Bearer $TG_KEY" -H "Content-Type: application/json" \
-d '{ ...one of the blocks below... }'

Every requirement needs a title and "scopeLevel": "entity". Optional on every requirement: enforcementLevel (required by default; track_only, stored as preferred, never blocks and gives subs who meet it a tag, see Existing Subs and Track-only Tags; conditional with a conditionKey), description, isActive: false to create it paused, and sortOrder.

General liability

{
"title": "General Liability $2M / $4M, per project aggregate",
"scopeLevel": "entity",
"documentCategory": "insurance",
"policyType": "general_liability",
"requireGcNameMatch": true,
"trackExpiration": true,
"criteria": {
"limits": {
"each_occurrence": { "min": 2000000 },
"general_aggregate": { "min": 4000000 }
},
"expiration": { "must_be_active": true },
"policyRules": { "claimsBasis": "occurrence", "aggregatePerProject": true, "umbrellaOnTop": true }
}
}

requireGcNameMatch checks that the certificate lists the profile’s requiredAdditionalInsuredName. umbrellaOnTop lets a live umbrella that follows form make up a short limit. Every rule is explained on Policy rules.

Auto liability

{
"title": "Auto Liability $1M CSL",
"scopeLevel": "entity",
"documentCategory": "insurance",
"policyType": "automobile_liability",
"trackExpiration": true,
"criteria": {
"limits": { "combined_single_limit": { "min": 1000000 } },
"expiration": { "must_be_active": true },
"policyRules": {
"coveredAutos": {
"accepted": [["any"], ["owned", "hired", "non_owned"], ["scheduled", "hired", "non_owned"]]
},
"noOwnedVehiclesException": true,
"maxCollisionDeductible": 2500
}
}
}

coveredAutos.accepted lists the combinations of covered-auto boxes you accept; a certificate passes when every box of any one combination is ticked. Leave out ["scheduled", "hired", "non_owned"] if your contracts require all owned autos to be covered. See Covered autos.

A combined single limit minimum is also met by split limits when every split limit is at least the minimum. Add "requireCombinedSingleLimit": true to accept only a combined single limit.

Workers comp and employer’s liability

{
"title": "Workers Comp, statutory + $1M EL",
"scopeLevel": "entity",
"documentCategory": "insurance",
"policyType": "workers_comp",
"trackExpiration": true,
"criteria": {
"limits": {
"each_accident": { "min": 1000000 },
"disease_each_employee": { "min": 1000000 },
"disease_policy_limit": { "min": 1000000 }
},
"expiration": { "must_be_active": true },
"accept_exemption": true,
"policyRules": { "statutory": true, "ownerNotExcluded": true }
}
}

accept_exemption (workers comp only) lets a workers comp exemption on file stand in for coverage. Set it to false to require a policy.

Umbrella / excess

{
"title": "Umbrella $5M, follows form over GL and auto",
"scopeLevel": "entity",
"documentCategory": "insurance",
"policyType": "umbrella",
"trackExpiration": true,
"criteria": {
"limits": {
"each_occurrence": { "min": 5000000 },
"aggregate": { "min": 5000000 }
},
"expiration": { "must_be_active": true },
"policyRules": {
"umbrellaOrExcess": "either",
"maxRetention": 10000,
"followForm": { "over": ["general_liability", "automobile_liability"] }
}
}
}

Endorsements

An endorsement requirement checks one endorsement across one or more policies. The rules are explained on Endorsement rules.

Additional insured on general liability and auto, with the CG 20 10 and CG 20 37 forms and an owner named too:

{
"title": "Additional Insured (GL + Auto)",
"scopeLevel": "entity",
"documentCategory": "endorsement",
"criteria": {
"endorsement": {
"token": "additional_insured",
"appliesTo": ["general_liability", "automobile_liability"],
"coverageBasis": "ongoing_and_completed",
"namedParties": { "includeCertificateHolder": true, "names": ["Owner Holdings LLC"] },
"requiredForms": ["CG 20 10", "CG 20 37"],
"minimumProof": "endorsement_page"
}
}
}

Waiver of subrogation on general liability, auto and workers comp:

{
"title": "Waiver of Subrogation",
"scopeLevel": "entity",
"documentCategory": "endorsement",
"criteria": {
"endorsement": {
"token": "waiver_of_subrogation",
"appliesTo": ["general_liability", "automobile_liability", "workers_comp"]
}
}
}

Primary and non-contributory on general liability:

{
"title": "Primary & Non-Contributory (GL)",
"scopeLevel": "entity",
"documentCategory": "endorsement",
"criteria": {
"endorsement": { "token": "primary_noncontributory", "appliesTo": ["general_liability"] }
}
}

The token can be additional_insured, waiver_of_subrogation, primary_noncontributory or loss_payee.

Notice of cancellation

{
"title": "30-day notice of cancellation (GL + Auto)",
"scopeLevel": "entity",
"documentCategory": "notice_of_cancellation",
"criteria": {
"noticeOfCancellation": {
"minimumDaysNotice": 30,
"appliesTo": ["general_liability", "automobile_liability"]
}
}
}

Leave appliesTo out for one check that covers the whole certificate. minimumDaysNotice is 30 when left out. See Notice of cancellation, including waivers for carriers that can’t give notice.

Certificate checks

Certificate checks (certificate holder, insured name, signature, every policy active) are one requirement the profile gets automatically. Choose its settings with certificateChecks on the profile, next to name:

{
"name": "Standard subcontractor",
"certificateChecks": {
"certificateHolder": { "enabled": true, "name": "Arise Homes LLC", "address": "1200 Main Street, Suite 400, Kansas City, MO 64105" },
"insuredName": { "enabled": true },
"signature": { "enabled": true },
"allPoliciesActive": { "enabled": false }
},
"requirements": []
}

Leave certificateChecks out for the defaults (insured name, signature and every policy active on; the certificate holder check on when requiredAdditionalInsuredName is set). Send "certificateChecks": null for a profile without certificate checks. See Certificate checks.

Limit names

A limit name that doesn’t belong to the policy type is rejected.

policyTypeLimit names (criteria.limits)
general_liabilityeach_occurrence, general_aggregate, products_completed_ops_aggregate, personal_advertising_injury, damage_to_rented_premises, medical_expense
automobile_liabilitycombined_single_limit, bodily_injury_per_person, bodily_injury_per_accident, property_damage
workers_compeach_accident, disease_each_employee, disease_policy_limit (employer’s liability)
umbrellaeach_occurrence, aggregate

Each limit takes a min, a max, or both, in dollars: { "min": 1000000 }.

When something is wrong

Requests are checked strictly. A misspelled field, a limit from another policy type, or a rule that doesn’t fit the policy is a 400 validation_failed, and nothing is saved. Each entry in details names one problem. In a create-profile call, the path starts with the requirement’s position in your list, counting from 0:

{
"error": "Validation failed",
"code": "validation_failed",
"details": [
{
"path": "requirements.2.criteria.limits.each_ocurrence",
"message": "\"each_ocurrence\" is not a general_liability limit; use one of: each_occurrence, general_aggregate, products_completed_ops_aggregate, personal_advertising_injury, damage_to_rented_premises, medical_expense"
}
]
}

Other things that are rejected:

  • An insurance requirement without a policyType.
  • A policy rule on the wrong policy, such as coveredAutos on general liability.
  • accept_exemption on anything other than workers comp.
  • A certificate requirement in requirements while the profile is also getting its automatic one. Send "certificateChecks": null if you want to supply your own.
  • A document requirement for a license or a background check (documentCategory: license or background_check without a reportSource). Those files are stored only, not read: licenses are checked by a license report requirement, and background checks will run through the background check API.

3. Change the profile later

Add a requirement: POST /v1/compliance-profiles/$PROFILE_ID/requirements with one block from above. Subcontractors already on the profile are checked against it right away.

Change a requirement: Update a requirement. Send only the fields you’re changing, but criteria replaces the whole criteria object, so read the requirement first and send it back complete:

curl -s -X PATCH "$TG/v1/requirements/$REQUIREMENT_ID" \
-H "Authorization: Bearer $TG_KEY" -H "Content-Type: application/json" \
-d '{
"criteria": {
"limits": { "each_occurrence": { "min": 2000000 }, "general_aggregate": { "min": 4000000 } },
"expiration": { "must_be_active": true },
"policyRules": { "claimsBasis": "occurrence" }
}
}' | jq '{title: .data.title, runsTriggered: .meta.runsTriggered}'

When a change affects how subcontractors are judged, each of them is re-checked and meta.runsTriggered says how many checks started. Changing only a title, description or order doesn’t re-check anyone.

Pause a requirement: PATCH it with { "isActive": false }. Subcontractors stop being judged on it and its history is kept. Send { "isActive": true } to turn it back on.

Delete a requirement: DELETE /v1/requirements/$REQUIREMENT_ID. Past results are kept for history and everyone on the profile is re-checked without it. There’s no undo.

Change the profile’s settings (name, default, cadences, the name certificates must list): Update a compliance profile.

Testing without broker calls: set "insuranceVerificationCadence": "none" on the profile (in the dashboard: Re-verify insurance with the broker → Don’t verify with the broker). A certificate uploaded for a subcontractor on that profile starts no call or email to the broker, and one that meets the rules reads compliant without waiting on the broker. Useful with sample certificates that list a real broker’s phone number. If the subcontractor is also on another of your profiles that does verify, the broker is still called.

Delete the profile: DELETE /v1/compliance-profiles/$PROFILE_ID. A profile that subcontractors are still enrolled in can’t be deleted: the response is 409 conflict and says how many are enrolled. Move them first with Detach a compliance profile, or attach them to another profile, then delete. Or take them all off and delete in one step (your key also needs subcontractors:write):

curl -s -X DELETE "$TG/v1/compliance-profiles/$PROFILE_ID?detachSubcontractors=true" \
-H "Authorization: Bearer $TG_KEY" | jq '.data'

Your default profile can’t be deleted (new subcontractors join it automatically): make another profile the default first. A profile an active project uses can’t be deleted either: give the project another profile or archive it first. There’s no undo.