---
title: "Upload document to a deal"
method: POST
path: "/deals/documents"
tags: ["Documents"]
---

# Upload document to a deal

`POST /deals/documents`

## Request

- Base URL: `https://app.usehindsight.com/api/v1`
- URL: `https://app.usehindsight.com/api/v1/deals/documents`
- Auth: HTTP bearer

Associate documents with specific deals for win-loss analysis.
Audio and video files are automatically transcribed.
Documents are processed and used to enrich deal insights.

## Request body `multipart/form-data`

- DealDocumentUploadRequest
  - `file_name` string, required: Name of the file
  - `file_url` string, uri: URL to download the file from (provide either file_url or file)
  - `file` string, binary: Binary file content (provide either file or file_url)
  - `content_type` string, required: MIME type of the file
  - `deal_id` string: Hindsight deal ID (provide one of deal_id, salesforce_id, or hubspot_id)
  - `salesforce_id` string: Salesforce Opportunity ID
  - `hubspot_id` string: HubSpot Deal ID
  - `source` 'gong' | 'clari' | 'fathom' | 'fireflies' | 'avoma' | 'outreach' | 'gmail' | 'Salesforce' | 'Hubspot' | 'api': Source application where the document originated

## Response `200`

Document upload initiated

- DocumentUploadResponse
  - `document` object
    - `id` string: Unique identifier for the document
    - `file_name` string: Name of the uploaded file
    - `status` 'processing' | 'ready' | 'failed': Processing status of the document
    - `type` 'asset' | 'intel': Document type
    - `url` string, uri: URL to view the document in Hindsight
    - `created_at` string, date-time: Timestamp when the document was created
  - `run_id` string: ID to track the document processing run

## Other responses

- `400`: Bad request - invalid parameters
- `401`: Unauthorized - invalid or missing API key
- `404`: Deal not found
- `429`: Too many requests - rate limit or applicable usage quota exceeded
- `500`: Internal server error

---

[API](https://skmtc.dev/usehindsight/apis/hindsight-api.md) - [All operations](https://skmtc.dev/usehindsight/apis/hindsight-api/llms.txt) - [OpenAPI document](https://skmtc.dev/usehindsight/apis/hindsight-api/revisions/97371a7da857?raw)
