> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://buildwithfern.com/learn/llms.txt. # Update Document PATCH https://fai.buildwithfern.com/document/{domain}/{document_id} Content-Type: application/json Reference: https://buildwithfern.com/learn/docs/ai-features/ask-fern/api-reference/document/update-document ## Authentication - `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer `, where token is your auth token. ## Servers - `https://fai.buildwithfern.com` (Production, default) - `https://fai-dev.buildwithfern.com` (Development) - `http://localhost:8080` (Local) ## Request ### Path parameters - `domain` (string, required) - `document_id` (string, required) ### Headers - `x-fern-basepath` (string, optional, nullable) — The basepath of the docs site that the document belongs to, e.g. `/plants` for a site served at `docs.example.com/plants`. Omit this for sites served at the root of the domain. Documents are only retrieved by Ask Fern on the site matching the domain and basepath they were created with. ### Body (application/json) This endpoint expects an UpdateDocumentRequest. - `document` (string, optional, nullable) — The updated content of the document that will be returned to Ask Fern during document retrieval. If not provided, this field will remain unchanged. - `chunk` (string, optional, nullable) — The updated textual content that should be vectorized when indexing the document. If not provided, this field will remain unchanged. - `title` (string, optional, nullable) — The updated title of the document. If not provided, this field will remain unchanged. - `url` (string, optional, nullable) — The updated url of the document. If not provided, this field will remain unchanged. - `version` (string, optional, nullable) — The updated version of the document. If not provided, this field will remain unchanged. - `product` (string, optional, nullable) — The updated product of the document. If not provided, this field will remain unchanged. - `keywords` (list of string, optional, nullable) — The updated keywords of the document. If not provided, this field will remain unchanged. - `authed` (boolean, optional, nullable) — The updated authed status of the document. If not provided, this field will remain unchanged. ## Response ### 200 Successful Response - `document` (Document, required) — The updated document ## Errors ### 422 Unprocessable Entity Error Validation Error - `detail` (list of ValidationError, optional) ## Types ### Document - `document_id` (string, required) - `domain` (string, required) - `chunk` (string, required) - `document` (string, required) - `created_at` (datetime, required) - `updated_at` (datetime, required) - `basepath` (string, optional, nullable) - `title` (string, optional, nullable) - `url` (string, optional, nullable) - `version` (string, optional, nullable) - `product` (string, optional, nullable) - `keywords` (list of string, optional, nullable) - `authed` (boolean, optional, nullable) ### ValidationError - `loc` (list of ValidationErrorLocItems, required) - `msg` (string, required) - `type` (string, required) ### ValidationErrorLocItems ## Examples **Request** ```json {} ``` **Response** ```json { "document": { "document_id": "string", "domain": "string", "chunk": "string", "document": "string", "created_at": "2024-01-15T09:30:00Z", "updated_at": "2024-01-15T09:30:00Z", "basepath": "string", "title": "string", "url": "string", "version": "string", "product": "string", "keywords": [ "string" ], "authed": true } } ```