Skip to content

Templates endpoints

11 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 /templates/

ParameterInTypeRequired
visibilityquerystringNo
categoryquerystringNo
orgIdquerystringNo
Response 200 (application/json)
{
  templates: any[];
} | {
  templates: {
    latestVersion: null | {
      changelog: any;
      createdAt: string (date-time);
      definition: any;
      id: string;
      templateId: string;
      version: string;
    };
    id: string;
    ownerOrgId: null | string;
    name: string;
    slug: string;
    description: null | string;
    visibility: string;
    category: string;
    tags: any;
    icon: null | string;
    createdAt: string (date-time);
    updatedAt: string (date-time);
  }[];
}

POST /templates/

Request body (application/json)
{
  name: string;
  slug: string;
  description?: null | string;
  category: string;
  visibility: "org_private" | "public";
  icon?: null | string;
  tags?: string[];
  orgId: string;
}
Response 200

No body.

Response 201 (application/json)
{
  ok: boolean;
  template: {
    category: string;
    createdAt: string (date-time);
    description: null | string;
    icon: null | string;
    id: string;
    name: string;
    ownerOrgId: null | string;
    slug: string;
    tags: any;
    updatedAt: string (date-time);
    visibility: string;
  };
}

GET /templates/installs

ParameterInTypeRequired
projectIdquerystringYes
envIdquerystringNo
Response 200 (application/json)
{
  installs: any[];
}

POST /templates/from-project/preview

Request body (application/json)
{
  projectId: string;
  envId: string;
  include?: {
    schema: boolean;
    functions: boolean;
    realtime: boolean;
    storage: boolean;
  };
}
Response 200 (application/json)
{
  ok: boolean;
  envName: string;
  summary: {
    includes: {
      schema: boolean;
      functions: boolean;
      realtime: boolean;
      storage: boolean;
    };
    tables: string[];
    functions: {
      name: string;
      runtime: string;
      triggers: number;
      schedule: null | string;
    }[];
    realtimeTables: string[];
    buckets: {
      name: string;
      public: boolean;
    }[];
    secretNames: string[];
    skipped: {
      kind: "column default" | "function" | "table";
      name: string;
      reason: string;
    }[];
  };
}

POST /templates/from-project

Request body (application/json)
{
  projectId: string;
  envId: string;
  include?: {
    schema: boolean;
    functions: boolean;
    realtime: boolean;
    storage: boolean;
  };
  name: string;
  slug: string;
  description?: null | string;
  category: string;
  icon?: null | string;
  tags?: string[];
}
Response 200

No body.

Response 201 (application/json)
{
  ok: boolean;
  template: {
    category: string;
    createdAt: string (date-time);
    description: null | string;
    icon: null | string;
    id: string;
    name: string;
    ownerOrgId: null | string;
    slug: string;
    tags: any;
    updatedAt: string (date-time);
    visibility: string;
  };
  version: {
    id: string;
    version: string;
  };
  summary: {
    includes: {
      schema: boolean;
      functions: boolean;
      realtime: boolean;
      storage: boolean;
    };
    tables: string[];
    functions: {
      name: string;
      runtime: string;
      triggers: number;
      schedule: null | string;
    }[];
    realtimeTables: string[];
    buckets: {
      name: string;
      public: boolean;
    }[];
    secretNames: string[];
    skipped: {
      kind: "column default" | "function" | "table";
      name: string;
      reason: string;
    }[];
  };
}

GET /templates/{slug}

ParameterInTypeRequired
slugpathstringYes
orgIdquerystringNo
visibilityquery"org_private" | "public"No
Response 200 (application/json)
{
  template: {
    category: string;
    createdAt: string (date-time);
    description: null | string;
    icon: null | string;
    id: string;
    name: string;
    ownerOrgId: null | string;
    slug: string;
    tags: any;
    updatedAt: string (date-time);
    visibility: string;
  };
  latestVersion: {
    id: string;
    templateId: string;
    version: string;
    changelog: null | string;
    definition: any;
    createdAt: string (date-time);
  };
}

DELETE /templates/{id}

ParameterInTypeRequired
idpathstringYes
Response 200 (application/json)
{
  ok: boolean;
}

POST /templates/install/preview

Request body (application/json)
{
  orgId: string;
  projectId: string;
  envId?: string;
  templateSlug: string;
  templateVisibility?: "org_private" | "public";
  version?: string;
  allowProduction?: boolean;
  confirmExistingTableTriggers?: boolean;
}
Response 200 (application/json)
{
  ok: boolean;
  template: {
    category: string;
    createdAt: string (date-time);
    description: null | string;
    icon: null | string;
    id: string;
    name: string;
    ownerOrgId: null | string;
    slug: string;
    tags: any;
    updatedAt: string (date-time);
    visibility: string;
  };
  version: {
    id: string;
    templateId: string;
    version: string;
    changelog: null | string;
    definition: any;
    createdAt: string (date-time);
  };
  plan: {
    steps: {
      action: string;
      details?: { [key: string]: any };
    }[];
  };
  warnings: string[];
  tablesToCreate: string[];
  tablesSkipped: string[];
  triggerTablesNeedingConfirmation: string[];
}

POST /templates/install/apply

Request body (application/json)
{
  orgId: string;
  projectId: string;
  envId?: string;
  templateSlug: string;
  templateVisibility?: "org_private" | "public";
  version?: string;
  allowProduction?: boolean;
  confirmExistingTableTriggers?: boolean;
}
Response 200 (application/json)
{
  ok: boolean;
  installId: string;
  status: string;
  appliedSteps: number;
  warnings: string[];
}

POST /templates/install/{installId}/rollback

ParameterInTypeRequired
installIdpathstringYes
Response 200 (application/json)
{
  ok: boolean;
  status: string;
  warnings: string[];
}

POST /templates/create-project

Request body (application/json)
{
  orgId: string;
  projectName: string;
  projectSlug?: string;
  description?: null | string;
  templateSlug: string;
  templateVisibility?: "org_private" | "public";
  version?: string;
  regionKey?: string;
  enabledAddons?: string[];
  frontend?: "backend_only" | "bolt" | "cursor_claude_code" | "hand_written" | "lovable" | "not_yet" | "v0";
}
Response 200 (application/json)
{
  ok: boolean;
  project: {
    createdAt: string (date-time);
    deactivatedAt: null | string (date-time);
    deactivationReason: null | string;
    defaultEnvironment: null | string;
    deletedAt: null | string (date-time);
    description: null | string;
    features: any;
    frontendAnswer: null | "backend_only" | "bolt" | "cursor_claude_code" | "hand_written" | "lovable" | "not_yet" | "v0";
    frontendAnsweredAt: null | string (date-time);
    frontendPromptedAt: null | string (date-time);
    id: string;
    lastActivityAt: string (date-time);
    name: string;
    orgId: string;
    promotionOrder: string[];
    regionKey: null | string;
    sleepWarningSentAt: null | string (date-time);
    sleptAt: null | string (date-time);
    slug: string;
    timezone: null | string;
    updatedAt: string (date-time);
  };
  apiKey: string;
  templateInstall: any;
  quickstart: string;
}