What is API testing?
API testing checks a service through its interface rather than its screens: send a request with a chosen method, headers and body, then verify the status code, the response headers, the body's structure and values, and the time it took. Because it runs below the UI, it is faster, more stable and catches integration defects earlier — which is why regression suites are built API-first.
Read the guide: What is API Testing? How to Test a REST API
How to use API Payload Generator
- Paste a JSON Schema, an OpenAPI/Swagger document (JSON or YAML) or a sample body.
- For OpenAPI input, type the component schema name or "POST /path" to select the body schema.
- Choose how many valid payloads you need and whether to include optional fields and invalid variants.
- Generate, then copy the payload into your test or download the variants as JSON/CSV.
API Payload Generator features
- Generates valid example payloads from a JSON Schema, an OpenAPI request body/component or a sample object
- Respects types, formats, enums, ranges, lengths, patterns, required fields, $ref, allOf/oneOf and example values
- Realistic synthetic values chosen from field names (email, phone, city, price, createdAt…)
- Invalid variants for negative tests, each breaking exactly one rule with the expected API behaviour
- Seeded output for reproducible test data; multiple payloads at once
API Payload Generator example
From a signup schema
Input:
{ "type": "object", "required": ["email", "plan"], "properties": { "email": { "type": "string", "format": "email" }, "age": { "type": "integer", "minimum": 18 }, "plan": { "enum": ["free", "pro"] } } }Output:
{ "email": "test.user157@example.com", "age": 42, "plan": "pro" }
Invalid variants: Missing required "email" · Wrong type at age (string) · Below minimum at age (17) · Invalid enum at plan · Empty body …Frequently asked questions about API Payload Generator
What inputs are accepted?
A JSON Schema, an OpenAPI/Swagger document (JSON or YAML — choose a component schema or a request body such as "POST /users") or a plain sample object, from which a schema is inferred.
Which schema keywords are respected?
type, enum, const, format, pattern (simple patterns), minimum/maximum, multipleOf, minLength/maxLength, minItems/maxItems, uniqueItems, required, properties, additionalProperties, allOf/oneOf/anyOf, $ref, nullable and example/default values.
What are the invalid variants for?
Negative tests: each variant breaks exactly one rule (missing required field, wrong type, out of range, too long, empty, invalid format/enum, null, extra field) and states the response a correct API should return.
Is the output reproducible?
Enter a seed to get the same payloads every time; leave it empty for fresh random values. All values are synthetic test data.
Technical notes
Pattern-constrained strings are sampled by a small regex generator (character classes, quantifiers, simple alternation). Unsupported patterns fall back to name-based values. Generation is deterministic when a seed is given, using the shared seeded PRNG.
References
- RFC 9110: HTTP SemanticsThe meaning of HTTP methods, header fields, status codes and content negotiation, independent of the wire version.
- OpenAPI SpecificationThe standard for describing REST APIs: paths, operations, parameters, schemas, responses and security schemes.
- OWASP Cheat Sheet Series: REST SecuritySecurity rules for REST APIs: HTTPS, authentication on every request, input validation, safe error responses, rate limiting.