Invalidate relation
POST /ontology/v1/relations/{relation_id}/invalidate
Mark a relation as no longer true from a world time, when the mirrored record changed. The relation is kept — invalid_at moves and the relation still reads at an earlier as_of, so history stays answerable. Send an Idempotency-Key header; repeating the same key replays the first result. There is no delete.
Support: supported
Parameters
| Name | Location | Type | Required | Description |
|---|---|---|---|---|
| relation_id | path | string | true | Relation id returned by relations.list, relations.create or a changeset, in the form oed_ followed by 32 lowercase letters or digits; a node id is not accepted. |
| Idempotency-Key | header | string | true | Unique key for this invalidation, at most 255 characters; resend the same key to replay the first result instead of invalidating twice. |
Request body (application/json)
Required: true
| Name | Type | Description |
|---|---|---|
| invalid_at | string | World time the fact stopped being true, in ISO 8601 UTC; reads at an earlier as_of still return the relation. |
| superseded_by | string | Relation id that replaces this one, when a successor was recorded; omit or null when nothing replaced it. |
| reason | string | Why it stopped being true, for people reading the history later; not enforced and safe to omit. |
{ "type": "object", "required": [ "invalid_at" ], "description": "When the fact stopped being true, and optionally what replaced it.", "properties": { "invalid_at": { "type": "string", "format": "date-time", "description": "World time the fact stopped being true, in ISO 8601 UTC; reads at an earlier as_of still return the relation.", "example": "2026-11-01T12:00:00.000Z" }, "superseded_by": { "type": "string", "nullable": true, "description": "Relation id that replaces this one, when a successor was recorded; omit or null when nothing replaced it.", "example": "oed_fedcba9876543210fedcba9876543210" }, "reason": { "type": "string", "description": "Why it stopped being true, for people reading the history later; not enforced and safe to omit.", "example": "李总已换供应商" } }}Response
HTTP 200
The relation after invalidation, with invalid_at set to the given time.
application/json
| Name | Type | Description |
|---|---|---|
| id | string | Relation id, used by invalidation and later reads; treat it as opaque and do not parse it. |
| type | string | Registered relation type this fact was recorded as; it must admit both endpoints. |
| source | string | Node id the fact starts from. |
| target | string | Node id the fact points at. |
| fact | string | The relationship in one sentence, at most 280 characters, as it should be read back. |
| episodes | array<object> | Where this fact was learned, oldest first; each entry names the scope it came from and an optional time range. |
| episodes[].scope | string | Scope the experience belonged to, normally a session id. |
| episodes[].from | string | Start of the period the experience covered, when known; omit for a single moment. |
| episodes[].to | string | End of the period the experience covered, when known; omit for a single moment. |
| origin | string | Where the fact came from; the relation type must list this origin among the ones it accepts. |
| confidence | number | How strongly the fact is held, from 0 to 1; 1 is fully held and lower values fade faster. |
| owner | string | Member id whose content this fact is; null means it is readable organization-wide. Another member's relation reads as not found. |
| valid_at | string | World time the fact became true; null when it was never dated, in which case treat it as true since it was recorded. |
| invalid_at | string | World time the fact stopped being true; null while it still holds. The relation is kept and reads at an earlier as_of. |
| created_at | string | System time the fact was recorded, in ISO 8601 UTC. |
| expired_at | string | System time the fact was judged no longer true, which trails invalid_at; null while it still holds. |
| superseded_by | string | Relation id that replaced this one, when the invalidation named a successor; null when nothing replaced it. |
| archived_at | string | System time the fact was archived out of spreading; null while it still spreads, and reads by time still reach it either way. |