# PATCH /company/crm-settings

**Resource:** [Company](./company.md)  
**Scopes:** `company:write`  
**Write operation:** yes

Partial update of CRM settings. Only include fields you want to change; unspecified fields are left unchanged. All fields are stored in company_settings (NOT companies.crm_settings which no longer exists).

## Parameters

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `opportunity_type_options` | body | string[] | no | Opportunity type dropdown options (e.g. ["New Business", "Upsell", "Renewal", "Referral"]) |
| `account_type_options` | body | string[] | no | Account/company type dropdown options (e.g. ["Client", "Supplier", "Partner", "Referrer"]) |
| `contact_type_options` | body | string[] | no | Contact type dropdown options (e.g. ["Decision Maker", "Influencer", "Champion"]) |
| `transcript_types` | body | string[] | no | Transcript type categories (e.g. ["Sales", "Fulfilment", "Support"]) |
| `transcript_sources` | body | string[] | no | Transcript source options (e.g. ["Zoom", "Loom", "Manual"]) |
| `custom_fields_title` | body | string | no | Custom label for the "Additional Information" section on detail pages |
| `accounts_enabled` | body | boolean | no | Enable/disable the Accounts feature |
| `contacts_enabled` | body | boolean | no | Enable/disable the Contacts feature |
| `enable_work_orders` | body | boolean | no | Enable/disable Work Orders on deals |
| `lead_sources` | body | string[] | no | Available lead source options for deals |
| `lost_reasons` | body | string[] | no | Available reasons when marking a deal lost |
| `won_reasons` | body | string[] | no | Available reasons when marking a deal won |
| `form_completion_notify_emails` | body | string[] | no | Workspace-wide default email addresses notified when any form is completed. Falls back to the sending user if empty. |
| `automation_error_notify_emails` | body | string[] | no | Email addresses notified when an automation action fails. Must be valid email format. Alerts are throttled to one per error signature per hour per company. |
| `automation_error_notify_phones` | body | string[] | no | Phone numbers notified via SMS when an automation action fails. Must be in E.164 format (e.g. +61431377068). Requires an active phone number in the workspace. Alerts are throttled to one per error signature per hour per company. |
| `custom_fields` | body | object | no | Custom field definitions keyed by entity: { deal: [...], account: [...], contact: [...] }. Each field: { id, label, type, options?, show_on_detail, show_in_table, required?, fill_with_ai?, hidden?, conditional_logic? }. Supported types: text, textarea, number, datetime, checkbox, dropdown (requires options[]), url (renders as clickable link with open-in-new-tab icon -- use for Drive folders, portal links, signed agreement URLs).

conditional_logic (optional) -- controls two behaviours on deal fields:

(1) visibility: { mode: "always" \| "when" \| "never", conditions?: [{ field_id, operator: "is" \| "is_not" \| "is_set" \| "is_empty", value? }] } -- hides or shows the field on the detail view based on the values of other fields. Conditions are ANDed.

(2) default_rules: array of { conditions: [...], action } evaluated top-to-bottom on every deal create or update via API, MCP, form submission, or UI field commit; first matching rule wins. Supported actions:
- { type: "today_plus", amount: number, unit: "days"\|"weeks"\|"months", skip_saturday?: boolean, skip_sunday?: boolean } -- writes today + offset as ISO 8601.
- { type: "field_plus", source_field_id: string, amount: number, unit: "days"\|"weeks"\|"months", skip_saturday?: boolean, skip_sunday?: boolean } -- writes source datetime field + offset. No-op if source is empty.
- { type: "constant", value: string\|number\|boolean } -- writes a fixed value.

Rules only write to a field when it is empty or was last set by a rule. Manual edits are never overwritten. Rule-managed status is tracked internally in metadata._rule_managed -- do not set this key manually. |
| `needs_analysis_config` | body | object | no | Discovery/needs-analysis question definitions shown during deal qualification. Structure: { questions: [{ key, label, type, show_on_detail, show_in_table, ai_fill }] }. Pass { questions: [] } to clear all questions. Configurable in Settings > CRM > Needs Analysis. |
| `quick_links` | body | object[] | no | Workspace-wide Quick Link type definitions. Each entry: { id: string (stable UUID you generate), label: string (e.g. "Google Drive"), icon: string }. Valid icons: link, google-drive, dropbox, notion, slack, docs, folder. These define the Quick Link buttons shown in the right-rail sidebar of opportunity, company, and contact detail pages. Per-record URLs are stored in each entity's metadata.quick_links keyed by the type UUID. Pass [] to remove all types. |

---
Base URL: `https://api.trustpager.com/functions/v1/api/v1` — Auth: `Authorization: Bearer YOUR_API_KEY`