# FIELD_CHANGES

field-changes endpoints.

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

## Endpoints

### POST /field-changes/custom-fields/fill

Fill the custom fields of one opportunity, contact or account from what was said on a call, a meeting or a voice agent call linked to it, now. Uses the newest conversation on the record unless transcript_id is given. Only fields in a custom field section that has "Fill from calls and meetings" switched on are written (switch it on with update_crm_settings: custom_field_sections.<deal|contact|account>[].auto_fill = { enabled: true, sources: ["team_call","meeting","voice_agent"], pipeline_ids: [] }). Blank fields are filled; a field the AI filled earlier can be added to or corrected; a field a person set is never changed, and anything different the conversation said is returned in held_back and written to a timeline note instead. Costs credits only when the AI reads the conversation (status "done"); a "skipped" result is free and says why. Also needs write access to that kind of record, and only reads a conversation the key's creator is allowed to open.

**Scopes:** `crm_audit:read`, `ai:use`, `transcripts:read` — [full detail](./field-changes/post-field-changes-custom-fields-fill.md)

### GET /field-changes/custom-fields

The value history of the custom fields on one opportunity, contact or account, newest first: each value a field was set to, when, and who or what set it (a team member, AI reading a call or meeting, a form submission, an automation, an API key or AI connector, or the system). The value before a change is the entry before it. The first time a field that already had a value changes, that earlier value is kept as a baseline entry (is_baseline: true), so the first overwrite can always be undone. Kept 12 months, from 15 November 2026 onward. Sensitive fields record that they changed but not the value. Use field to read one field. Put a value back with restore_custom_field_value.

**Scopes:** `crm_audit:read` — [full detail](./field-changes/get-field-changes-custom-fields.md)

### GET /field-changes

Who changed which fields on a contact, account, opportunity, task or work order, and when. For contacts and accounts, also shows the old and new value of name, email and phone fields (kept 90 days). Each row says what was changed and who did it: a person, an automation, an API key, an AI connector or a system process. Read one record's whole history with record_type + record_id, or read the whole workspace for a time window with since (at most 31 days). Use field to find who changed one field, for example field=email.

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

### GET /field-changes/values

The old and new value of every change to a contact's or account's name, email and phone fields, newest first, with who made the change. Values are kept for 90 days and only for name, email and phone fields (contacts: first and last name, email, alternate emails, phone, landline; accounts: name, email, alternate emails, phone, landline). Use it to answer "what was this contact's email before it was changed?".

**Scopes:** `crm_audit:read` — [full detail](./field-changes/get-field-changes-values.md)

### POST /field-changes/custom-fields/restore

Put one earlier value of a custom field back on an opportunity, contact or account. Pass the id of the history entry to restore, from list_custom_field_history. Only that one field changes, and the restore itself becomes a new history entry. Also needs write access to that kind of record (opportunities:write, contacts:write or companies:write). A Sensitive field cannot be restored because its earlier values are not kept.

**Scopes:** `crm_audit:read` — [full detail](./field-changes/post-field-changes-custom-fields-restore.md)
