Skip to main content

Companies

The CRM company object. Track accounts with lifecycle stages and tiers, and link contacts to companies with roles.

All endpoints require a Bearer JWT in the Authorization header plus an X-Workspace-Id header selecting the workspace.

GET/api/companiesAuth required

List companies in the workspace with contact counts and open deal value. Supports filtering by tier and lifecycle stage.

Query Parameters

FieldTypeRequiredNote
tierstringNoFilter by tier
lifecycle_stagestringNolead | prospect | customer | partner | churned
searchstringNoMatches name, domain, industry
limitnumberNoDefault 50, max 200
offsetnumberNoDefault 0

Response

{
  "companies": [
    {
      "id": 1,
      "workspace_id": 1,
      "name": "Acme Corp",
      "domain": "acme.com",
      "tier": "A",
      "lifecycle_stage": "customer",
      "contact_count": 4,
      "open_deal_value": 120000,
      "open_deal_cents": 12000000
    }
  ],
  "total": 1
}
POST/api/companiesAuth required

Create a company. Returns 409 if the name already exists, 422 for an unknown lifecycle stage.

Request Body

FieldTypeRequiredNote
namestringYesRequired, unique per workspace
domainstringNo—
websitestringNo—
industrystringNo—
employeesnumberNo—
planstringNo—
tierstringNo—
lifecycle_stagestringNoDefault 'lead'
healthstringNo—
ownerstringNo—
sourcestringNo—
descriptionstringNo—

Response

{
  "id": 2,
  "workspace_id": 1,
  "name": "Globex",
  "lifecycle_stage": "prospect",
  "contact_count": 0,
  "open_deal_value": 0,
  "created_at": "2026-03-28T10:00:00Z"
}
GET/api/companies/{company_id}Auth required

Get a company with its linked contacts and related deals.

Response

{
  "id": 1,
  "name": "Acme Corp",
  "lifecycle_stage": "customer",
  "contacts": [ { "id": 3, "name": "Jane Doe", "link_role": "champion" } ],
  "deals": [ { "id": 7, "title": "Enterprise plan", "value": 120000 } ]
}
PATCH/api/companies/{company_id}Auth required

Update company fields. All fields optional; returns 400 when no fields are provided.

Request Body

FieldTypeRequiredNote
namestringNo—
domainstringNo—
websitestringNo—
industrystringNo—
employeesnumberNo—
planstringNo—
tierstringNo—
lifecycle_stagestringNo—
healthstringNo—
ownerstringNo—
sourcestringNo—
descriptionstringNo—

Response

{
  "id": 1,
  "name": "Acme Corp",
  "tier": "A",
  "lifecycle_stage": "customer"
}
DELETE/api/companies/{company_id}Auth required

Delete a company and unlink all its contacts.

Response

{ "deleted": 1 }
POST/api/companies/{company_id}/linksAuth required

Link a contact to a company with an optional role. Returns 404 if the contact is missing, 409 if already linked.

Request Body

FieldTypeRequiredNote
contact_idnumberYesContact to link
rolestringNoe.g. 'champion', 'billing'

Response

{ "company_id": 1, "contact_id": 3, "role": "champion" }
DELETE/api/companies/{company_id}/links/{contact_id}Auth required

Remove a contact's link to a company.

Response

{ "company_id": 1, "contact_id": 3, "unlinked": true }
GET/api/companies/stats/summaryAuth required

Workspace company counts grouped by lifecycle stage and tier.

Response

{
  "total": 12,
  "by_stage": { "lead": 5, "prospect": 4, "customer": 3 },
  "by_tier": { "A": 2, "B": 6, "ungraded": 4 }
}