---
title: "Assert a relation"
method: POST
path: "/v1/projects/{project_id}/documents/{document_id}/relations"
tags: ["Documents"]
---

# Assert a relation

`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`)

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.

## Path parameters

- `document_id` string, required

## Request body

- object
  - `type` 'derived_from' | 'supersedes' | 'cites', required: What this document claims about the other
  - `to_document_id` string, required: The document the edge points at. Must be in the same project, and visible to the caller.

## Response `201`

The asserted relation

- DocumentRelation: A typed edge one document asserts about another, within one project.
  - `id` string
  - `type` 'derived_from' | 'supersedes' | 'cites': What the asserting document claims: it was `derived_from` the other, `supersedes` it, or `cites` it.
  - `from_document_id` string: The document that asserts the edge
  - `to_document_id` string: The document the edge points at
  - `created_at` string, date-time

## Other responses

- `400`: An undeclared `type`, a `to_document_id` that is not a document id, a document relating to itself, or a target in another project
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Either document was not found
- `409`: That relation is already asserted

---

[API](https://skmtc.dev/naturali/apis/naturali-ai-api.md) · [All operations](https://skmtc.dev/naturali/apis/naturali-ai-api/llms.txt) · [OpenAPI document](https://skmtc.dev/naturali/apis/naturali-ai-api/revisions/e4905b78f422?raw)
