Skip to main content
POST
/
public
/
v1
/
schema-config
/
validate
Validate a schema config
curl --request POST \
  --url https://api.synthbrew.com/api/public/v1/schema-config/validate \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "schema": {
    "entities": [
      {
        "id": "<string>",
        "fields": [
          {
            "id": "<string>",
            "label": "<string>",
            "description": "<string>",
            "nullable": false,
            "generation": {
              "emptyRate": 0,
              "uniqueValues": true
            },
            "minLength": 1,
            "maxLength": 2,
            "min": 123,
            "max": 123,
            "precision": 2,
            "prefix": "<string>",
            "suffix": "<string>",
            "trueRate": 0.5,
            "weekdaysOnly": false,
            "values": [
              "<string>"
            ],
            "weights": [
              123
            ]
          }
        ],
        "label": "<string>",
        "description": "<string>",
        "primaryKey": [
          "<string>"
        ],
        "uniqueKeys": [
          [
            "<string>"
          ]
        ],
        "indexes": [
          {
            "fields": [
              "<string>"
            ],
            "id": "<string>",
            "unique": false
          }
        ],
        "generation": {
          "rowCount": 1,
          "locale": "<string>",
          "timezone": "<string>",
          "seed": "<string>"
        }
      }
    ],
    "metadata": {
      "name": "<string>",
      "description": "<string>",
      "tags": [
        "<string>"
      ]
    },
    "generationDefaults": {
      "rowCount": 1,
      "locale": "<string>",
      "timezone": "<string>",
      "seed": "<string>"
    }
  },
  "schemaConfigVersion": "v1"
}
'
{
  "valid": true,
  "errors": [
    {
      "path": "entities.0.primaryKey.0",
      "message": "Unknown field \"missing_id\" in entity \"orders\" primaryKey"
    }
  ],
  "suggestions": [
    "<string>"
  ],
  "schema": {
    "entities": [
      {
        "id": "<string>",
        "fields": [
          {
            "id": "<string>",
            "label": "<string>",
            "description": "<string>",
            "nullable": false,
            "references": {
              "entity": "<string>",
              "field": "<string>",
              "relation": "many-to-one",
              "pick": "random",
              "onDelete": "restrict",
              "onUpdate": "restrict"
            },
            "generation": {
              "emptyRate": 0,
              "uniqueValues": true,
              "strategy": {}
            },
            "minLength": 1,
            "maxLength": 2,
            "min": 123,
            "max": 123,
            "precision": 2,
            "prefix": "<string>",
            "suffix": "<string>",
            "trueRate": 0.5,
            "weekdaysOnly": false,
            "values": [
              "<string>"
            ],
            "weights": [
              123
            ]
          }
        ],
        "label": "<string>",
        "description": "<string>",
        "primaryKey": [
          "<string>"
        ],
        "uniqueKeys": [
          [
            "<string>"
          ]
        ],
        "indexes": [
          {
            "fields": [
              "<string>"
            ],
            "id": "<string>",
            "unique": false
          }
        ],
        "generation": {
          "rowCount": 1,
          "locale": "<string>",
          "timezone": "<string>",
          "seed": "<string>"
        }
      }
    ],
    "metadata": {
      "name": "<string>",
      "description": "<string>",
      "tags": [
        "<string>"
      ]
    },
    "generationDefaults": {
      "rowCount": 1,
      "locale": "<string>",
      "timezone": "<string>",
      "seed": "<string>"
    }
  }
}

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.

This endpoint validates the frozen public schema config contract, schemaConfigVersion: "v1". The schema payload itself must use formatVersion: 1. Synthbrew may add optional fields, enum values, generation settings, and metadata fields to v1 without a new version. Synthbrew will not remove fields, rename fields, change existing meanings, or make optional fields required without introducing a new contract version.

Authorizations

x-api-key
string
header
required

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

Body

application/json
schema
object
required

Declarative schema config used by schema versions. This is the v1 public contract when paired with schemaConfigVersion="v1" and formatVersion=1.

schemaConfigVersion
enum<string>
default:v1

Frozen public schema config contract version.

Available options:
v1

Response

Validation result

schemaConfigVersion
enum<string>
required
Available options:
v1
valid
boolean
required
errors
object[]
required
suggestions
string[]
required
schema
object

Declarative schema config used by schema versions. This is the v1 public contract when paired with schemaConfigVersion="v1" and formatVersion=1.