Skip to main content
GET
http://localhost:3000
/
resource-policies
curl -X GET 'https://api.example.com/resource-policies?scopeId=scope_org' \
  -H 'Authorization: Bearer YOUR_TOKEN'
[
  {
    "id": "policy_0190a1b2-c3d4-7e5f-8a9b-0c1d2e3f4a5b",
    "scopeId": "scope_org",
    "name": "Finance Team Access",
    "description": "Allow finance team to read finance documents",
    "target": {
      "kind": "collection",
      "collectionId": "collection_finance_docs"
    },
    "actions": ["read", "update"],
    "effect": "allow",
    "priority": 50,
    "subjectCondition": {
      "==": [{"var": "subject.meta.department"}, "finance"]
    },
    "createdAt": "2024-01-15T10:30:00Z"
  },
  {
    "id": "policy_0190a1b2-c3d4-7e5f-8a9b-0c1d2e3f4a5c",
    "scopeId": "scope_org",
    "name": "Block Archived",
    "target": {
      "kind": "collection",
      "collectionId": "collection_archived"
    },
    "actions": ["*"],
    "effect": "deny",
    "priority": 100,
    "createdAt": "2024-01-15T11:00:00Z"
  }
]

Query Parameters

scopeId
string
required
ID of the scope to get policies for
resourceId
string
Filter by policies targeting a specific resource
collectionId
string
Filter by policies targeting a specific collection
effect
string
Filter by effect: allow or deny

Response

Returns an array of resource policy objects.
curl -X GET 'https://api.example.com/resource-policies?scopeId=scope_org' \
  -H 'Authorization: Bearer YOUR_TOKEN'
[
  {
    "id": "policy_0190a1b2-c3d4-7e5f-8a9b-0c1d2e3f4a5b",
    "scopeId": "scope_org",
    "name": "Finance Team Access",
    "description": "Allow finance team to read finance documents",
    "target": {
      "kind": "collection",
      "collectionId": "collection_finance_docs"
    },
    "actions": ["read", "update"],
    "effect": "allow",
    "priority": 50,
    "subjectCondition": {
      "==": [{"var": "subject.meta.department"}, "finance"]
    },
    "createdAt": "2024-01-15T10:30:00Z"
  },
  {
    "id": "policy_0190a1b2-c3d4-7e5f-8a9b-0c1d2e3f4a5c",
    "scopeId": "scope_org",
    "name": "Block Archived",
    "target": {
      "kind": "collection",
      "collectionId": "collection_archived"
    },
    "actions": ["*"],
    "effect": "deny",
    "priority": 100,
    "createdAt": "2024-01-15T11:00:00Z"
  }
]