Skip to main content
POST
/
v1
/
tenants
/
{tenant_id}
/
data
/
delete
go
rr, err := client.Data.Delete(context.Background(), &v1.DataDeleteRequest{
    TenantId: "t1",
    Metadata: &v1.DataDeleteRequestMetadata{
        SnapToken: "",
    },
    TupleFilter: &v1.TupleFilter{
        Entity: &v1.EntityFilter{
            Type: "organization",
            Ids: []string{"1"},
        },
        Relation: "admin",
        Subject: &v1.SubjectFilter{
            Type: "user",
            Id: []string{"1"},
            Relation: ""
        }
    }
})
client.data.delete({
tenantId: "t1",
metadata: {
snap_token: "",
},
tupleFilter: {
entity: {
type: "organization",
ids: [
"1"
]
},
relation: "admin",
subject: {
type: "user",
ids: [
"1"
],
relation: ""
}
}
}).then((response) => {
// handle response
})
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": {}
}'
{
  "snap_token": "<string>"
}
{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}

Path Parameters

tenant_id
string
required

Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant t1 for this field. Required, and must match the pattern \“[a-zA-Z0-9-,]+\“, max 64 bytes.

Body

application/json

DataDeleteRequest defines the structure of a request to delete data. It includes the tenant_id and filters for selecting tuples and attributes to be deleted.

tuple_filter
object

TupleFilter is used to filter tuples based on the entity, relation and the subject.

attribute_filter
object

AttributeFilter is used to filter attributes based on the entity and attribute names.

Response

A successful response.

DataDeleteResponse defines the structure of the response to a data delete request. It includes a snap_token representing the state of the database after the deletion.

snap_token
string

The snap token to avoid stale cache, see more details on Snap Tokens