# Redacting sensitive data (/docs/redacting-sensitive-data)

When a call reads out a one-time verification code, a temporary door PIN, a pickup code or another confidential value, you usually want the person to **hear** it without keeping that value in your call history.

Wrap any sensitive part of `message` (or an option's `reply`) in **double square brackets**: `[[...]]`.

```bash tab="curl"
curl https://api.callhuman.es/v1/calls \
  -H "Authorization: Bearer $CALLHUMAN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "+14155552671",
    "message": "Your verification code is [[4 8 2 9]]. Again, [[4 8 2 9]]."
  }'
```

```js tab="JavaScript"
const spaced = code.split("").join(" "); // "4829" → "4 8 2 9"

await fetch("https://api.callhuman.es/v1/calls", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.CALLHUMAN_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    to: "+14155552671",
    message: `Your verification code is [[${spaced}]]. Again, [[${spaced}]].`,
  }),
});
```

```python tab="Python"
import os
import requests

spaced = " ".join(code)  # "4829" -> "4 8 2 9"

requests.post(
    "https://api.callhuman.es/v1/calls",
    headers={"Authorization": f"Bearer {os.environ['CALLHUMAN_API_KEY']}"},
    json={
        "to": "+14155552671",
        "message": f"Your verification code is [[{spaced}]]. Again, [[{spaced}]].",
    },
)
```

## What they hear vs. what is stored [#what-they-hear-vs-what-is-stored]

The person hears the real message naturally — the `[[` and `]]` delimiters are never spoken. Your dashboard and call logs never store the sensitive value; it is replaced with a fixed `[[REDACTED]]` token and displayed as blurred text.

<CallTranscript title="What the person hears on the phone" lines={[{"from":"callhuman","kind":"message","text":"Your verification code is 4 8 2 9. Again, 4 8 2 9."}]} />

<CallTranscript title="What is stored in your call log" lines={[{"from":"callhuman","kind":"message","text":"Your verification code is [[REDACTED]]. Again, [[REDACTED]]."}]} />

## Works in option replies too [#works-in-option-replies-too]

You can also use `[[...]]` inside any option's `reply` (including inside submenus) — useful when you only reveal a PIN, pickup code or access code after the person confirms:

```json
{
  "to": "+34600111222",
  "message": "Hi! Your pharmacy order is ready at the 24-hour locker.",
  "options": [
    {
      "id": "get_pin",
      "label": "Hear pickup PIN",
      "reply": "Your locker PIN is [[7 3 9 1]]. Again, [[7 3 9 1]]."
    },
    {
      "id": "later",
      "label": "Call me later",
      "reply": "No problem, you can collect it anytime today."
    }
  ]
}
```

If the person chooses **Hear pickup PIN**, they hear `"Your locker PIN is 7 3 9 1. Again, 7 3 9 1."`, while your dashboard stores `"Your locker PIN is [[REDACTED]]. Again, [[REDACTED]]."`.

## How it works under the hood [#how-it-works-under-the-hood]

| Stage | What happens to `[[...]]` content |
|---|---|
| **Speech (TTS)** | Delimiters are stripped; the person hears the real text normally. |
| **Anti-spam check** | Evaluated on the **full real text** (including text inside `[[...]]`) before dialing, so markers cannot be used to hide spam or promotional content. Only the redacted version is written to moderation logs. |
| **Plan character limit** | Counted on the spoken text only — the `[[` and `]]` characters do **not** consume your plan's character allowance. |
| **Call logs & dashboard** | Stored **only** in redacted form (`[[REDACTED]]`) from the moment the call is created. Neither your team nor CallHuman's review queue sees the secret. |
| **While the call is active** | Because the call may ring or retry before being answered, the clean spoken text is held temporarily in an isolated internal field (inaccessible to dashboard or API clients) and **permanently wiped to `null`** the instant the call finishes (`answered`, `not_answered`, `failed` or `canceled`). |

<Callout type="info" title="Anti-spam still checks the full message">
Wrapping promotional or suspicious wording in `[[...]]` will not bypass [allowed-call checks](/docs/allowed-use). The classifier inspects the exact words the recipient will hear, then immediately discards the unredacted text from its log.
</Callout>

## Rules and edge cases [#rules-and-edge-cases]

- **Multiple values:** Use as many `[[...]]` blocks as you need in the same message (`"Code [[4 8 2 9]] for account [[3041]]"`).
- **Inner spacing:** Extra spaces right inside the brackets are trimmed automatically (`[[ 4 8 2 9 ]]` is spoken as `"4 8 2 9"`).
- **Where it applies:** Supported in `message` and every option's `reply`. Not applied to `options[].label`, because labels are short menu choices returned as `option_label` in API responses and webhooks.
- **Unclosed brackets:** A lone `[[` without a matching `]]` is left untouched and spoken literally.
- **Empty markers:** `[[]]` or `[[   ]]` produces nothing. If a `message` or `reply` contains only empty markers, the request is rejected with `422 invalid_request`.
- **Keep secrets out of `metadata`:** `metadata` is returned unchanged in `GET /v1/calls/{id}` and webhooks — pass an internal reference ID instead of sensitive values.