---
title: "Generate rows from a custom schema"
method: POST
path: "/schema"
tags: ["schema"]
---

# Generate rows from a custom schema

`POST /schema`

## Request

- Base URL: `https://sampuli.site/api/v1`
- URL: `https://sampuli.site/api/v1/schema`
- Auth: none declared

Mix generic types and country field specs into one row. Per-field `blank` (0–1) makes it null that often.

## Query parameters

- `format` 'json' | 'csv' | 'ndjson' | 'xml'

## Request body

- Schema
  - `count` integer
  - `seed` string
  - `fields` SchemaField[], required
    - `name` string
    - `type` string, required: A generic type ("uuid", "int:0,500") or a country field spec ("ke.phone").
    - `blank` number

## Response `200`

Generated data (JSON array/object/scalar; text for csv/ndjson).

## Other responses

- `400`: Error

---

[API](https://skmtc.dev/sampuli/apis/sampuli-api.md) · [All operations](https://skmtc.dev/sampuli/apis/sampuli-api/llms.txt) · [OpenAPI document](https://skmtc.dev/sampuli/apis/sampuli-api/revisions/55c96e65fa3c?raw)
