Skip to main content
POST
/
deals
/
export
curl -X POST https://app.usehindsight.com/api/v1/deals/export \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "columns": ["name", "amount", "deal_status", "proposal_due", "owner_id"]
  }'
{
  "success": true,
  "export_id": "exp_abc123",
  "status": "pending",
  "message": "Export job started successfully",
  "estimated_completion": "2-3 minutes"
}
Bulk export deal data with flexible filtering and column selection. Generates a CSV file for download that includes all specified deal fields and custom properties.
POST https://app.usehindsight.com/api/v1/deals/export
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

Request body:
{
  "columns": ["name", "amount", "deal_status", "proposal_due", ...],  // Array of column IDs to include
  "filters": {                                                          // Optional filters
    "deal_ids": ["deal_123", "deal_456"],                              // Specific deal IDs
    "owner_ids": ["user_abc"],                                         // Deal owner IDs
    "status": ["Won", "Lost"],                                         // Deal stages (Hindsight stage values)
    "close_date": {                                                     // Date range
      "from": "2026-01-01",
      "to": "2026-03-31"
    },
    "amount": {                                                // Deal size range
      "min": 10000,
      "max": 100000
    },
    "competitors": ["comp_123"],                                       // Competitor IDs (any competitor on deal)
    "deal_type": ["New Business", "Expansion"],                        // Deal types
    "region": ["North America", "EMEA"],                               // Regions
    "industry": ["Technology", "Finance"],                             // Industries
    "product_labels": ["Product A"],                                   // Product labels
    "analyzed": true,                                                  // Only analyzed deals
    "verified": true                                                   // Only verified analyses
  }
}

200 Response:
{
  "success": true,
  "export_id": "exp_abc123",
  "status": "pending",
  "message": "Export job started successfully"
}

GET https://app.usehindsight.com/api/v1/deals/export/{export_id}
200 Response:
{
  "export_id": "exp_abc123",
  "status": "completed | pending | failed",
  "download_url": "https://app.usehindsight.com/api/v1/deals/export/exp_abc123/download?token=...",  // Available when status is "completed"
  "rows_exported": 150,
  "created_at": "2026-03-10T12:00:00Z",
  "completed_at": "2026-03-10T12:02:30Z",
  "expires_at": "2026-03-17T12:02:30Z"  // Download URL expires in 7 days
}

Rate limits: Per-minute (10/60/300 req/min for Essentials/Growth/Enterprise) + monthly quota per route.

Overview

The bulk export API allows you to generate CSV files of your deal data with custom column selection and filtering. This is useful for:
  • Creating custom reports for leadership
  • Exporting data for external analysis tools
  • Generating filtered deal lists for specific time periods or segments
  • Backing up deal data

Request Format

Required Fields

ParameterTypeDescription
columnsstring[]Array of column IDs to include in the export. See Available Columns for options.

Optional Filters

All filters are optional. If no filters are provided, all deals in your organization will be exported.

Deal Identification

FilterTypeDescriptionExample
deal_idsstring[]Export specific deals by their Hindsight IDs["deal_123", "deal_456"]

People & Ownership

FilterTypeDescriptionExample
owner_idsstring[]Filter by deal owner IDs["user_abc", "user_xyz"]
collaboratorsstring[]Filter by collaborator IDs["user_def"]

Deal Attributes

FilterTypeDescriptionExample
statusstring[]Deal stages. Values are your CRM’s stage names (e.g. "Won", "Lost")
deal_typestring[]Types of deals["New Business", "Expansion", "Renewal"]
regionstring[]Geographic regions["North America", "EMEA", "APAC"]
industrystring[]Customer industries["Technology", "Healthcare", "Finance"]
product_labelsstring[]Product labels associated with the deal["Product A", "Product B"]
Note on status values: status filters come from your your specific workspace configuration.

Date & Amount Filters

FilterTypeDescriptionExample
close_dateobjectDate range filter{"from": "2026-01-01", "to": "2026-03-31"}
close_date.fromstringStart date (ISO 8601)"2026-01-01"
close_date.tostringEnd date (ISO 8601)"2026-03-31"
amountobjectDeal amount range{"min": 10000, "max": 100000}
amount.minnumberMinimum deal amount10000
amount.maxnumberMaximum deal amount100000

