Arke
ReferenceAPI Reference

Permissions

Permission system metadata and introspection

Get your permissions for an entity

GET
/entities/{id}/permissions

Authorization

bearerAuth
AuthorizationBearer <token>

Supabase JWT token

In: header

Path Parameters

id*string

Entity ID (ULID)

Match^(?:II[0-9A-HJKMNP-TV-Z]{24}|[FC][0-9A-HJKMNP-TV-Z]{25}|[0-9A-HJKMNP-TV-Z]{26})$

Response Body

application/json

application/json

application/json

application/json

curl -X GET "https://arke-v1.arke.institute/entities/01KDETYWYWM0MJVKM8DK3AEXPY/permissions"
{
  "entity_id": "01KDETYWYWM0MJVKM8DK3AEXPY",
  "entity_type": "file",
  "allowed_actions": [
    "entity:view",
    "entity:update",
    "file:download"
  ],
  "resolution": {
    "method": "collection",
    "collection_id": "01KDETYWYWM0MJVKM8DK3AEXPY",
    "role": "editor"
  }
}
{
  "error": "Unauthorized: Missing or invalid authentication token"
}
{
  "error": "Forbidden: You do not have permission to perform this action"
}
{
  "error": "Entity not found"
}

Get permission system metadata

GET
/permissions

Response Body

application/json

curl -X GET "https://arke-v1.arke.institute/permissions"
{
  "actions": [
    "entity:view",
    "entity:create",
    "file:download"
  ],
  "verbs": [
    "view",
    "create",
    "update",
    "delete",
    "download"
  ],
  "types": [
    "entity",
    "user",
    "collection",
    "file"
  ],
  "implications": {
    "view": [
      "download"
    ],
    "update": [
      "reupload"
    ]
  },
  "type_hierarchy": {
    "base_type": "entity",
    "description": "string",
    "restrictions": [
      {
        "type": "collection",
        "allowed_verbs": [
          "view"
        ],
        "description": "string"
      }
    ]
  },
  "wildcards": {
    "verb": {
      "pattern": "*:{verb}",
      "example": "*:view",
      "description": "string"
    },
    "type": {
      "pattern": "*:{verb}",
      "example": "*:view",
      "description": "string"
    }
  },
  "restrictions": [
    "collection:* is not allowed - use explicit collection actions"
  ],
  "default_roles": {
    "owner": [
      "*:view",
      "*:update",
      "*:create",
      "collection:manage"
    ],
    "viewer": [
      "*:view"
    ]
  }
}