Create erase

Removes every assertion that names an entity and returns a receipt.

POST /v1/graph/erase

Addresshttps://api.hanzo.ai/v1/graph/erase
MethodPOST
OperationgraphErase
AuthAuthorization: Bearer $HANZO_API_KEY

Removes every assertion that names an entity and returns a receipt.

It requires an admin of the organization it acts in; platform sudo is not enough, so erasure is never cross-tenant. Nothing is removed while a matching assertion is under litigation hold (409) or where the erasure cannot be recorded (503). The audit trail keeps who, when, why, how many and the receipt's digest, never the entity, and holds it before the erasure commits.

Time: erasure is the one act outside the two times. The rows go at every as_of and as_known, so no past read recovers them.

Request

2 fields, body application/json (required).

FieldInTypeRequiredDescription
entitybodystringyesEntity is the key to erase.
reasonbodystringyesReason is why, as the audit trail will keep it — a request number, a legal basis.

Response

StatusBodyMeaning
200graph.graphEraseOutok
defaultproblem-detailsrefused

200 body — 13 fields.

FieldInTypeAlwaysDescription
atbodystring—At is the instant of the erasure, RFC 3339, and the time on its audit record.
bybodystring—By is the identity that erased — owner or owner/user — from the validated principal.
completebodyboolean—Complete is true only when no store may still hold the subject: every store erased or absent and nothing Remaining.
digestbodystring—Digest is SHA-256, hex, over IDs in their ascending order, each written <length>:<id> — the same content address an assertion's own ID is.
entitybodystring—Entity is the key that was erased, folded as every key here is (NFC, no control characters) and echoed so a stored receipt says what it is for.
idsbodystring[]—IDs are the content addresses of the assertions removed, ascending.
remainingbodyinteger (int64)—Remaining is how many assertions still name the entity because one call removes at most ten thousand.
sourcesbodystring[]—Sources are the documents the removed assertions were filed from.
storesbodygraph.graphStore[]—Stores is every store in this deployment that may hold what the org says about the subject, and what happened in each: this graph first, then the stores this op cannot reach.
stores[].detailbodystring—Detail says what an unsupported store is missing before an erasure could reach it.
stores[].removedbodyinteger (int64)—Removed is how many of its rows were removed.
stores[].statusbodystring—Status is erased (rows naming the entity were removed), absent (it held none) or unsupported (this op cannot reach it, so it may still hold the subject).
stores[].storebodystring—Store names it: graph is the caller's own (org, project) assertion file, its full-text index included; knowledge is the org's wiki pages, memories and sources with their vectors; ai.memory is /v1/ai/memory.

Failure carries the platform error shape — see Errors.

Examples

hanzo graph erase
import { Configuration, GraphApi } from 'hanzoai';

const api = new GraphApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.graphErase({ entity: "<entity>", reason: "<reason>" });
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import GraphApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = GraphApi(client).graph_erase(entity="<entity>", reason="<reason>")
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.GraphAPI.GraphErase(context.Background()).Execute()
if err != nil {
	return err
}
use hanzo_client::apis::{configuration::Configuration, graph_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = graph_api::graph_erase(&cfg, Default::default()).await?;
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.GraphApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new GraphApi(client).graphErase();
curl -X POST https://api.hanzo.ai/v1/graph/erase \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "entity": "<entity>",
       "reason": "<reason>"
     }'

Tool graph, op graphErase — POST the JSON-RPC envelope to https://api.hanzo.ai/v1/mcp.

curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "graph",
         "arguments": {
           "op": "graphErase",
           "input": {
             "entity": "<entity>",
             "reason": "<reason>"
           }
         }
       }
     }'

Graph API · All Hanzo APIs · Interactive reference

Was this page useful?