# Company

View and manage company settings, users, and CRM configuration.

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

## Endpoints

### GET /company

Retrieve company details including slug for public-facing URLs.

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

### PATCH /company

Update company settings. Writable fields include: name, slug, description, contact_name, contact_email, phone, logo_url, primary_color, secondary_color, address, timezone, industry, website_url, abn. (The workspace from-address — formerly exposed as email_handle — is now managed via the email_config endpoints.)

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

### GET /company/users

List all team members. Returns membership role, status, and workspace-enriched profile fields (full_name, email, phone, job_title, department). Workspace-scoped fields from company_user_settings take priority over global user profile values.

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

### GET /company/users/:userId

Get a single team member with workspace-enriched profile. Returns membership role, status, and profile fields overlaid with any workspace-scoped overrides from company_user_settings.

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

### POST /company/users/invite

Invite a user to the company. They receive an invitation email.

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

### GET /company/users/:userId/personal-user-profile

Get the global (platform-wide) identity record for a team member from the users table -- full_name, email, phone, avatar_url, status, job_title, department, created_at. Returns 404 if the user is not a member of this workspace.

**Scopes:** `users:read` — [full detail](./company/get-company-users-userId-personal-user-profile.md)

### GET /company/users/:userId/workspace-user-profile

Get workspace-scoped contact info for a team member from company_user_settings -- phone, job_title, department. Returns null values if not set. These fields take priority over the global profile when displayed in the platform.

**Scopes:** `users:read` — [full detail](./company/get-company-users-userId-workspace-user-profile.md)

### PATCH /company/users/:userId/workspace-user-profile

Set workspace-scoped contact info for a team member. Accepts phone, job_title, department. Values are stored in company_user_settings and take priority over the global user profile within this workspace.

**Scopes:** `users:write` — [full detail](./company/patch-company-users-userId-workspace-user-profile.md)

### GET /company/users/:userId/workspace-user-connections

Get the integrations a team member has shared with this workspace -- Gmail, calendar sync, etc. Returns an array of connection objects with platform_type, platform_account_name, status, calendar_synced, and gmail_aliases.

**Scopes:** `users:read` — [full detail](./company/get-company-users-userId-workspace-user-connections.md)

### GET /company/users/:userId/workspace-user-roles

Get the company role and join date for a team member. Returns role (client_admin, client_editor, or client_viewer) and created_at.

**Scopes:** `users:read` — [full detail](./company/get-company-users-userId-workspace-user-roles.md)

### PATCH /company/users/:userId/workspace-user-roles

Change a team member's workspace role. Valid values: client_admin (full access), client_editor (edit access), client_viewer (read-only).

**Scopes:** `users:write` — [full detail](./company/patch-company-users-userId-workspace-user-roles.md)

### GET /company/users/:userId/workspace-user-preferences

Get workspace-level preferences for a team member. Currently returns default_pipeline_id (the pipeline shown by default when they open the CRM). Returns null if not set.

**Scopes:** `users:read` — [full detail](./company/get-company-users-userId-workspace-user-preferences.md)

### PATCH /company/users/:userId/workspace-user-preferences

Set workspace-level preferences for a team member. Accepted field: default_pipeline_id (UUID of the pipeline to show by default, or null to clear).

**Scopes:** `users:write` — [full detail](./company/patch-company-users-userId-workspace-user-preferences.md)

### DELETE /company/users/:userId

Remove a user from the company -- revoke their access permanently.

**Scopes:** `users:delete` — [full detail](./company/delete-company-users-userId.md)

### GET /company/crm-settings

Get CRM settings including custom field definitions, lead sources, lost/won reasons, type option lists (opportunity, account, contact), transcript settings, feature toggles (accounts_enabled, contacts_enabled, enable_work_orders), form_completion_notify_emails, automation_error_notify_emails, and automation_error_notify_phones. All fields are stored in the company_settings table.

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

### PATCH /company/crm-settings

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).

**Scopes:** `company:write` — [full detail](./company/patch-company-crm-settings.md)

### GET /company/birthday-messages

Get the birthday message configuration -- array of templates used by the birthday cron to send automated birthday emails and SMS to contacts.

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

### PUT /company/birthday-messages

Replace the entire birthday messages array. Send an array of message objects -- one per year of relationship. The cron picks the entry matching the contact's year count (Year 1 on first birthday, etc.). Supported merge tags: {first_name}, {last_name}, {company_name}, {age}.

**Scopes:** `company:write` — [full detail](./company/put-company-birthday-messages.md)

### GET /company/settings/tag-palette

Get the company-wide tag palette -- the list of pre-defined tags shown as quick-picks in the Add Tag modal on opportunity cards. Returns an array of {name, color} objects stored in company_settings.deal_tag_options.

**Scopes:** `company:read` — [full detail](./company/get-company-settings-tag-palette.md)

### PATCH /company/settings/tag-palette

Replace the company-wide tag palette. Accepts an array of {name, color} objects directly (or wrapped in a "tags" key). Duplicates with the same name (case-insensitive) are deduplicated -- last entry wins. Replaces the entire palette.

**Scopes:** `company:write` — [full detail](./company/patch-company-settings-tag-palette.md)