Competitive Intelligence

FilterTypeDescriptionExample
competitorsstring[]Filter by competitor IDs — matches deals where any of the specified competitors appear["comp_123", "comp_456"]
primary_competitorstring[]Filter by competitor IDs — matches deals where the specified competitor is the primary competitor["comp_123"]
has_competitorbooleanOnly deals with any competitor mentionedtrue

Analysis Filters

FilterTypeDescriptionExample
analyzedbooleanOnly include analyzed dealstrue
verifiedbooleanOnly include verified analysestrue

CRM Filters (Advanced)

FilterTypeDescriptionExample
salesforce_filtersobject[]Deal-level Salesforce properties (Opportunity object)See CRM Filters
salesforce_filters_accountobject[]Account-level Salesforce properties (Account object)See CRM Filters
hubspot_filtersobject[]Deal-level HubSpot propertiesSee CRM Filters
hubspot_filters_accountobject[]Account-level HubSpot properties (Company object)See CRM Filters

Filter Type Modifiers

For array-based filters, you can specify how they should be applied:
Filter TypeDescriptionExample
is / is any ofMatches if any value is present (default)Include deals with competitor A OR B
is not / excludeExcludes if any value is presentExclude deals with competitor A or B
include all ofMatches only if all values are presentInclude only deals with BOTH A AND B
To use filter modifiers, append _filter_type to the filter name:
{
  "competitors": ["comp_123", "comp_456"],
  "competitors_filter_type": "include all of"
}
Supported _filter_type suffixes: owner_filter_type, collaborator_filter_type, competitors_filter_type, primary_competitor_filter_type, product_filter_type, status_filter_type, deal_type_filter_type, region_filter_type, industry_filter_type.

Available Columns

Standard Columns

Column IDDescription
nameDeal name
owner_idDeal owner ID
all_competitorsAll competitors involved in the deal
driversWin/loss drivers and reasons
featuresProduct features discussed
scorecardComplete win-loss analysis scorecard (includes all scores and explanations)
deal_statusCurrent deal stage
previous_statusPrevious deal stage
amountDeal value
proposal_dueExpected/actual close date
created_atDeal creation date
deal_analyzedWhether deal has been analyzed
analysis_verifiedWhether analysis has been verified
typeDeal type (New Business, Expansion, Renewal)
regionGeographic region
summaryExecutive summary of the deal
Note: The scorecard column includes all win-loss metrics (product fit, sales execution, relationship, price sensitivity, competitive intensity, customer fit, messaging fit, and messaging accuracy) with both scores and explanations.

Dynamic Columns

These columns are generated based on your workspace configuration and CRM integrations:

CRM Deal Properties

Deal-level custom properties synced from your CRM (Opportunity/Deal object):
  • Format: crm_{property_id}
  • Example: crm_lead_source, crm_sales_rep_region

CRM Account Properties

Account-level properties synced from your CRM:
  • HubSpot format: crm_hubspot_account_{property_id}
  • Salesforce format: crm_salesforce_account_{property_id}
  • Examples: crm_hubspot_account_industry, crm_salesforce_account_annual_revenue

Custom Metrics

Organization-specific metrics you’ve configured. Use the metric’s name (not its internal ID) when specifying columns:
  • Score format: custom_metric_score_{metric_name}
  • Explanation format: custom_metric_explanation_{metric_name}
  • Example: For a custom metric called “Strategic Fit”: custom_metric_score_Strategic Fit or custom_metric_explanation_StrategicFit

Custom Answers

Custom questions you’ve set up for deal analysis. Use the question’s name (not its internal ID):
  • Format: custom_answer_{answer_name}
  • Example: custom_answer_Champion identified or custom_answer_ChampionIdentified for a custom question called “Champion identified”

Response

Initial Response (POST)

When you submit an export request, you’ll receive an export_id and status:
{
  "success": true,
  "export_id": "exp_abc123",
  "status": "pending",
  "message": "Export job started successfully"
}

Checking Export Status (GET)

