Skip to content

Research API

All endpoints require authentication and deals tool permissions. Routes are mounted under /api/research.

POST /api/research/run

Triggers a research pipeline to generate a pre-call brief for a deal or company. The pipeline analyses the target’s website/store URL and produces opportunity insights.

Permission: deals:update

Body:

FieldTypeRequiredDescription
entity_typestringYesdeal or company
entity_idstringYesDeal or company ID
store_urlstringNoURL to research. Falls back to company’s website or domain field if omitted.

Response: { brief }

The brief includes the full deal_research_briefs record with brief_content (JSON), status, shopify_detected, and other metadata.

Error responses:

  • 400 — Missing entity_type or entity_id, or invalid entity_type
  • 404 — Deal not found or has no company linked
  • 422 — No URL available or invalid URL

Side effects:

  • Logs history on the deal/company
  • Notifies the deal owner (if different from the triggering user)

GET /api/research/:briefId

Returns a single research brief by ID.

Permission: deals:view

Path parameters:

ParamTypeDescription
briefIdstringBrief ID

Response: { brief }

Error: 404 if brief not found.


GET /api/research/deals/:id/briefs

Returns all research briefs for a deal, ordered by most recent first.

Permission: deals:view

Path parameters:

ParamTypeDescription
idstringDeal ID

Response: { briefs }


GET /api/research/companies/:id/briefs

Returns all research briefs for a company (across all entity types), ordered by most recent first.

Permission: deals:view

Path parameters:

ParamTypeDescription
idstringCompany ID

Response: { briefs }


POST /api/research/:briefId/refresh

Re-runs the research pipeline for an existing brief. Creates a new brief record (preserving history) using the same entity and URL.

Permission: deals:update

Path parameters:

ParamTypeDescription
briefIdstringExisting brief ID to refresh

Response: { brief } — the newly generated brief.

Error: 404 if original brief not found.