RLS

Create RLS Rule

Create an RLS rule on one or more tables using SQL operator and a variable  <b><a target='_blank' href='https://evidence.dev/pricing'>Team Plan and Above</a></b>

post/v1/workspaces/rls

Request

  • Base URL: https://management.evidence.studio
  • URL: https://management.evidence.studio/v1/workspaces/rls
  • Auth: one of:
    • API key in header Authorization
    • API key in cookie wos-session

Request body

namestring required

Name of the RLS rule. Hyphens are stripped from the stored policy name; underscores are preserved.

variableKeystring required

The user attribute key to be used in the RLS policy

operator'=' | '!=' | '>' | '>=' | '<' | '<=' | 'LIKE' | 'ILIKE' | 'NOT LIKE' | 'IN' | 'NOT IN' required

Operator to enforce on the RLS rule

tablesstring[] required
columnstring required

The column to apply the RLS policy on

applyToAllboolean

Apply rule to all users in your org. on creation

isRestrictiveboolean

Restrictive rules are applied cumulatively. For example, a row is available only if it matches both the region AND department filters

Example request

{
  "name": "ae68dcc1713c4c4a8adafcb13364132d",
  "variableKey": "region",
  "tables": [
    "sales_all_regions"
  ],
  "column": "region_name"
}

Response

Data returning...

unknown required

Changes

No recorded changes to this operation across all 1 revision of this API.