PgBeam Docs
Migrations

Lint a migration

POST
/v1/projects/{project_id}/migrations:lint

Analyzes a migration script for unsafe schema changes and returns findings.

Authorization

AuthorizationBearer <token>

JWT issued by Better Auth. Verified via JWKS.

In: header

Path Parameters

project_id*string

Unique project identifier (prefixed, e.g. prj_xxx).

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

A migration script to lint for unsafe schema changes.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/projects/string/migrations:lint" \  -H "Content-Type: application/json" \  -d '{    "sql": "string"  }'
{  "safe": true,  "findings": [    {      "severity": "info",      "rule": "string",      "message": "string",      "statement": "string",      "hint": "string"    }  ]}
{  "error": {    "code": "string",    "message": "string"  }}
{  "error": {    "code": "string",    "message": "string"  }}
{  "error": {    "code": "string",    "message": "string"  }}
{  "error": {    "code": "string",    "message": "string"  }}