Skip to main content
POST /v1/tenants/{tenant_id}/schemas/read Returns the full SchemaDefinition for the requested schema version. If no version is specified in the metadata, the latest (head) schema is returned. Schema versions are produced by the Write Schema endpoint and can be listed with the List Schema endpoint.

Path Parameters

tenant_id
string
required
The tenant identifier. Use t1 for single-tenant deployments. Must match ^([a-zA-Z0-9_\-@\.:+]{1,128}|\*)$.

Request Body

metadata
object
required

Response

schema
object
The SchemaDefinition object representing the authorization model, including all entity definitions, relations, attributes, and actions.

Example

curl --location --request POST 'localhost:3476/v1/tenants/{tenant_id}/schemas/read' \
--header 'Content-Type: application/json' \
--data-raw '{
    "metadata": {
        "schema_version": "cnbe6se5fmal18gpc66g"
    }
}'
Request body
{
  "metadata": {
    "schema_version": "cnbe6se5fmal18gpc66g"
  }
}
Response
{
  "schema": {
    "entity_definitions": {
      "user": {},
      "organization": {
        "relations": {
          "admin": { "references": [{ "type": "user" }] },
          "member": { "references": [{ "type": "user" }] }
        },
        "actions": {
          "create_repository": "...",
          "delete": "..."
        }
      },
      "repository": {
        "relations": {
          "owner": { "references": [{ "type": "user" }] },
          "parent": { "references": [{ "type": "organization" }] }
        },
        "actions": {
          "push": "...",
          "read": "...",
          "delete": "..."
        }
      }
    }
  }
}

Error Codes

HTTP StatusDescription
400Bad request — invalid metadata
401Unauthorized
404Tenant or schema version not found
429Rate limit exceeded
500Internal server error

Build docs developers (and LLMs) love