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/companiesPOST
/api/companiesGET
/api/companies/{id}PATCH
/api/companies/{id}DELETE
/api/companies/{id}GET/api/companies
Returns companies in your organization, paginated.
Query parameters
| Field | Type | Description |
|---|---|---|
search | string | Full-text search across company name and domain |
sortBy | string | name or createdAt (default: name) |
sortOrder | string | asc or desc |
limit | integer | Page size (default: 50) |
offset | integer | Pagination offset (default: 0) |
Response (200)
{
"data": [ { "id": "cmp_...", "name": "Acme Corp", ... } ],
"meta": { "total": 42, "limit": 50, "offset": 0 }
}POST/api/companies
Body fields
| Field | Type | Description |
|---|---|---|
namerequired | string | Company name |
domain | string | Website domain, e.g. acme.com |
phone | string | Primary phone number |
notes | string | Free-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
| Field | Type | Description |
|---|---|---|
name | string | Company name |
domain | string | Website domain, e.g. acme.com |
phone | string | Primary phone number |
notes | string | Free-form notes |
billingContactName | string | Billing contact name |
billingAddressLine1 | string | Billing address line 1 |
billingAddressLine2 | string | Billing address line 2 |
billingCity | string | Billing city |
billingState | string | Billing state / province |
billingPostalCode | string | Billing postal code |
billingCountry | string | Billing country |
billingEmail | string | Billing 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.