Documents

Assert a relation

Asserts a typed edge from this document to another in the same project. Asserting the same edge twice is 409: an edge is a fact, and the second assertion is the same fact.

Writing an edge is a write of the asserting document (documents:UpdateDocument); the document it points at is unchanged, which is what lets an agent record what its own report derives from without being able to make another report claim anything.

post/v1/projects/{project_id}/documents/{document_id}/relations

Request

  • Base URL: https://api.naturali.ai
  • URL: https://api.naturali.ai/v1/projects/{project_id}/documents/{document_id}/relations
  • Auth: one of:
    • HTTP bearer
    • OAuth 2 (authorization code, authorization URL https://api.naturali.ai/authorize, token URL https://api.naturali.ai/token, scopes: mcp:access)

Path parameters

document_idstring required
Example:doc_V1StGXR8Z5jdHi6B

Request body

type'derived_from' | 'supersedes' | 'cites' required

What this document claims about the other

to_document_idstring required

The document the edge points at. Must be in the same project, and visible to the caller.

Example request

{
  "type": "cites",
  "to_document_id": "doc_9Kp2mQxZ7bT4rN6W"
}

Response

The asserted relation

idstring
type'derived_from' | 'supersedes' | 'cites'

What the asserting document claims: it was derived_from the other, supersedes it, or cites it.

from_document_idstring

The document that asserts the edge

to_document_idstring

The document the edge points at

created_atstring date-time

Example response

{
  "id": "doc_rel_V1StGXR8Z5jdHi6B",
  "type": "cites",
  "from_document_id": "doc_V1StGXR8Z5jdHi6B",
  "to_document_id": "doc_9Kp2mQxZ7bT4rN6W"
}

Changes

No recorded changes to this operation across all 1 revision of this API.