{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/secureai-one/json-schema/secureai-one-redact-request-schema.json",
  "title": "RedactRequest",
  "x-generated": "2026-11-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/secureai-one-openapi.json#/components/schemas/RedactRequest",
  "type": "object",
  "required": [
    "text"
  ],
  "properties": {
    "text": {
      "type": "string",
      "maxLength": 200000,
      "description": "The text to redact."
    },
    "map": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "A map from a previous call, so the same person keeps the same stand-in across turns."
    },
    "allow": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Terms to send as written — a shared mailbox, a product name a detector mistakes for a person."
    },
    "profile": {
      "type": "object",
      "description": "The end user's own details, so they are recognised even when written unusually.",
      "properties": {
        "name": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "phone": {
          "type": "string"
        }
      }
    },
    "strict": {
      "type": "boolean",
      "default": false,
      "description": "Refuse the request rather than proceed when the name check cannot decide. Off by default: the structured stages have already run, and refusing costs somebody their answer to protect a name that may not be there. Turn it on when the input is records rather than one person's messages."
    },
    "organisations": {
      "type": "boolean",
      "default": false,
      "description": "Hide the names of companies and other private organisations too, each behind an invented company name. Off by default: a company is usually what the question is about. Public bodies (courts, ministries, EU institutions) stay as written either way."
    },
    "spans": {
      "type": "boolean",
      "default": false,
      "description": "Also return `spans`: where each hidden value was, its kind, and how sure the API is that it was private."
    },
    "risk": {
      "type": "boolean",
      "default": false,
      "description": "Also return `risk`: what is still visible in the cleaned text that could point to one person, scored 0 to 100."
    }
  }
}