Skip to main content

Endpoints

Relationship wire format

REST writes accept a complete Rel record. The endpoints are string record IDs under in (subject) and out (object); the predicate is rel_type. These field names differ from the convenience MCP relate_entities tool. The source and target entities must already exist in the caller’s space. Use a fresh relationship ID and timestamps, and labels appropriate to your policy.
relationship.json
Optional fields include validity_window, temporal_audit, subjects, and subjects_state. Relationship status values are candidate, approved, superseded, and disputed. REST does not translate top-level weight, description, or evidence_text into these record fields.

Create, read, update, and delete

Save the example as relationship.json, after creating the referenced entities:
Creation returns 201 and the full stored relationship. GET by ID returns the same record shape and accepts include_deleted=true. The caller’s principal controls space and record access. To update, read the existing record, change its fields, and send the complete record to PUT /v1/relationships/{id}. Keep the body ID consistent with the path. This is a replacement, not a partial patch. Write authorization applies to both the old and replacement record. DELETE soft deletes the relationship and returns 204. POST to its /restore route restores it and returns the record.

Upsert and batch

POST /v1/relationships/upsert accepts the same full record and creates or updates by its supplied ID. The supplied space_id must match the principal’s space. POST /v1/relationships/batch accepts {"items": [...]} containing full records. The response has succeeded records and failed entries with an original index and error. Each item is processed independently. Although the shared request schema accepts atomic, transactional batches are not implemented.
The search accepts rel_type, include_deleted (default false), limit (default 50), and cursor. Results are authorized within the caller’s space. The response contains results (full relationship records), cursor, has_more, and total. Pass the returned cursor unchanged when requesting another page. To find relationships attached to a specific entity, use GET /v1/entities/{id}/with-relations.