Poll the export status endpoint to check when your export is ready:
GET /api/v1/deals/export/{export_id}
Response while processing:
{
  "export_id": "exp_abc123",
  "status": "pending",
  "created_at": "2026-03-10T12:00:00Z"
}
Response when complete:
{
  "export_id": "exp_abc123",
  "status": "completed",
  "download_url": "https://app.usehindsight.com/api/v1/deals/export/exp_abc123/download?token=...",
  "rows_exported": 150,
  "created_at": "2026-03-10T12:00:00Z",
  "completed_at": "2026-03-10T12:02:30Z",
  "expires_at": "2026-03-17T12:02:30Z"
}
Response if failed:
{
  "export_id": "exp_abc123",
  "status": "failed",
  "error": "Export failed: Invalid column ID 'invalid_column'",
  "created_at": "2026-03-10T12:00:00Z",
  "failed_at": "2026-03-10T12:01:15Z"
}

Download URL Expiration

  • Download URLs are valid for 7 days after generation
  • After expiration, you’ll need to create a new export request
  • The export record remains accessible via GET for 30 days

CRM Filters

Use CRM filters to filter deals based on properties from your Salesforce or HubSpot integration. Deal-level and account-level properties use separate filter keys:
{
  "salesforce_filters_account": [
    {
      "property": { "id": "Account.Industry", "map_to": "industry" },
      "operator": "is",
      "value": "COMPUTER_SOFTWARE"
    }
  ],
  "salesforce_filters": [
    {
      "property": { "id": "Amount" },
      "operator": "is greater than",
      "value": "50000"
    }
  ]
}
Deal vs. account filters:
Filter keyObject
salesforce_filtersOpportunity (deal-level)
salesforce_filters_accountAccount (account-level)
hubspot_filtersDeal (deal-level)
hubspot_filters_accountCompany (account-level)
The property field is an object, not a string:
{ "property": { "id": "field_name" } }
map_to for standard account properties: Some account properties (like industry or company name) are stored in a dedicated database column rather than the raw CRM payload. These require a map_to field pointing to the column name. Without it, the filter searches the raw CRM JSON and won’t find data for these fields.
{
  "property": {
    "id": "Account.Industry",
    "map_to": "industry"
  }
}
Supported operators:
  • is, is not
  • is greater than, is less than
  • is greater than or equal to, is less than or equal to
  • is before, is after (for dates)
  • contains, does not contain (for text)

Rate Limits

All API routes share a per-minute rate limit and a monthly usage quota. Per-minute limit (shared across all API routes):
PlanRequests per Minute
Essentials10
Growth60
Enterprise300
Monthly quota (per route, resets on the first of each month):
PlanExports per Month
Essentials10,000
Growth30,000
Enterprise100,000
When a limit is exceeded, the API returns a 429 response with X-RateLimit-* and X-Usage-* headers indicating current usage and reset timing.

Examples

curl -X POST https://app.usehindsight.com/api/v1/deals/export \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "columns": ["name", "amount", "deal_status", "proposal_due", "owner_id"]
  }'

Best Practices

  1. Column Selection: Only request columns you need to minimize export size and processing time
  2. Polling Interval: Wait 5-10 seconds between status checks to avoid rate limiting
  3. Download Promptly: Download the file within 7 days before the URL expires
  4. Filter Early: Apply filters to reduce export size rather than filtering after download
  5. Pagination Alternative: For real-time data access, consider using the paginated /deals endpoint instead

Error Responses

Status CodeDescription
400Invalid request (e.g., invalid column ID, malformed filters)
401Invalid or missing API key
403Insufficient permissions
404Export ID not found
429Rate limit exceeded
500Internal server error
Example error response:
{
  "error": "Invalid column IDs: unknown_column, invalid_field",
  "status": 400
}

Authorizations

Authorization
string
header
required

API key from Hindsight dashboard

Body

application/json
columns
string[]
required

Array of column IDs to include in the export

Example:
["name", "amount", "stage", "close_date"]
filters
object

Optional filters to apply

Response

Export job started

success
boolean
Example:

true

export_id
string

Unique export job ID

Example:

"exp_abc123"

status
enum<string>

Initial status is always pending

Available options:
pending
message
string
Example:

"Export job started successfully"

estimated_completion
string
Example:

"2-3 minutes"