Assert what is true of an entity
Assert what is true of an entity
POST /v1/graph
| Address | https://api.hanzo.ai/v1/graph |
| Method | POST |
| Operation | graphAssert |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Assert what is true of an entity
Request
10 fields, body application/json (required).
| Field | In | Type | Required | Description |
|---|---|---|---|---|
assertions | body | graphFact[] | — | Assertions is the batch. Each member is judged on its own: one refusal does not discard the rest, because a caller redelivering five facts must not lose four… |
assertions[].at | body | string | — | At is when the thing was so, RFC 3339. Required, and refused when it sits more than five minutes ahead of the server clock — an assertion dated further out… |
assertions[].confidence | body | number | — | Confidence in [0,1]. |
assertions[].entity | body | string | — | Entity is the thing being described, in the organization's own namespace. It is not created: an entity exists because something was asserted about it. |
assertions[].evidence | body | string | — | Evidence points at the record this claim came from, 512 bytes at most. |
assertions[].names | body | boolean | — | Names says the value is an entity. |
assertions[].relation | body | string | — | Relation is what is being asserted — depends, owner, same, title. |
assertions[].seen | body | string | — | Seen is when this assertion became knowable, RFC 3339. Defaults to At and may not precede it. |
assertions[].source | body | string | — | Source names who asserted. Required, because an assertion nobody is named for cannot be weighed against one that is. |
assertions[].value | body | string | — | Value is what the relation points at. When Names is true it is another entity's key and the assertion is an EDGE; otherwise it is a scalar and the assertion is… |
Response
| Status | Body | Meaning |
|---|---|---|
200 | graphAssertOut | ok |
200 body — 4 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
duplicate | body | integer | — | Duplicate is how many members this plane already held. |
reasons | body | string[] | — | Reasons names why each refused member was refused, in the order sent. |
recorded | body | integer | — | Recorded is how many members became new rows. |
refused | body | integer | — | Refused is how many members were turned away at the door, before the store was touched — a missing entity, a timestamp that is not RFC 3339, a confidence… |
Failure carries the platform error shape — see Errors.
Examples
hanzo has no subcommand for this operation — the CLI serves only what cloud's live route table confirms. Use HTTP or an SDK.
import { Configuration, GraphApi } from 'hanzoai';
const api = new GraphApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.graphAssert({ assertions: [{"at":"<at>","confidence":0,"entity":"<entity>","evidence":"<evidence>"}] });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_assert(assertions=[{"at":"<at>","confidence":0,"entity":"<entity>","evidence":"<evidence>"}])cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.GraphAPI.GraphAssert(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::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_assert(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.GraphApi;
ApiClient client = new ApiClient();
client.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + System.getenv("HANZO_API_KEY")));
var result = new GraphApi(client).graphAssert();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 \
-H "Authorization: Bearer $HANZO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"assertions": [
{
"at": "<at>",
"confidence": 0,
"entity": "<entity>",
"evidence": "<evidence>"
}
]
}'The door 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?