---
title: "Preview a mutation"
method: POST
path: "/jobs/preview-mutation"
tags: ["jobs"]
---

# Preview a mutation

`POST /jobs/preview-mutation`

Preview the results of a mutation

## Headers

- `Authorization` string, required
- `X-Disable-Hooks` 'true', required

## Request body

- TypeJobsMutateJobConfig
  - `sheetId` string, required — Sheet ID
  - `mutateRecord` string, required — A JavaScript function that will be run on each record in the sheet, it should return a mutated record.
  - `mutationId` string — If the mutation was generated through some sort of id-ed process, this links this job and that process.
  - `snapshotLabel` string — If specified, a snapshot will be generated with this label
  - `snapshotId` string — The generated snapshotId will be stored here
  - `filter` 'valid' | 'error' | 'all' | 'none' — Options to filter records
  - `filterField` string — Use this to narrow the valid/error filter results to a specific field
  - `searchValue` string — Search for the given value, returning matching rows. For exact matches, wrap the value in double quotes ("Bob"). To search for null values, send empty double quotes ("")
  - `searchField` string — Use this to narrow the searchValue results to a specific field
  - `q` string
  - `ids` TypeCommonsRecordId[] — The Record Ids param (ids) is a list of record ids that can be passed to several record endpoints allowing the user to identify specific records to INCLUDE in the query, or specific records to EXCLUDE, depending on whether or not filters are being applied. When passing a query param that filters the record dataset, such as 'searchValue', or a 'filter' of 'valid' | 'error' | 'all', the 'ids' param will EXCLUDE those records from the filtered results. For basic queries that do not filter the dataset, passing record ids in the 'ids' param will limit the dataset to INCLUDE just those specific records

## Response `200`

Response with status 200

- TypeRecordsDiffRecordsResponse
  - `data` TypeRecordsDiffRecord[], required — List of DiffRecord objects
    - `id` string, required — Record ID
    - `versionId` string — Version ID
    - `commitId` string — Commit ID
    - `valid` boolean — Auto-generated value based on whether the record contains a field with an error message. Cannot be set via the API.
    - `messages` TypeRecordsValidationMessage[] — This record level `messages` property is deprecated and no longer stored or used. Use the `messages` property on the individual cell values instead. This property will be removed in a future release.
      - `field` string
      - `type` 'error' | 'warn' | 'info'
      - `source` 'required-constraint' | 'unique-constraint' | 'custom-logic' | 'unlinked' | 'invalid-option' | 'is-artifact'
      - `message` string
      - `path` string — A JSONPath string - https://www.rfc-editor.org/rfc/rfc9535
    - `metadata` object
    - `config` TypeRecordsRecordConfig — Configuration of a record or specific fields in the record
      - `readonly` boolean
      - `fields` object
      - `markedForDeletion` boolean
    - `values` TypeRecordsDiffData, required
    - `resolves` TypeDataClipsResolve[]
      - `field` string
      - `type` 'conflict' | 'resolve'
      - `resolveTo` 'clip' | 'main' | 'snapshot'
      - `clip_value_reference` string
      - `main_value_reference` string
      - `removedFromMainResolution` 'ignore' | 'restore'

---

[API](https://skmtc.net/flatfile/apis/api-reference.md) · [All operations](https://skmtc.net/flatfile/apis/api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/flatfile/api-reference/revisions/9d3a9979cd96/schema)
