Documentation
Sign In

Companies

Create and manage the companies your organization tracks. Companies can be linked to contacts, deals, and invoices.

Required scopes:companies:readcompanies:write

All endpoints require authentication with an API key via Authorization: Bearer anch_... — see Authentication. A :write scope implicitly includes its :read scope.

Quick example

curl https://your-domain.com/api/companies?search=acme \
  -H "Authorization: Bearer anch_your_api_key"

Endpoints

GET/api/companies
POST/api/companies
GET/api/companies/{id}
PATCH/api/companies/{id}
DELETE/api/companies/{id}

GET/api/companies

Returns companies in your organization, paginated.

Query parameters

FieldTypeDescription
searchstringFull-text search across company name and domain
sortBystringname or createdAt (default: name)
sortOrderstringasc or desc
limitintegerPage size (default: 50)
offsetintegerPagination offset (default: 0)

Response (200)

{
  "data": [ { "id": "cmp_...", "name": "Acme Corp", ... } ],
  "meta": { "total": 42, "limit": 50, "offset": 0 }
}

POST/api/companies

Body fields

FieldTypeDescription
namerequiredstringCompany name
domainstringWebsite domain, e.g. acme.com
phonestringPrimary phone number
notesstringFree-form notes

Response (201)

{ "id": "cmp_V1StGXR8Z5jdHi6B" }

GET/api/companies/{id}

Response (200)

{
  "data": {
    "id": "cmp_V1StGXR8Z5jdHi6B",
    "organizationId": "org_4f90...",
    "name": "Acme Corp",
    "domain": "acme.com",
    "phone": "+1 (555) 123-4567",
    "notes": "Key enterprise account",
    "billingEmail": "ap@acme.com",
    "createdAt": 1736899200000,
    "updatedAt": 1736899200000,
    "deletedAt": null
  }
}

PATCH/api/companies/{id}

PUT is also accepted. All fields are optional; only provided fields are updated.

Body fields

FieldTypeDescription
namestringCompany name
domainstringWebsite domain, e.g. acme.com
phonestringPrimary phone number
notesstringFree-form notes
billingContactNamestringBilling contact name
billingAddressLine1stringBilling address line 1
billingAddressLine2stringBilling address line 2
billingCitystringBilling city
billingStatestringBilling state / province
billingPostalCodestringBilling postal code
billingCountrystringBilling country
billingEmailstringBilling email address

Response (200)

{ "ok": true }

DELETE/api/companies/{id}

Companies are soft-deleted and excluded from subsequent list and get requests.

Response (200)

{ "ok": true }

Notes

  • IDs are nanoid strings, not UUIDs.
  • Timestamps are Unix epoch milliseconds.