documents

Update document metadata

Changed on

Update document metadata (source_url, description, author, tags, dates, source type).

patch/documents/{document_id}

Request

Path parameters

document_idstring uuid required

Request body

source_urlstring nullable
descriptionstring nullable
authorstring nullable
tagsstring[] nullable
original_datestring nullable

The document's date in ONE POT (ISO 8601): requires pot_id (422 POT_ID_REQUIRED without it, nothing written, v0.7.82.0). It is stored as that POT's own date alone; an empty string clears it and that POT then has none.

effective_fromstring nullable

First day the document takes effect (ISO 8601 date) when that differs from original_date. An empty string clears it.

source_authoritystring nullable

The document's source type (v0.7.75.0): a key that must be an active source type of every POT the document was extracted into (else 422 SOURCE_TYPE_UNKNOWN / SOURCE_TYPE_INACTIVE, nothing written). The document's facts in each of those POTs then move to that type's weight in a repropagation job per POT (source_type_jobs), except the curated and the endorsed, which stay as a person left them. Sending the same type again queues the jobs once more. A document not extracted yet stores the key as sent: an extraction applies it only where it is an active type. It cannot be cleared. With pot_id, only that POT.

pot_idstring uuid nullable

Scopes source_authority and original_date to one POT (v0.7.75.1, dates v0.7.80.0): a document is shared by every POT of the workspace that extracted it, and a correction in one must not move the others. The key must be an active type of that POT only; it is stored as that POT's own type for the document (pot_source_authorities, which wins there) and only that POT's facts move (one job). The date is stored as that POT's own date (pot_original_dates, the only date that POT reads, never the document's original_date, v0.7.82.0; an empty original_date clears it and the POT then has none) and only that POT's facts get their valid_from recomputed. The document's source_authority and original_date and its facts in every other POT are left as they are. 404 POT_NOT_FOUND for a POT not in the workspace, 422 DOCUMENT_NOT_IN_POT for one that does not hold the document. Only with source_authority or original_date (effective_from is the document's alone), and required with original_date (v0.7.82.0: no date is set for every brain at once). Without it, source_authority is every POT's: a POT's own type gives way.

Response

Document updated

facts_revalidatedinteger

Facts of this document whose valid_from was recomputed because original_date or effective_from changed (with pot_id, in that POT only). Dates a person set on a fact are kept.

Changes