Skip to content

Row rules endpoints

5 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 /rls/policies/{projectId}

ParameterInTypeRequired
projectIdpathstringYes
Response 200 (application/json)
{
  policies: {
    id: string;
    projectId: string;
    tableName: string;
    name: string;
    operation: string;
    field: string;
    matchClaim: string;
    access: string;
    enabled: boolean;
    createdAt: string (date-time);
    updatedAt: string (date-time);
  }[];
}

POST /rls/policies/{projectId}

ParameterInTypeRequired
projectIdpathstringYes
Request body (application/json)
{
  tableName: string;
  name: string;
  operation: "ALL" | "DELETE" | "INSERT" | "SELECT" | "UPDATE";
  access?: "claim" | "public";
  field?: string;
  matchClaim?: string;
  enabled?: boolean;
}
Response 200

No body.

Response 201 (application/json)
{
  policy: {
    access: string;
    createdAt: string (date-time);
    enabled: boolean;
    field: string;
    id: string;
    matchClaim: string;
    name: string;
    operation: string;
    projectId: string;
    tableName: string;
    updatedAt: string (date-time);
  };
}

PATCH /rls/policies/{policyId}

ParameterInTypeRequired
policyIdpathstringYes
Request body (application/json)
{
  tableName?: string;
  name?: string;
  operation?: "ALL" | "DELETE" | "INSERT" | "SELECT" | "UPDATE";
  access?: "claim" | "public";
  field?: string;
  matchClaim?: string;
  enabled?: boolean;
}
Response 200 (application/json)
{
  policy: {
    id: string;
    projectId: string;
    tableName: string;
    name: string;
    operation: string;
    field: string;
    matchClaim: string;
    access: string;
    enabled: boolean;
    createdAt: string (date-time);
    updatedAt: string (date-time);
  };
}

DELETE /rls/policies/{policyId}

ParameterInTypeRequired
policyIdpathstringYes
Response 200 (application/json)
{
  success: boolean;
}

POST /rls/policies/{policyId}/toggle

ParameterInTypeRequired
policyIdpathstringYes
Response 200 (application/json)
{
  policy: {
    id: string;
    projectId: string;
    tableName: string;
    name: string;
    operation: string;
    field: string;
    matchClaim: string;
    access: string;
    enabled: boolean;
    createdAt: string (date-time);
    updatedAt: string (date-time);
  };
}