Endpoint
Authentication
| Header | Required | Value |
|---|---|---|
X-API-Key | Yes | Your API key (bun_...) |
Content-Type | Yes | application/json |
Overview
Generate batches of mathematically valid CPF (individual taxpayer) or CNPJ (company taxpayer) numbers for use in test environments. All generated documents pass the official checksum algorithm and can optionally be returned with standard formatting masks. These are synthetic numbers for testing only and do not correspond to real individuals or entities.Use cases
- Seed test databases and QA environments with realistic Brazilian document numbers
- Validate form input components in CI pipelines without using real data
- Demonstrate form validation behavior in live demos and prototypes
- Generate fixtures for unit and integration tests
Request body
| Field | Type | Required | Description |
|---|---|---|---|
type | string | No | Document type: "cpf" or "cnpj". Default: "cpf" |
count | integer | No | Number of documents to generate (1–100). Default: 1 |
formatted | boolean | No | Return formatted strings (e.g. "123.456.789-09"). Default: true |
Example
Response
200 OK
| Field | Type | Description |
|---|---|---|
type | string | Document type returned ("cpf" or "cnpj") |
count | integer | Number of documents generated |
documents | array of objects | Each entry has raw (digits only) and formatted (masked string, omitted if formatted: false) |
document | object | First document in the batch — same shape as a documents entry. Shortcut for count: 1 use cases |

