Skip to main content
POST /v1/tenants/{tenant_id}/data/delete The Delete Data endpoint removes relationship tuples and/or attributes that match the provided filters. Use tuple_filter to target relationships, attribute_filter to target attributes, or supply both to delete across both stores in a single request. The response includes a snap_token representing the database state after the deletion.

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

tuple_filter
object
required
Filter that selects the relationship tuples to delete.
attribute_filter
object
required
Filter that selects the attributes to delete.

Response

snap_token
string
A token representing the database state after the deletion. Use in subsequent requests for consistent reads.

Example

curl --location --request POST 'localhost:3476/v1/tenants/{tenant_id}/data/delete' \
--header 'Content-Type: application/json' \
--data-raw '{
  "tuple_filter": {
    "entity": {
      "type": "organization",
      "ids": ["1"]
    },
    "relation": "admin",
    "subject": {
      "type": "user",
      "ids": ["1"],
      "relation": ""
    }
  },
  "attribute_filter": {}
}'
Request body
{
  "tuple_filter": {
    "entity": {
      "type": "organization",
      "ids": ["1"]
    },
    "relation": "admin",
    "subject": {
      "type": "user",
      "ids": ["1"],
      "relation": ""
    }
  },
  "attribute_filter": {}
}
Response
{
  "snap_token": "GzIic5DsMAd="
}

Error Codes

HTTP StatusDescription
400Bad request — invalid filter fields
401Unauthorized
404Tenant not found
429Rate limit exceeded
500Internal server error

Build docs developers (and LLMs) love