Skip to content

Schema deployments endpoints

10 endpoints at https://api.vaif.studio, generated from the API's OpenAPI document. The REST API page covers authentication, and All endpoints lists every group.

GET /deployments/project/{projectId}

ParameterInTypeRequired
projectIdpathstringYes
envquerystringNo
limitquerystringNo
offsetquerystringNo
Response 200 (application/json)
{
  deployments: {
    id: any;
    projectId: any;
    envId: any;
    version: any;
    status: any;
    triggeredBy: any;
    summary: any;
    createdAt: any;
    appliedAt: any;
  }[];
  total: number;
  limit: number;
  offset: number;
}

GET /deployments/project/{projectId}/stats

ParameterInTypeRequired
projectIdpathstringYes
Response 200 (application/json)
{
  total: number;
  applied: number;
  failed: number;
  inProgress: number;
  successRate: null | number;
  avgBuildMs: null | number;
  latestAt: null | string;
  byEnv: {
    [key: string]: {
      total: number;
      applied: number;
      failed: number;
    };
  };
}

GET /deployments/{deploymentId}

ParameterInTypeRequired
deploymentIdpathstringYes
Response 200 (application/json)
{
  deployment: {
    id: any;
    projectId: any;
    envId: any;
    version: any;
    status: any;
    triggeredBy: any;
    summary: any;
    createdAt: any;
    appliedAt: any;
  };
  steps: {
    id: any;
    deploymentId: any;
    stepName: any;
    status: any;
    durationMs: null | number;
    errorMessage: null | string;
    createdAt: any;
  }[];
}

GET /deployments/{deploymentId}/steps

ParameterInTypeRequired
deploymentIdpathstringYes
Response 200 (application/json)
{
  steps: {
    id: any;
    deploymentId: any;
    stepName: any;
    status: any;
    durationMs: null | number;
    errorMessage: null | string;
    createdAt: any;
  }[];
}

POST /deployments/{deploymentId}/rollback

ParameterInTypeRequired
deploymentIdpathstringYes
Response 200 (application/json)
{
  ok: boolean;
  status: string;
}

POST /deployments/promote

Request body (application/json, required)
{
  projectId: string (uuid);
  fromEnv: string;
  toEnv: string;
  confirmSkip?: string;
  allowProduction?: boolean;
}
Response 200 (application/json)
{
  ok: boolean;
  deploymentId: any;
  status: string;
}

POST /deployments/trigger

Request body (application/json)
{
  projectId: string;
  env: string;
  schemaDefinition: {
    schemaVersion: "1.0";
    tables: {
      name: string;
      columns: {
        name: any;
        type: any;
        primaryKey?: any;
        unique?: any;
        nullable?: any;
        default?: any;
        references?: any;
      }[];
      indexes?: any[];
      unique?: any[];
      publicRead?: boolean;
      ownerColumn?: string;
    }[];
  };
  migrationName?: string;
}
Response 200 (application/json)
{
  ok: boolean;
  deploymentId: any;
  status: string;
}

GET /deployments/tokens/project/{projectId}

List deployment tokens for a project

ParameterInTypeRequired
projectIdpathstring (uuid)Yes
envIdquerystringNo
Response 200 (application/json)
{
  tokens: {
    id: string;
    envId: string;
    scope: "schema" | "services";
    serviceNames: string[] | null;
    createdAt: string | string (date-time);
    revokedAt: string | string (date-time);
    expiresAt: string | string (date-time);
  }[];
}

Errors: 401, 403, with the error body.

POST /deployments/tokens

Create a deployment token

Request body (application/json, required)
{
  projectId: string (uuid);
  envId: string (uuid);
  scope?: "schema" | "services";
  serviceNames?: string[];
  expiresInDays?: 30 | 90 | 365;
}
Response 200 (application/json)
{
  ok: true;
  token: string;
  id: string;
  expiresAt: string | null;
}

Errors: 400, 401, 403, with the error body.

POST /deployments/tokens/{tokenId}/revoke

Revoke a deployment token

ParameterInTypeRequired
tokenIdpathstring (uuid)Yes
Response 200 (application/json)
{
  ok: true;
}

Errors: 401, 403, 404, with the error body.