Onboarding Guide
Welcome to TradeGuard
TradeGuard is a compliance management platform for companies that work with subcontractors. It collects the documents that prove a subcontractor is compliant — certificates of insurance (COIs), W-9s, licenses, training certificates — automatically extracts the relevant details, verifies insurance coverage directly with the broker, and continuously evaluates everything against the requirements you define.
You interact with TradeGuard in two ways: the dashboard, where you configure your requirements, API keys, and webhooks, and the API, which your systems use to manage subcontractors, upload documents, and run compliance checks. This guide introduces the product’s building blocks and vocabulary first, walks through the intended flow, and then covers the integration mechanics — authentication, webhooks, and a step-by-step walkthrough.
Core Concepts
Organization
Your workspace in TradeGuard. Every resource — subcontractors, documents, profiles, compliance results — belongs to your organization, and your API keys are scoped to it automatically. Some requests take an organizationId; you can find yours on the Settings page in the TradeGuard application.
Your sandbox is a separate organization with its own organization ID. The ID on the Settings page is for whichever mode the dashboard is in, so switch on Sandbox mode before copying it for sandbox work. Using a production ID with a sandbox key (or the other way round) returns 404 Organization not found in this environment. The simplest way to get the right ID is to ask the API: GET /v1/organizations returns the organization your key belongs to.
Subcontractor
The business (or individual) you track for compliance. A subcontractor record holds identity and contact details — entity type (llc, sole_proprietor, s_corp, c_corp, partnership, other), company or personal name, email and phone, and preferences for how TradeGuard communicates with them (email/SMS, English/Spanish). You can also set a tradeCategory describing their discipline (electrical, plumbing, hvac, roofing, concrete, and so on) and an externalId to link the record to your own systems.
Creating a subcontractor needs both a contactEmail and a contactPhone. The phone must be a real, dialable number: numbers without a country code are read as US numbers, formatted input like (415) 555-1234 is accepted and stored as +14155551234, and made-up numbers (for example +15551234567, whose area code doesn’t exist) are rejected with 400 validation_failed.
Subcontractor records are shared across general contractors. Before adding one, you can find it with GET /v1/subcontractors/lookup?q=Acme (name, DBA, email, phone or EIN; contacts come back partly hidden) and add it by sending its id as existingSubcontractorId. If you create a subcontractor whose email or phone matches one already on TradeGuard, nothing is linked automatically: you get 409 subcontractor_match naming it, and you resend with its existingSubcontractorId to join that record, or with createNew: true if it’s a different company. Company details (name, EIN, owner, address, licenses) are shared and any GC can update them; each change shows in the subcontractor’s activity. Your contact person, email and phone, your externalId and your metadata are your own: other GCs never see or change them, and notices you trigger go to your contact. When TradeGuard collects documents for you, adding a subcontractor also invites it by email; see Subcontractor invites and reminders.
Compliance Profile
A reusable template that defines what “compliant” means — for example, “Standard Subcontractor Requirements: GL coverage of at least $1M, plus a signed W-9.” Create and manage profiles in the dashboard or through the API (Set up a compliance profile by API); both see the same profiles. Every new subcontractor is enrolled in your default profile automatically. You list profiles to find their IDs if you want to enroll a subcontractor in another one.
Requirement
A single rule inside a compliance profile. Each requirement names a document category it applies to (and a policy type, for insurance), plus the criteria that must be met — coverage limits, expiration tracking, name matching, signatures, and policy rules such as occurrence basis, covered autos or umbrella follow form. Compliance checks evaluate a subcontractor against every requirement in their enrolled profile.
Every new profile also has one Certificate checks requirement for the checks that apply to the whole certificate: certificate holder, insured name (the subcontractor’s legal name or DBA), signature, and every listed policy in force. See Certificate Checks.
Document
A file uploaded as proof — a COI, tax form, license, or agreement. Every document is tagged with a category:
After upload, TradeGuard processes the file automatically: it is validated, then its contents are extracted (uploaded → validating → extracting → extracted). license and background_check files are stored only: they stay uploaded and are never read. Uploads are activated automatically and replace the previously active document of the same type once they have been read successfully — only active documents count toward compliance. A file that can’t be read (wrong or unreadable document) never replaces the one you already have: it becomes inactive and the earlier document keeps counting. If you want to stage a document for review without making it live, pass activate: "false" on upload.
Coverage
The insurance facts TradeGuard extracts from a COI: policy type, policy number, carrier, effective and expiration dates, and limits. Policy types are general_liability, workers_comp, automobile_liability and umbrella, plus about 50 others brokers type into the certificate’s blank rows, such as professional_liability, pollution_liability and builders_risk (see Other policy types).
A coverage starts as unverified. TradeGuard then verifies the policy directly with the insurance broker, and the coverage moves to active (confirmed in force), expired, canceled, or inactive (superseded by a newer policy). Verification status feeds into compliance results — a requirement can be satisfied on paper but still pending broker confirmation.
Compliance Record & Compliance Run
A compliance record tracks one subcontractor’s status against one requirement. Records are created when a subcontractor is enrolled in a profile (which happens automatically for the default profile when you create the subcontractor), and updated every time a check runs:
A compliance run is one execution of a check — an asynchronous evaluation of a subcontractor against their profile. Runs move through queued → processing → completed, and the finished run contains the overall outcome plus a per-requirement breakdown.
API Keys & Webhooks
The two halves of your integration surface. API keys authenticate your requests and are created in the dashboard. Webhooks push events to your systems — compliance results, status changes, expirations — so you never have to poll. Both are introduced in depth below, in Authentication & API Keys and Webhooks.
Where things are managed
How It Works
The intended end-to-end flow:
- Define your requirements — create a compliance profile with the requirements subcontractors must satisfy, in the dashboard or with one API call (Set up a compliance profile by API), or use your default profile.
- Add subcontractors — create a record for each business you work with, via the API or the dashboard. Each new subcontractor is enrolled in your default profile right away, which creates a compliance record for every requirement and starts a first compliance run.
- Enroll them in other profiles (optional) — only if a subcontractor needs a profile other than your default.
- Collect documents — upload COIs, W-9s, and licenses. TradeGuard validates each file and extracts its contents; insurance documents produce coverage records.
- TradeGuard verifies coverage — extracted insurance coverage is confirmed directly with the broker, moving it from
unverifiedto its true status. - Compliance is evaluated — checks run when you trigger them (and as documents and coverages change), comparing active documents and verified coverages against every requirement. Checks are asynchronous: you get an immediate acknowledgment, then results.
- Your systems stay in sync via webhooks — run results, status changes, and upcoming expirations are pushed to your endpoint as they happen.
Steps 2–7 are the recurring loop of an integration: onboard a subcontractor, collect their documents, and let TradeGuard keep their compliance status current.
Base URL
Every request goes to one host:
Production and the sandbox share this host. Your API key decides which environment you reach: a key created while the dashboard is in Sandbox mode only ever sees sandbox data. All endpoints are under /v1, for example https://api.tradeguardins.com/v1/organizations.
Formats
- Dates and times are ISO 8601 date-times in UTC, such as
2026-12-01T00:00:00Z. Query filters likefromandtoonGET /v1/issuesneed the full date-time; a bare date such as2026-12-01is rejected with400. - Phone numbers are returned in E.164 format (
+14155551234). See Subcontractor for what’s accepted on input. - IDs are UUIDs. A malformed ID returns
400 invalid_identifier.
Authentication & API Keys
Every API request is authenticated with an API key — a secret token scoped to your organization. Keys are created in the dashboard, not through the API, so provisioning credentials stays an explicit, auditable action:
- Log in to the dashboard and open Settings → API Keys.
- Click Create API Key and give it a name (e.g.
Production Integration). - Copy the generated secret and store it somewhere safe.
The secret is shown only once, right after creation. If you lose it, revoke the key and create a new one.
The API Reference also lists /v1/api-keys endpoints. Those are used by the dashboard itself: they need the api_keys:manage scope, which can’t be granted to an API key, so calling them with an API key returns 403.
Requests carry the key as a bearer token:
If you’re exploring from these docs, you don’t need to construct headers at all — open any endpoint in the API Reference and paste your key into the playground’s authorization field. The examples in this guide omit the header for brevity.
Where a request needs your organizationId, find it on the Settings page in the application, or call GET /v1/organizations with your key. Remember that the sandbox has its own organization ID.
Webhooks
Much of what TradeGuard does happens asynchronously — compliance checks run in the background, coverages get verified with brokers over time, and documents expire on their own schedule. Webhooks are how those outcomes reach you: TradeGuard POSTs an event to your endpoint the moment something changes, so your systems react in real time instead of polling.
Events
Every payload has the shape { type, data, timestamp }.
Setting up an endpoint
Webhook endpoints are set up in the dashboard, not through the API. There are no API calls to create, list, change, delete or test an endpoint, and you don’t need any: the dashboard is where you add endpoints, pick events, get signing secrets and send test events. Under the hood, delivery, signing, retries, and logs are handled by Svix, embedded directly in the dashboard.
- In the dashboard, open Settings → Webhooks. (Turn on Sandbox mode first to set up sandbox endpoints; each environment has its own.)
- Click Add Endpoint and enter the URL where you want to receive events (e.g.
https://your-app.com/webhooks/tradeguard). - Select the event types you want to subscribe to.
- After creating the endpoint, open it to reveal its Signing Secret (starts with
whsec_). Use this to verify incoming signatures.
From the same page you can inspect delivery logs, replay failed deliveries, and send test events — no code required.
If you need to open the same portal outside the dashboard, POST /v1/webhooks/portal returns a short-lived link to it. It needs the webhooks:write scope: organization admins have it, and an API key has it only if you grant it.
Verifying signatures
Deliveries are signed by Svix. Each request includes svix-id, svix-timestamp, and svix-signature headers. The simplest and safest way to verify them is with the official Svix libraries, using the endpoint’s signing secret (whsec_...) from the webhook portal:
Step-by-Step Walkthrough
Want copy-paste requests you can run right now? The Quickstart goes from a sandbox key to a verdict and a webhook with nothing but curl.
With an API key and a webhook endpoint in place, here is the core integration loop. Each step links to its section of the API Reference for full request and response details.
1. Look up your compliance profile
Profiles are created in the dashboard or through the API (Set up a compliance profile by API); fetch their IDs via the API. Your organizationId is on the Settings page, or in the response of GET /v1/organizations (use the sandbox organization’s ID with a sandbox key).
See the Compliance Profiles reference — including listing the individual requirements inside a profile.
2. Create a subcontractor
Response (201): the subcontractor record, including its id. If the business is insured under a trade name, send it as dba too (e.g. "dba": "ABC Lighting"): a certificate in either name matches.
The new subcontractor is already enrolled in your default profile: a compliance record exists for each of its requirements and a first compliance run has started. To use a different profile from the start, include complianceProfileId in this request. See the Subcontractors reference.
3. (Optional) Enroll the subcontractor in another profile
Skip this step if the default profile is all you need. To add another profile:
This creates a compliance record for each requirement in the profile and starts a compliance run. Attaching a profile that is already attached is safe: it returns 201 with alreadyAttached: true and changes nothing. The default profile can’t be detached (DELETE returns 400).
4. Upload documents
Upload files as multipart/form-data:
Response (201): the new document, wrapped in data like every other response:
If the exact same file is already on file for this subcontractor, nothing new is created: you get 200 with the existing document instead. If that document had been knocked out by an upload that couldn’t be read, it becomes active again and the response also carries restored: true. If that document’s last read failed (validation_failed or extraction_failed), the re-upload reads it again and the response carries rereading: true.
The document is activated automatically and replaces the previously active document of the same type once it has been read; processing continues in the background (validating → extracting → extracted). Insurance documents produce coverage records that TradeGuard verifies with the broker.
If the file is already hosted somewhere, POST /v1/subcontractors/:subId/documents/url accepts a JSON body with a sourceUrl instead. See the Documents reference.
5. Trigger a compliance check
Response (202):
Checks run asynchronously. You can poll the run with GET /v1/compliance/runs/:runId, but the intended pattern is to wait for the compliance.run_completed webhook:
See the Compliance reference.
6. Monitor ongoing compliance
Compliance isn’t a one-time gate — documents expire and policies get canceled. To stay current:
GET /v1/subcontractors/:subId/compliance— the current status of every requirement.GET /v1/subcontractors/:subId/compliance/runs— the run history.GET /v1/subcontractors/:subId— the full picture: record, documents, coverages, and compliance summary.- Subscribe to
compliance.expiring_soon,compliance.expired, andcoverage.updatedwebhooks to hear about changes the moment they happen.
That’s the loop: onboard subcontractors, collect their documents, and let TradeGuard — and your webhook endpoint — keep their compliance status current.
