Token generate
Try it interactively →POST /api/token-generateGenerate cryptographically random tokens for session IDs, CSRF tokens, API keys, magic-link tokens. Configurable length and encoding (hex, base64url, base64).
Inputs
| Name | Type | Default | Description |
|---|---|---|---|
| length | number (1…4096) | 32 | Token length, in characters of the chosen alphabet. |
| alphabet | enum (urlsafe | hex | alphanum | base64) | "urlsafe" | Output alphabet. |
| count | number (1…1024) | 1 | How many tokens to emit. |
Response
Modes: json. Cache: not cacheable.
Code samples
Built from the single-urlsafe-32 example.
curl -X POST https://api.xtract.bot/api/token-generate \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "X-Account-Id: $XTRACT_ACCOUNT_ID" \
-H "X-Api-Key: $XTRACT_API_KEY" \
-d '{
"length": 32,
"alphabet": "urlsafe",
"count": 1
}'