---
title: "Bulk Mutate"
method: POST
path: "/v1/workbooks/{workbookId}/flags/bulk-mutate"
tags: ["flags"]
---

# Bulk Mutate

`POST /v1/workbooks/{workbookId}/flags/bulk-mutate`

Performs bulk flag operations on records

## Path parameters

- `workbookId` string, required — Workbook ID

## Headers

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

## Request body

- TypeFlagsBulkMutateFlagsRequest — Request to perform bulk flag operations
  - `operation` 'apply' | 'update' | 'delete' | 'replace', required — The type of flag operation to perform
  - `slug` string, required — The flag slug to operate on
  - `flag` TypeFlagsFlagMutationData — Flag data for mutation operations
    - `label` string — The flag label
    - `colorHex` string — The flag color in hex format
  - `exceptions` string[] — Record IDs to exclude from the operation
  - `query` string — Query string to filter records
  - `filter` unknown
  - `filterField` string — Field to filter on
  - `searchValue` string — Value to search for
  - `searchField` string — Field to search in
  - `q` string — General search query
  - `ids` string[] — Specific record IDs to target
  - `snapshotLabel` string — Label for snapshot before mutation

## Response `200`

Response with status 200

- TypeFlagsBulkMutateFlagsResponse — Response from bulk flag mutation
  - `success` boolean, required — Whether the operation was successfully queued
  - `jobId` string, required — The ID of the job handling the bulk mutation

---

[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/versions/9d3a9979cd96/schema)
