---
title: "redaction.mark: Mark for redaction — PDF kit command — Kition"
description: "Mark content for redaction (nothing is removed until redaction.apply). One of: rect [x0, y0, x1, y1] (points from the top-left of the displayed page) with page; quads (selected text: one mark over its lines, each [x1, y1, x2, y2, x3, y3, x4, y4], the corners upper-left, upper-right, lower-left, lower-right in the same space, as text.select answers its rects and comment.add takes quads) with page; find (text, every match); words (a list of words or phrases, every match of each; the result's matched_words says how many marks each made); pattern (phone, email, credit-card, ssn, date: every match, the Search & Redact patterns); wholePages: true. find, words, pattern and wholePages work on pages (default all). overlay: text shown on the box once applied, or codeSet (foia: U.S. FOIA (b)(1)(A)…(b)(9); privacy-act: U.S. Privacy Act (d)(5), (j)(1)…(k)(7)) with codes, shown as \"(b)(6), (b)(7)(C)\"; fill: box colour (default black). Undoable."
canonical: "https://developer.kition.ai/docs/kits/pdf/commands/redaction.mark"
---

> Canonical HTML: [https://developer.kition.ai/docs/kits/pdf/commands/redaction.mark](https://developer.kition.ai/docs/kits/pdf/commands/redaction.mark)

# redaction.mark

**Mark for redaction.** Mark content for redaction (nothing is removed until redaction.apply). One of: rect [x0, y0, x1, y1] (points from the top-left of the displayed page) with page; quads (selected text: one mark over its lines, each [x1, y1, x2, y2, x3, y3, x4, y4], the corners upper-left, upper-right, lower-left, lower-right in the same space, as text.select answers its rects and comment.add takes quads) with page; find (text, every match); words (a list of words or phrases, every match of each; the result's matched_words says how many marks each made); pattern (phone, email, credit-card, ssn, date: every match, the Search & Redact patterns); wholePages: true. find, words, pattern and wholePages work on pages (default all). overlay: text shown on the box once applied, or codeSet (foia: U.S. FOIA (b)(1)(A)…(b)(9); privacy-act: U.S. Privacy Act (d)(5), (j)(1)…(k)(7)) with codes, shown as "(b)(6), (b)(7)(C)"; fill: box colour (default black). Undoable.

- Kit: PDF 0.1.0 (.pdf); reference: [PDF kit commands](https://developer.kition.ai/docs/kits/pdf.md)
- Changes the document: yes

## Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `author` | `string` | no |  |
| `codeSet` | `"foia" \| "privacy-act"` | no |  |
| `codes` | `string[]` | no | Redaction codes from codeSet, e.g. ["(b)(6)"]. (minItems 1) |
| `fill` | `string` | no | #RRGGBB or a colour name. |
| `find` | `string` | no | (minLength 1) |
| `overlay` | `string` | no |  |
| `page` | `integer` | no | (minimum 1) |
| `pages` | `integer[]` | no | 1-based page numbers to search or mark (default: all). (minItems 1) |
| `pattern` | `"phone" \| "email" \| "credit-card" \| "ssn" \| "date"` | no |  |
| `quads` | `number[][]` | no | (maxItems 4096, minItems 1) |
| `rect` | `number[]` | no | (maxItems 4, minItems 4) |
| `wholePages` | `boolean` | no |  |
| `words` | `string[]` | no | (maxItems 1000, minItems 1) |

## Call through pdf_run

```text
pdf_run {
  "path": "<file>.pdf",
  "steps": [{ "command": "redaction.mark" }]
}
```

The required parameters, with placeholders for their types: not a tested example. Optional: `author`, `codeSet`, `codes`, `fill`, `find`, `overlay`, `page`, `pages`, `pattern`, `quads`, `rect`, `wholePages`, `words`. pdf_run answers the step’s result in `completed[i].result`.

## Result

The kit gives no result schema for this command.

## Parameter schema

```json
{
  "additionalProperties": false,
  "properties": {
    "author": {
      "type": "string"
    },
    "codeSet": {
      "enum": [
        "foia",
        "privacy-act"
      ],
      "type": "string"
    },
    "codes": {
      "description": "Redaction codes from codeSet, e.g. [\"(b)(6)\"]. (minItems 1)",
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "fill": {
      "description": "#RRGGBB or a colour name.",
      "type": "string"
    },
    "find": {
      "description": "(minLength 1)",
      "type": "string"
    },
    "overlay": {
      "type": "string"
    },
    "page": {
      "description": "(minimum 1)",
      "type": "integer"
    },
    "pages": {
      "description": "1-based page numbers to search or mark (default: all). (minItems 1)",
      "items": {
        "description": "(minimum 1)",
        "type": "integer"
      },
      "type": "array"
    },
    "pattern": {
      "enum": [
        "phone",
        "email",
        "credit-card",
        "ssn",
        "date"
      ],
      "type": "string"
    },
    "quads": {
      "description": "(maxItems 4096, minItems 1)",
      "items": {
        "description": "(maxItems 8, minItems 8)",
        "items": {
          "type": "number"
        },
        "type": "array"
      },
      "type": "array"
    },
    "rect": {
      "description": "(maxItems 4, minItems 4)",
      "items": {
        "type": "number"
      },
      "type": "array"
    },
    "wholePages": {
      "type": "boolean"
    },
    "words": {
      "description": "(maxItems 1000, minItems 1)",
      "items": {
        "description": "(minLength 1)",
        "type": "string"
      },
      "type": "array"
    }
  },
  "type": "object"
}
```

Generated from the command list of @kition/pdf-darwin-arm64@0.1.0 and the kit itself (pdf_commands through @kition/cli@0.1.1, built from KitionAI/kition-pdf@b0d2725).
