> ## Documentation Index
> Fetch the complete documentation index at: https://docs.voicemark.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# POST /challenge

> Generate a challenge phrase to prevent replay attacks.

Generates a challenge phrase from VoiceMark's verse corpus. Show this to the user before they record. Prevents replay attacks by ensuring the spoken audio matches the issued phrase.

## Request

`POST /v1/challenge`

**Content-Type:** `application/json`

| Field | Type | Required | Notes |
| - | - | - | - |
| `exclude_phrase` | string | No | Avoid repeating the previous phrase |

## Response

```json theme={null}
{
  "phrase": "Wild roses grew beside the wooden fence.",
  "challenge_id": "ch_7f3d2a1b9c4e",
  "expires_in": 120,
  "source": {
    "author": "...",
    "year": "...",
    "attribution": "..."
  }
}
```

| Field | Description |
| - | - |
| `phrase` | Display this to the user; they must speak it |
| `challenge_id` | Pass to `/v1/verify` to enable anti-replay check |
| `expires_in` | Seconds until the challenge expires (120s) |
| `source` | Attribution for the verse corpus entry |

## Notes

* Challenges expire after 120 seconds. If the user takes longer, request a new challenge.
* Always pair `challenge_id` with `voiceprint_id` in `/v1/verify` for maximum security.
* Phrases are drawn from a verse corpus to ensure natural prosody in spoken audio.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.