Read a document's text
The text Werk read in a document, part by part.
Only a ready document has parts; any other answers its state with none. A cursor of an older revision answers cursor_expired.
Authorization
Authorization: Bearer <key> Authentication
Path parameters
The project's id.
The card's id.
The document's id.
Query parameters
The first part to read, counted from 1.
The first part left out.
How many parts a page holds.
The cursor from the previous page's nextCursor; left out, the first page.
Response
200 The parts.
The document's reading state.
The revision these parts were read in.
The parts Werk read, in order.
Show properties of pagesHide properties of pages
The part, counted from 1 in Werk's own count.
Where in the file the part is.
Show properties of locationHide properties of location
One of 5 shapes, told apart by kind:
kindpdf_Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.
The PDF page.
kindsectionWhere in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.
The section, counted from 1.
kindparagraphWhere in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.
The paragraph, counted from 1.
kindsheet_Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.
The sheet's name.
The part's first row.
The part's last row.
kindlinesWhere in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.
The part's first line.
The part's last line.
The text Werk read in the part.
The cursor that reads the next page as after, or null when none remains.
Errors
invalid_query The query is not in the form the route takes; the limit is in the unit of the input details.field names (characters for a text, entries for a list, the value for a number).session_revoked The request carries no session the server holds, or its session has ended.session_expired The session has expired.conversation_not_found The project the request names, or its chat, is not one the signed-in person is in.item_not_found The card the request names, or its list, is not one the signed-in person can see.asset_not_found The file the request names is not one the signed-in person can reach where the request names it, or is no longer available.session_changed The session changed while the request was in flight.cursor_expired The page cursor no longer fits the list as it stands or the arguments it was read with.rate_limited More requests of this kind were sent than Werk takes within the time it counts them over.server_error The server could not complete the request, and it is not known whether a write it holds was made.curl "https://api.getwerk.ai/api/v1/projects/2f6c9e41-7a3b-4d58-9c1e-0b8d4f2a6e73/cards/3c9e5b17-8d2f-4a64-b1e3-7f5a0c9d2b48/documents/d7e1b5c3-9a4f-4e26-b8d0-2f6a4c8e1d59/pages?limit=10" \
-H "Authorization: Bearer wk_key_..."const res = await fetch("https://api.getwerk.ai/api/v1/projects/2f6c9e41-7a3b-4d58-9c1e-0b8d4f2a6e73/cards/3c9e5b17-8d2f-4a64-b1e3-7f5a0c9d2b48/documents/d7e1b5c3-9a4f-4e26-b8d0-2f6a4c8e1d59/pages?limit=10", {
headers: {
Authorization: "Bearer wk_key_...",
},
});
const answer = await res.json();{
"state": "ready",
"revision": 1,
"pages": [
{
"page": 1,
"location": {
"kind": "pdf_page",
"page": 1
},
"text": "Stonecraft Supply. Quote Q-20931, November 17, 2026. Quartz countertop, 3 cm, polished edge."
}
],
"nextCursor": null
}Send a requestGET
It is sent with the key you give, as you. A change made here is real.
The request could not be sent, or its response could not be read.