← Back to Home

API Reference

Programmatically generate synthetic datasets using the Syntherx API.

Endpoint

POST /datasets/generate

Headers

  • x-api-key (string, required) — Your API key for authentication
  • Content-Type: application/json

Request Body

{
  "blueprint": "string",
  "n_patients": number
}
  • blueprint — Dataset type (e.g., diabetes_hba1c_trial)
  • n_patients — Number of synthetic records to generate

Example Request

curl -X POST https://api.syntherx.com/datasets/generate \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"blueprint":"diabetes_hba1c_trial","n_patients":100}'

Response

{
  "download_url": "string",
  "rows": number,
  "blueprint": "string"
}
  • download_url — Signed S3 URL for secure download
  • rows — Number of generated records
  • blueprint — Dataset type used

Example Response

{
  "download_url": "https://syntherx-datasets.s3.amazonaws.com/...",
  "rows": 100,
  "blueprint": "diabetes_hba1c_trial"
}

Error Handling

  • 401 Unauthorized — Invalid or missing API key
  • 400 Bad Request — Invalid blueprint or input
  • 500 Internal Server Error — Generation failure