Skip to main content
PATCH /v1/tenants/{tenant_id}/schemas/partial-write The Partial Write endpoint lets you add, update, or remove individual entities and their relations/permissions without rewriting your entire schema. This is useful for incremental schema evolution — for example, adding a new permission to an existing entity type or introducing a new entity.
Use Write Schema to create or fully replace a schema. Use Partial Write to make targeted updates to an existing schema version.

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
partials
map[string, Partials]
A map of entity type names to partial update instructions. Each key is an entity type name (e.g. document, organization). The value describes the additions and removals for that entity.

Response

schema_version
string
The version identifier of the updated schema. Store this and pass it as snap_token context in subsequent requests to read from this exact schema version.

Example

Add a new share permission to an existing document entity without replacing the full schema:
curl --location --request PATCH 'localhost:3476/v1/tenants/{tenant_id}/schemas/partial-write' \
--header 'Content-Type: application/json' \
--data-raw '{
  "metadata": {
    "schema_version": ""
  },
  "partials": {
    "document": {
      "write_permissions": [
        "share = owner or editor"
      ]
    }
  }
}'

Response

{
  "schema_version": "ejh6se5fmal18gpc12d"
}

Notes

Partial Write creates a new schema version — it does not modify an existing version in place. The previous version remains accessible and can still be referenced by its version identifier.
Deleting relations or permissions that are currently referenced by relationship tuples in your data store may cause permission evaluation errors. Ensure your data is consistent before removing schema elements.

Build docs developers (and LLMs) love