Skip to main content
GET
/
api
/
policy
Get policy by ID
curl --request GET \
  --url https://{organization_id}.platform.barndoor.ai/api/policy \
  --header 'Authorization: Bearer <token>'
{
  "policies": [
    {
      "id": "resource.123e4567-e89b-12d3-a456-426614174000.vdefault",
      "apiVersion": "api.cerbos.dev/v1",
      "description": "<string>",
      "disabled": false,
      "resourcePolicy": {
        "resource": "<string>",
        "version": "<string>",
        "scope": "<string>",
        "rules": [
          {
            "name": "allow_all",
            "effect": "EFFECT_ALLOW",
            "actions": [
              "*"
            ],
            "roles": [
              "*"
            ],
            "condition": {
              "match": {
                "all": {
                  "of": [
                    {
                      "expr": "request.resource.attr.channel == \"general\""
                    }
                  ]
                }
              }
            }
          }
        ]
      }
    }
  ]
}

Authorizations

Authorization
string
header
required

JWT token obtained through Auth0 OAuth 2.0 flow with PKCE.

The token should be included in the Authorization header: Authorization: Bearer <your-jwt-token>

Use the Barndoor SDK's loginInteractive() function to obtain tokens automatically.

Query Parameters

id
string
required

The policy ID to retrieve

Response

Policy details

policies
object[]