Skip to main content
POST
/
public
/
v1
/
projects
/
{projectId}
/
schemas
Create a schema
curl --request POST \
  --url https://api.synthbrew.com/api/public/v1/projects/{projectId}/schemas \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "name": "Hospital operations",
  "initialVersion": {
    "schema": {
      "formatVersion": 1,
      "metadata": {
        "name": "Hospital operations",
        "description": "Synthetic hospital departments and visits."
      },
      "generationDefaults": {
        "rowCount": 100,
        "locale": "en",
        "timezone": "UTC"
      },
      "entities": [
        {
          "id": "departments",
          "generation": {
            "rowCount": 25
          },
          "fields": [
            {
              "id": "id",
              "type": "uuid"
            },
            {
              "id": "name",
              "type": "enum",
              "values": [
                "Cardiology",
                "Obstetrics",
                "Oncology"
              ],
              "generation": {
                "uniqueValues": true
              }
            }
          ],
          "primaryKey": [
            "id"
          ]
        }
      ]
    }
  }
}
'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "slug": "<string>",
  "name": "<string>",
  "description": "<string>",
  "projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z"
}

Documentation Index

Fetch the complete documentation index at: https://synthbrew.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

x-api-key
string
header
required

Team API key created under /api/api-keys. Prefix: sb_api_.

Path Parameters

projectId
string<uuid>
required

Project UUID in the team associated with the API key.

Body

application/json

Create a schema. Optionally include initialVersion.schema to create the first version in the same request.

name
string
required
initialVersion
object

Optional initial schema version payload.

Response

Schema created

id
string<uuid>
slug
string
name
string
description
string | null
projectId
string<uuid>
createdAt
string<date-time>
updatedAt
string<date-time> | null