Skip to main content
PATCH
Updates a document attached to a project. Send any combination of name, language, and url; fields you leave out are unchanged. Sending url replaces the document’s content, while the document keeps its ID. Only documents attached to the project itself can be updated. A folder document listed for the project (its folderId is set) returns 400: change it through the folder document endpoints, or remove it from this project.
Orders created before the update keep the guidance they were already processed with. The update affects work that runs after it.

Authorizations

This endpoint requires API key authentication. Include your API key in the request header:
  • Header name: X-Api-Key
  • Header value: Your API key from the Ollang dashboard
  • Format: X-Api-Key: your-api-key-here
The examples read the key from the OLLANG_API_KEY environment variable; set it before running them. The project must belong to the API key’s account; other projects return 404. The API key user also needs write access, the same as for folder documents: the account owner, team-manager or order-creator role, or project manager of the project’s folder. Other keys, such as view-only users, receive a 403.

Path Parameters

string
required
The unique identifier of the project the document belongs to.
string
required
The unique identifier of the project document. Retrieve document IDs with List Project Documents.

Body Parameters

Send at least one of url, name, or language. An empty body returns 400.
string
Replaces the document’s content. A URL Ollang can read the new file from, such as a pre-signed S3 URL, with the same rules as Attach Project Document: http or https, a public address, no redirect, and 50 MB or smaller. Ollang stores its own copy. Unless you also send name, the document keeps its name with the new file’s extension (notes.pdf becomes notes.docx).
string
New display name of the document. The file’s extension is appended when the name does not already end with it.
number
Size of the new file in bytes. Only used together with url, and informational: Ollang records the size of the file it actually fetched.
string
New BCP-47 language tag of the document (e.g. de).

Response

Returns the updated project document, in the same shape as List Project Documents.