API Endpoints

POST /api/generate
Generate Synthetic Data

Generate synthetic data based on the provided schema.

Request Body
Parameter Type Required Description
rows integer Required Number of rows to generate (1-100,000)
format string Optional Output format: json, csv, or sql. Default: json
table_name string Optional Table name for SQL format. Default: synthetic_data
fields array Required Array of field definitions (see below)
Field Object
Property Type Required Description
name string Required Field name (column name)
type string Required Data type (see supported types)
constraints object Optional Type-specific constraints
Example Request
{
  "rows": 100,
  "format": "json",
  "fields": [
    {
      "name": "id",
      "type": "integer",
      "constraints": {"min": 1, "max": 10000}
    },
    {
      "name": "email",
      "type": "email"
    },
    {
      "name": "created_at",
      "type": "date",
      "constraints": {"start": "2024-01-01", "end": "2024-12-31"}
    }
  ]
}
Response
{
  "success": true,
  "data": "[{\"id\": 4521, \"email\": \"john@example.com\", \"created_at\": \"2024-03-15\"}, ...]",
  "rows": 100,
  "format": "json"
}
GET /api/health
Health Check

Check if the API is running and healthy. No authentication required.

Response
{
  "status": "healthy",
  "version": "1.0.0"
}
GET /api/types
List Data Types

Get a list of all supported data types and their constraints. No authentication required.

Response
{
  "types": [
    {"type": "integer", "constraints": ["min", "max"]},
    {"type": "float", "constraints": ["min", "max", "precision"]},
    {"type": "string", "constraints": ["min_length", "max_length"]},
    {"type": "email", "constraints": []},
    {"type": "name", "constraints": []},
    ...
  ]
}