Create erase
Removes every assertion that names an entity and returns a receipt.
POST /v1/graph/erase
| Address | https://api.hanzo.ai/v1/graph/erase |
| Method | POST |
| Operation | graphErase |
| Auth | Authorization: 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).
| Field | In | Type | Required | Description |
|---|---|---|---|---|
entity | body | string | yes | Entity is the key to erase. Every assertion ABOUT it and every edge pointing AT it is removed, under every spelling it may have been filed under — its NFC key,… |
reason | body | string | yes | Reason is why, as the audit trail will keep it — a request number, a legal basis. |
Response
| Status | Body | Meaning |
|---|---|---|
200 | graph.graphEraseOut | ok |
default | problem-details | refused |
200 body — 13 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
at | body | string | — | At is the instant of the erasure, RFC 3339, and the time on its audit record. |
by | body | string | — | By is the identity that erased — owner or owner/user — from the validated principal. |
complete | body | boolean | — | Complete is true only when no store may still hold the subject: every store erased or absent and nothing Remaining. |
digest | body | string | — | 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. |
entity | body | string | — | 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. |
ids | body | string[] | — | IDs are the content addresses of the assertions removed, ascending. |
remaining | body | integer (int64) | — | Remaining is how many assertions still name the entity because one call removes at most ten thousand. |
sources | body | string[] | — | Sources are the documents the removed assertions were filed from. |
stores | body | graph.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… |
stores[].detail | body | string | — | Detail says what an unsupported store is missing before an erasure could reach it. |
stores[].removed | body | integer (int64) | — | Removed is how many of its rows were removed. |
stores[].status | body | string | — | 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[].store | body | string | — | 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… |
Failure carries the platform error shape — see Errors.
Examples
hanzo graph eraseimport { 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();The method above is the one at the current release of the document. [email protected] (npm) and [email protected] (PyPI) were generated from an earlier release, where this operation carried a different id, so it spells the method differently — regenerating the clients is what makes the two agree. SDKs →
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>"
}'MCP declares no tool for graph — tools/list on https://api.hanzo.ai/v1/mcp names the products it does reach. Use HTTP or an SDK.
How is this guide?