# Companies

Manage business accounts (companies / organisations) in the CRM. Canonical path is /companies; the legacy /customers path remains supported. Companies can have multiple contacts linked and roll up to opportunities and activities.

**Base URL:** `https://api.trustpager.com/functions/v1/api/v1`

## Endpoints

### GET /companies

List all companies with cursor-based pagination. Legacy alias: GET /customers.

**Scopes:** `companies:read` — [full detail](./companies/get-companies.md)

### GET /companies/:id

Retrieve a single company by ID. Legacy alias: GET /customers/:id.

**Scopes:** `companies:read` — [full detail](./companies/get-companies-id.md)

### POST /companies

Create a new company. name is required. Set skip_automations: true to suppress the customer_created trigger -- recommended for historical imports. Legacy alias: POST /customers.

**Scopes:** `companies:write` — [full detail](./companies/post-companies.md)

### PATCH /companies/:id

Update an existing company. Only include fields you want to change. Every successful PATCH emits a field-level audit row to crm_field_change_log (viewable at /data/crm-logs with the crm_audit:read scope). Legacy alias: PATCH /customers/:id.

**Scopes:** `companies:write` — [full detail](./companies/patch-companies-id.md)

### DELETE /companies/:id

Delete a company. Legacy alias: DELETE /customers/:id.

**Scopes:** `companies:write` — [full detail](./companies/delete-companies-id.md)

### POST /companies/search

Search companies by name, email, or phone. Legacy alias: POST /customers/search.

**Scopes:** `companies:read` — [full detail](./companies/post-companies-search.md)

### GET /companies/:id/contacts

List all contacts linked to this company. Legacy alias: GET /customers/:id/contacts.

**Scopes:** `companies:read`, `contacts:read` — [full detail](./companies/get-companies-id-contacts.md)

### GET /companies/:id/opportunities

List all opportunities for this company. Legacy alias: GET /customers/:id/deals (also still supported).

**Scopes:** `companies:read`, `opportunities:read` — [full detail](./companies/get-companies-id-opportunities.md)

### GET /companies/:id/activities

List all activities for this company. Legacy alias: GET /customers/:id/activities.

**Scopes:** `companies:read`, `activities:read` — [full detail](./companies/get-companies-id-activities.md)

### POST /companies/bulk-create

Create up to 100 companies in a single request. Built for historical migrations and bulk imports. Set skip_automations: true to suppress customer_created triggers across all records. Returns a created array and an errors array. Legacy alias: POST /customers/bulk-create.

**Scopes:** `companies:write` — [full detail](./companies/post-companies-bulk-create.md)

### POST /companies/bulk-delete

Permanently delete up to 100 companies in a single request. Returns a count of deleted records. Cannot be undone. Legacy alias: POST /customers/bulk-delete.

**Scopes:** `companies:delete` — [full detail](./companies/post-companies-bulk-delete.md)
