Limits and errors
Know the ranges before you write. A page limit above its maximum is clamped to the maximum; any other parameter outside its range is refused rather than quietly clamped to a smaller answer.
Value ranges
| Item | Limit |
|---|---|
name | 200 characters |
description | 500 characters |
A relation’s fact | 280 characters |
Idempotency-Key | 255 characters |
A changeset’s ops | at most 500 operations |
Pagination and page sizes
The list endpoints (GET /ontology/v1/nodes, GET /ontology/v1/relations) take limit from 1 to 100, defaulting to 50; anything above 100 is clamped to 100. They return data with next_cursor: omit cursor for the first page, then pass next_cursor back unchanged until it is null.
The neighborhood read is not a page: depth runs 1–3 (default 1) and limit runs 1–500 (default 200), with no cursor to resume from. Both are refused when out of range, because a clamped answer is smaller than the one you asked for and nothing in the response would say so.
Search takes limit from 1 to 50, defaulting to 20.
Idempotency
Five writes require an Idempotency-Key header: create node, merge node, create relation, invalidate relation and apply changeset. The same key with the same content returns the first result instead of writing again; a missing or blank key answers 400 INVALID_PARAMS. The same key with different content answers 409 ONTOLOGY_CONFLICT — reuse the original request for that key, or send a new key for a different write.
replayed: true in the response means the key had been seen before and nothing changed.
Error codes
Every failure uses one shape, where error.code is the machine-readable category and error.message names the offending field and what to do:
{ "error": { "code": "ONTOLOGY_NODE_NOT_FOUND", "message": "node ond_0123456789abcdef0123456789abcdef does not exist in this organization" }}| Status | Code | Meaning and what to do |
|---|---|---|
| 400 | INVALID_PARAMS | A field, query value, header or id breaks the documented format or range — a missing Idempotency-Key, a direction that is not out/in/both, a non-numeric limit, a depth outside 1–3, an expand that is not relations. Correct the field the message names |
| 400 | ONTOLOGY_TYPE_UNKNOWN | No type of that name is registered for this organization. Read GET /ontology/v1/types for the names in force before writing |
| 404 | ONTOLOGY_NODE_NOT_FOUND | The node does not exist in this organization: never created, or owned by another one. Use GET /ontology/v1/nodes to find an id you can read |
| 404 | ONTOLOGY_EDGE_NOT_FOUND | The relation does not exist in this organization, or its content belongs to another member. Use GET /ontology/v1/relations for the ids you may read |
| 409 | ONTOLOGY_CONFLICT | That idempotency key was already used with different content. Reuse the original request, or send a new key |
| 429 | ONTOLOGY_CAPACITY | This organization’s graph is at its size budget. Invalidate facts that no longer hold to free space, then retry |
| 500 | INTERNAL | The service could not complete the request. Before retrying a write, read the graph back so a partially applied change is not sent twice |
| 501 | NOT_IMPLEMENTED | This type cannot be created at runtime; use a type the platform has already registered (see GET /ontology/v1/types). Nothing was written |
ONTOLOGY_NODE_NOT_FOUND does not distinguish “never existed” from “belongs to another organization”, so it never reveals whether a node you cannot see exists.
Permission
Your API key decides the organization; no organization id appears in any path. A node you may reach but not read comes back in lists and neighborhoods with only id, type, name and restricted: true, so its content stays withheld; relations touching it are left out, so a neighborhood read never reaches further than a single node read. Another member’s relation reads as 404 ONTOLOGY_EDGE_NOT_FOUND.
401 means the API key is missing or invalid; 403 means the key lacks permission for this operation, or carries no organization.
There is no delete
DELETE answers 405 on this face. When a fact stops being true, invalidate it: POST /ontology/v1/relations/{relation_id}/invalidate moves invalid_at to that world time, the relation stays in the graph, and an earlier as_of still reads it. Concepts has the full picture.