> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.tradeguardins.com/api-reference/documents/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.tradeguardins.com/_mcp/server. # Documents Upload and manage the files attached to a subcontractor — certificates, policies, and other proof used to satisfy compliance requirements. Each document belongs to a subcontractor and to your organization, and is tagged with a category. There are three ways to upload a document: 1. **Multipart** — [Upload a document (multipart)](https://docs.tradeguardins.com/api-reference/documents/upload-document) with the bytes in a `file` form field. 2. **From a URL** — [Upload a document from a URL](https://docs.tradeguardins.com/api-reference/documents/upload-document-from-url); TradeGuard downloads `sourceUrl` server-side. 3. **Direct to S3** — [presign](https://docs.tradeguardins.com/api-reference/documents/presign-document-upload) → `PUT` the bytes to the returned URL → [confirm](https://docs.tradeguardins.com/api-reference/documents/confirm-document-upload). All three accept the same categories (`insurance`, `license`, `background_check`, `training_cert`, `tax_form`, `agreement`, `endorsement`, `workers_compensation_exemption`, `safety_policy`) and the same optional `documentType` for the non-insurance ones, the same file types (PDF, PNG, JPEG, WebP, HEIC/HEIF, TIFF) and the same 25 MiB limit, and answer a byte-identical re-upload with `200` and `duplicate: true` instead of creating a second document. Lifecycle: **upload → activate → validation and extraction → used by compliance checks.** Uploads are activated and processed automatically. Only the multipart path can stage a document without making it live (`activate: "false"`); a staged document is not processed until you [activate](https://docs.tradeguardins.com/api-reference/documents/activate-document) it and [run extraction](https://docs.tradeguardins.com/api-reference/documents/extract-document). Only active documents count toward compliance. Endpoints: - [Upload a document (multipart)](https://docs.tradeguardins.com/api-reference/documents/upload-document) - [Upload a document from a URL](https://docs.tradeguardins.com/api-reference/documents/upload-document-from-url) - [Create a presigned upload URL](https://docs.tradeguardins.com/api-reference/documents/presign-document-upload) - [Confirm a presigned upload](https://docs.tradeguardins.com/api-reference/documents/confirm-document-upload) - [List documents for a subcontractor](https://docs.tradeguardins.com/api-reference/documents/list-documents) - [Get a document with download URL](https://docs.tradeguardins.com/api-reference/documents/get-document) - [Delete a document](https://docs.tradeguardins.com/api-reference/documents/delete-document) - [Activate a document](https://docs.tradeguardins.com/api-reference/documents/activate-document) - [Run (or re-run) document extraction](https://docs.tradeguardins.com/api-reference/documents/extract-document) - [Get the current certificate of insurance](https://docs.tradeguardins.com/api-reference/documents/get-certificate-of-insurance) ## API Docs - [List documents for a subcontractor](https://docs.tradeguardins.com/api-reference/documents/list-documents.md): Documents - [Upload a document (multipart)](https://docs.tradeguardins.com/api-reference/documents/upload-document.md): Documents - [Upload a document from a URL](https://docs.tradeguardins.com/api-reference/documents/upload-document-from-url.md): Documents - [Get a document with download URL](https://docs.tradeguardins.com/api-reference/documents/get-document.md): Documents - [Delete or archive a document](https://docs.tradeguardins.com/api-reference/documents/delete-document.md): Documents - [Create a presigned upload URL](https://docs.tradeguardins.com/api-reference/documents/presign-document-upload.md): Documents - [Confirm a presigned upload](https://docs.tradeguardins.com/api-reference/documents/confirm-document-upload.md): Documents - [Get the current certificate of insurance](https://docs.tradeguardins.com/api-reference/documents/get-certificate-of-insurance.md): Documents - [Activate a document](https://docs.tradeguardins.com/api-reference/documents/activate-document.md): Documents - [Run (or re-run) document extraction](https://docs.tradeguardins.com/api-reference/documents/extract-document.md): Documents ## OpenAPI Specification - [OpenAPI JSON](https://docs.tradeguardins.com/openapi.json): raw OpenAPI 3.1 specification for this API, JSON format - [OpenAPI YAML](https://docs.tradeguardins.com/openapi.yaml): raw OpenAPI 3.1 specification for this API, YAML format