DevelopersHow to connect an assistantKeys
Reference/Files/Change

Answer a reading's cost

POSThttps://api.getwerk.ai/api/v1/projects/{projectId}/cards/{cardId}/documents/{documentId}/consent

Says yes or no to the cost Werk asked before reading a long document.

Yes starts the reading at its cost on the plan; no leaves the document unread. A question that changed or ended answers kind refused.

Authorization

AuthorizationheaderRequired

Authorization: Bearer <key> Authentication

Headers

Werk-Localestring

The language tag Werk writes the answer's own words in, such as step names and history lines, matched to a language it serves; a card's text stays as written. At a project's paths, the reads of its cards and steps, of a card, its update photos, a file and its reminders, and of follow and reminder invitations, and a document's read-now and consent, take the language of the person's chat with Werk in that project first, while it has one. Without either, the language Werk uses with the person the key or the connection acts for.

Path parameters

projectIdstring, uuidRequired

The project's id.

cardIdstring, uuidRequired

The card's id.

documentIdstring, uuidRequired

The document's id.

Body

consentIdstring, uuidRequired

The id of the question about the reading's cost.

expectedConsentVersionintegerRequired

The question's version as last read.

At least 1
acceptbooleanRequired

True reads the document at its cost, false leaves it unread.

Response

200 What came of the answer.

One of 4 shapes, told apart by kind:

kindreading
kindenum

reading once Werk reads it, not_read when it will not, awaiting_confirmation while it waits for a yes to its cost, refused when the request could not be taken.

Allowed valuesreading
documentobject

The document after the request.

Show properties of documentHide properties of document
idstring, uuid

The document's id.

itemIdstring, uuid

The card the document is on.

filenamestring

The document's name.

From 1 to 255 characters
mimeTypeenum

The document's media type.

Allowed valuesapplication/pdfapplication/vnd.openxmlformats-officedocument.wordprocessingml.documentapplication/vnd.openxmlformats-officedocument.spreadsheetml.sheettext/csvtext/plaintext/markdown
revisioninteger

The document's revision, which grows each time its file is replaced.

At least 1
stateenum

not_read while it is not being read, awaiting_confirmation while Werk waits for a yes to its cost, reading, failed, or ready.

Allowed valuesnot_readawaiting_confirmationreadingfailedready
versioninteger

The document's version, which grows with every change to it; a read request sends it as expectedVersion.

At least 1
totalSourcesinteger or null

How many parts the document has, or null while not known.

At least 0
readSourcesinteger

How many parts Werk read.

At least 0
truncatedboolean

True when Werk read only the document's first parts.

summarystring or null

Werk's summary of the document, or null.

From 1 to 2000 characters
fieldsobject or null

The issuer, number, date, total and currency Werk read in the document, or null.

Show properties of fieldsHide properties of fields
issuerobject or null

The issuer Werk read in the document, or null when it found none.

Show properties of issuerHide properties of issuer
valuestring

The issuer as read.

From 1 to 512 characters
sourceobject

The part of the document it was read from.

Show properties of sourceHide properties of source
documentIdstring

The document's id.

At least 1 character
revisioninteger

The revision it was read in.

At least 1
pageinteger

The part, counted from 1 in Werk's own count; only a PDF page's location names a page of the file.

At least 1
sha256string

The SHA-256 of the file it was read from.

locationobject

Where in the file the part is.

Show properties of locationHide properties of location

One of 5 shapes, told apart by kind:

kindpdf_page
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuespdf_page
pageinteger

The PDF page.

At least 1
kindsection
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuessection
sectioninteger

The section, counted from 1.

At least 1
kindparagraph
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuesparagraph
paragraphinteger

The paragraph, counted from 1.

At least 1
kindsheet_rows
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuessheet_rows
sheetstring

The sheet's name.

At least 1 character
firstRowinteger

The part's first row.

At least 1
lastRowinteger

The part's last row.

At least 1
kindlines
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valueslines
firstLineinteger

The part's first line.

At least 1
lastLineinteger

The part's last line.

At least 1
numberobject or null

The document's number Werk read in the document, or null when it found none.

Show properties of numberHide properties of number
valuestring

The document's number as read.

From 1 to 128 characters
sourceobject

The part of the document it was read from.

Show properties of sourceHide properties of source
documentIdstring

The document's id.

At least 1 character
revisioninteger

The revision it was read in.

At least 1
pageinteger

The part, counted from 1 in Werk's own count; only a PDF page's location names a page of the file.

At least 1
sha256string

The SHA-256 of the file it was read from.

locationobject

Where in the file the part is.

Show properties of locationHide properties of location

One of 5 shapes, told apart by kind:

kindpdf_page
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuespdf_page
pageinteger

The PDF page.

At least 1
kindsection
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuessection
sectioninteger

The section, counted from 1.

At least 1
kindparagraph
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuesparagraph
paragraphinteger

The paragraph, counted from 1.

At least 1
kindsheet_rows
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuessheet_rows
sheetstring

The sheet's name.

At least 1 character
firstRowinteger

The part's first row.

At least 1
lastRowinteger

The part's last row.

At least 1
kindlines
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valueslines
firstLineinteger

The part's first line.

At least 1
lastLineinteger

The part's last line.

At least 1
dateobject or null

The date Werk read in the document, or null when it found none.

Show properties of dateHide properties of date
valuestring, date

The date as read, as YYYY-MM-DD.

sourceobject

The part of the document it was read from.

Show properties of sourceHide properties of source
documentIdstring

The document's id.

At least 1 character
revisioninteger

The revision it was read in.

At least 1
pageinteger

The part, counted from 1 in Werk's own count; only a PDF page's location names a page of the file.

At least 1
sha256string

The SHA-256 of the file it was read from.

locationobject

Where in the file the part is.

Show properties of locationHide properties of location

One of 5 shapes, told apart by kind:

kindpdf_page
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuespdf_page
pageinteger

The PDF page.

At least 1
kindsection
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuessection
sectioninteger

The section, counted from 1.

At least 1
kindparagraph
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuesparagraph
paragraphinteger

The paragraph, counted from 1.

At least 1
kindsheet_rows
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuessheet_rows
sheetstring

The sheet's name.

At least 1 character
firstRowinteger

The part's first row.

At least 1
lastRowinteger

The part's last row.

At least 1
kindlines
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valueslines
firstLineinteger

The part's first line.

At least 1
lastLineinteger

The part's last line.

At least 1
totalobject or null

The total Werk read in the document, or null when it found none.

Show properties of totalHide properties of total
valuestring

The total as read, a decimal number with a point.

Up to 128 characters
sourceobject

The part of the document it was read from.

Show properties of sourceHide properties of source
documentIdstring

The document's id.

At least 1 character
revisioninteger

The revision it was read in.

At least 1
pageinteger

The part, counted from 1 in Werk's own count; only a PDF page's location names a page of the file.

At least 1
sha256string

The SHA-256 of the file it was read from.

locationobject

Where in the file the part is.

Show properties of locationHide properties of location

One of 5 shapes, told apart by kind:

kindpdf_page
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuespdf_page
pageinteger

The PDF page.

At least 1
kindsection
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuessection
sectioninteger

The section, counted from 1.

At least 1
kindparagraph
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuesparagraph
paragraphinteger

The paragraph, counted from 1.

At least 1
kindsheet_rows
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuessheet_rows
sheetstring

The sheet's name.

At least 1 character
firstRowinteger

The part's first row.

At least 1
lastRowinteger

The part's last row.

At least 1
kindlines
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valueslines
firstLineinteger

The part's first line.

At least 1
lastLineinteger

The part's last line.

At least 1
currencyobject or null

The currency Werk read in the document, or null when it found none.

Show properties of currencyHide properties of currency
valuestring

The currency as read, its ISO 4217 code.

sourceobject

The part of the document it was read from.

Show properties of sourceHide properties of source
documentIdstring

The document's id.

At least 1 character
revisioninteger

The revision it was read in.

At least 1
pageinteger

The part, counted from 1 in Werk's own count; only a PDF page's location names a page of the file.

At least 1
sha256string

The SHA-256 of the file it was read from.

locationobject

Where in the file the part is.

Show properties of locationHide properties of location

One of 5 shapes, told apart by kind:

kindpdf_page
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuespdf_page
pageinteger

The PDF page.

At least 1
kindsection
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuessection
sectioninteger

The section, counted from 1.

At least 1
kindparagraph
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuesparagraph
paragraphinteger

The paragraph, counted from 1.

At least 1
kindsheet_rows
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuessheet_rows
sheetstring

The sheet's name.

At least 1 character
firstRowinteger

The part's first row.

At least 1
lastRowinteger

The part's last row.

At least 1
kindlines
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valueslines
firstLineinteger

The part's first line.

At least 1
lastLineinteger

The part's last line.

At least 1
failureCodeenum or null

Why reading failed, or null.

Allowed valuesparse_failedencryptedunsupported_formattranscription_failedsummary_failedinvalid_outputaccess_lostlimit_exceededprovider_unavailable
unitsinteger or null

What reading the document counts on the plan, in messages, or null before Werk inspected it.

At least 1
pagesinteger or null

A PDF's pages, or other text in pages of 3,000 characters; null when not known.

At least 1
sheetsinteger or null

A workbook's sheets with data; null for other files or when not known.

At least 1
removableboolean

True when the key's person may take this document off the card now.

replayboolean

True when this answers a request already taken.

kindnot_read
kindenum

reading once Werk reads it, not_read when it will not, awaiting_confirmation while it waits for a yes to its cost, refused when the request could not be taken.

Allowed valuesnot_read
documentobject

The document after the request.

Show properties of documentHide properties of document
idstring, uuid

The document's id.

itemIdstring, uuid

The card the document is on.

filenamestring

The document's name.

From 1 to 255 characters
mimeTypeenum

The document's media type.

Allowed valuesapplication/pdfapplication/vnd.openxmlformats-officedocument.wordprocessingml.documentapplication/vnd.openxmlformats-officedocument.spreadsheetml.sheettext/csvtext/plaintext/markdown
revisioninteger

The document's revision, which grows each time its file is replaced.

At least 1
stateenum

not_read while it is not being read, awaiting_confirmation while Werk waits for a yes to its cost, reading, failed, or ready.

Allowed valuesnot_readawaiting_confirmationreadingfailedready
versioninteger

The document's version, which grows with every change to it; a read request sends it as expectedVersion.

At least 1
totalSourcesinteger or null

How many parts the document has, or null while not known.

At least 0
readSourcesinteger

How many parts Werk read.

At least 0
truncatedboolean

True when Werk read only the document's first parts.

summarystring or null

Werk's summary of the document, or null.

From 1 to 2000 characters
fieldsobject or null

The issuer, number, date, total and currency Werk read in the document, or null.

Show properties of fieldsHide properties of fields
issuerobject or null

The issuer Werk read in the document, or null when it found none.

Show properties of issuerHide properties of issuer
valuestring

The issuer as read.

From 1 to 512 characters
sourceobject

The part of the document it was read from.

Show properties of sourceHide properties of source
documentIdstring

The document's id.

At least 1 character
revisioninteger

The revision it was read in.

At least 1
pageinteger

The part, counted from 1 in Werk's own count; only a PDF page's location names a page of the file.

At least 1
sha256string

The SHA-256 of the file it was read from.

locationobject

Where in the file the part is.

Show properties of locationHide properties of location

One of 5 shapes, told apart by kind:

kindpdf_page
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuespdf_page
pageinteger

The PDF page.

At least 1
kindsection
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuessection
sectioninteger

The section, counted from 1.

At least 1
kindparagraph
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuesparagraph
paragraphinteger

The paragraph, counted from 1.

At least 1
kindsheet_rows
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuessheet_rows
sheetstring

The sheet's name.

At least 1 character
firstRowinteger

The part's first row.

At least 1
lastRowinteger

The part's last row.

At least 1
kindlines
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valueslines
firstLineinteger

The part's first line.

At least 1
lastLineinteger

The part's last line.

At least 1
numberobject or null

The document's number Werk read in the document, or null when it found none.

Show properties of numberHide properties of number
valuestring

The document's number as read.

From 1 to 128 characters
sourceobject

The part of the document it was read from.

Show properties of sourceHide properties of source
documentIdstring

The document's id.

At least 1 character
revisioninteger

The revision it was read in.

At least 1
pageinteger

The part, counted from 1 in Werk's own count; only a PDF page's location names a page of the file.

At least 1
sha256string

The SHA-256 of the file it was read from.

locationobject

Where in the file the part is.

Show properties of locationHide properties of location

One of 5 shapes, told apart by kind:

kindpdf_page
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuespdf_page
pageinteger

The PDF page.

At least 1
kindsection
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuessection
sectioninteger

The section, counted from 1.

At least 1
kindparagraph
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuesparagraph
paragraphinteger

The paragraph, counted from 1.

At least 1
kindsheet_rows
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuessheet_rows
sheetstring

The sheet's name.

At least 1 character
firstRowinteger

The part's first row.

At least 1
lastRowinteger

The part's last row.

At least 1
kindlines
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valueslines
firstLineinteger

The part's first line.

At least 1
lastLineinteger

The part's last line.

At least 1
dateobject or null

The date Werk read in the document, or null when it found none.

Show properties of dateHide properties of date
valuestring, date

The date as read, as YYYY-MM-DD.

sourceobject

The part of the document it was read from.

Show properties of sourceHide properties of source
documentIdstring

The document's id.

At least 1 character
revisioninteger

The revision it was read in.

At least 1
pageinteger

The part, counted from 1 in Werk's own count; only a PDF page's location names a page of the file.

At least 1
sha256string

The SHA-256 of the file it was read from.

locationobject

Where in the file the part is.

Show properties of locationHide properties of location

One of 5 shapes, told apart by kind:

kindpdf_page
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuespdf_page
pageinteger

The PDF page.

At least 1
kindsection
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuessection
sectioninteger

The section, counted from 1.

At least 1
kindparagraph
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuesparagraph
paragraphinteger

The paragraph, counted from 1.

At least 1
kindsheet_rows
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuessheet_rows
sheetstring

The sheet's name.

At least 1 character
firstRowinteger

The part's first row.

At least 1
lastRowinteger

The part's last row.

At least 1
kindlines
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valueslines
firstLineinteger

The part's first line.

At least 1
lastLineinteger

The part's last line.

At least 1
totalobject or null

The total Werk read in the document, or null when it found none.

Show properties of totalHide properties of total
valuestring

The total as read, a decimal number with a point.

Up to 128 characters
sourceobject

The part of the document it was read from.

Show properties of sourceHide properties of source
documentIdstring

The document's id.

At least 1 character
revisioninteger

The revision it was read in.

At least 1
pageinteger

The part, counted from 1 in Werk's own count; only a PDF page's location names a page of the file.

At least 1
sha256string

The SHA-256 of the file it was read from.

locationobject

Where in the file the part is.

Show properties of locationHide properties of location

One of 5 shapes, told apart by kind:

kindpdf_page
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuespdf_page
pageinteger

The PDF page.

At least 1
kindsection
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuessection
sectioninteger

The section, counted from 1.

At least 1
kindparagraph
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuesparagraph
paragraphinteger

The paragraph, counted from 1.

At least 1
kindsheet_rows
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuessheet_rows
sheetstring

The sheet's name.

At least 1 character
firstRowinteger

The part's first row.

At least 1
lastRowinteger

The part's last row.

At least 1
kindlines
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valueslines
firstLineinteger

The part's first line.

At least 1
lastLineinteger

The part's last line.

At least 1
currencyobject or null

The currency Werk read in the document, or null when it found none.

Show properties of currencyHide properties of currency
valuestring

The currency as read, its ISO 4217 code.

sourceobject

The part of the document it was read from.

Show properties of sourceHide properties of source
documentIdstring

The document's id.

At least 1 character
revisioninteger

The revision it was read in.

At least 1
pageinteger

The part, counted from 1 in Werk's own count; only a PDF page's location names a page of the file.

At least 1
sha256string

The SHA-256 of the file it was read from.

locationobject

Where in the file the part is.

Show properties of locationHide properties of location

One of 5 shapes, told apart by kind:

kindpdf_page
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuespdf_page
pageinteger

The PDF page.

At least 1
kindsection
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuessection
sectioninteger

The section, counted from 1.

At least 1
kindparagraph
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuesparagraph
paragraphinteger

The paragraph, counted from 1.

At least 1
kindsheet_rows
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuessheet_rows
sheetstring

The sheet's name.

At least 1 character
firstRowinteger

The part's first row.

At least 1
lastRowinteger

The part's last row.

At least 1
kindlines
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valueslines
firstLineinteger

The part's first line.

At least 1
lastLineinteger

The part's last line.

At least 1
failureCodeenum or null

Why reading failed, or null.

Allowed valuesparse_failedencryptedunsupported_formattranscription_failedsummary_failedinvalid_outputaccess_lostlimit_exceededprovider_unavailable
unitsinteger or null

What reading the document counts on the plan, in messages, or null before Werk inspected it.

At least 1
pagesinteger or null

A PDF's pages, or other text in pages of 3,000 characters; null when not known.

At least 1
sheetsinteger or null

A workbook's sheets with data; null for other files or when not known.

At least 1
removableboolean

True when the key's person may take this document off the card now.

kindawaiting_confirmation
kindenum

reading once Werk reads it, not_read when it will not, awaiting_confirmation while it waits for a yes to its cost, refused when the request could not be taken.

Allowed valuesawaiting_confirmation
documentobject

The document after the request.

Show properties of documentHide properties of document
idstring, uuid

The document's id.

itemIdstring, uuid

The card the document is on.

filenamestring

The document's name.

From 1 to 255 characters
mimeTypeenum

The document's media type.

Allowed valuesapplication/pdfapplication/vnd.openxmlformats-officedocument.wordprocessingml.documentapplication/vnd.openxmlformats-officedocument.spreadsheetml.sheettext/csvtext/plaintext/markdown
revisioninteger

The document's revision, which grows each time its file is replaced.

At least 1
stateenum

not_read while it is not being read, awaiting_confirmation while Werk waits for a yes to its cost, reading, failed, or ready.

Allowed valuesnot_readawaiting_confirmationreadingfailedready
versioninteger

The document's version, which grows with every change to it; a read request sends it as expectedVersion.

At least 1
totalSourcesinteger or null

How many parts the document has, or null while not known.

At least 0
readSourcesinteger

How many parts Werk read.

At least 0
truncatedboolean

True when Werk read only the document's first parts.

summarystring or null

Werk's summary of the document, or null.

From 1 to 2000 characters
fieldsobject or null

The issuer, number, date, total and currency Werk read in the document, or null.

Show properties of fieldsHide properties of fields
issuerobject or null

The issuer Werk read in the document, or null when it found none.

Show properties of issuerHide properties of issuer
valuestring

The issuer as read.

From 1 to 512 characters
sourceobject

The part of the document it was read from.

Show properties of sourceHide properties of source
documentIdstring

The document's id.

At least 1 character
revisioninteger

The revision it was read in.

At least 1
pageinteger

The part, counted from 1 in Werk's own count; only a PDF page's location names a page of the file.

At least 1
sha256string

The SHA-256 of the file it was read from.

locationobject

Where in the file the part is.

Show properties of locationHide properties of location

One of 5 shapes, told apart by kind:

kindpdf_page
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuespdf_page
pageinteger

The PDF page.

At least 1
kindsection
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuessection
sectioninteger

The section, counted from 1.

At least 1
kindparagraph
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuesparagraph
paragraphinteger

The paragraph, counted from 1.

At least 1
kindsheet_rows
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuessheet_rows
sheetstring

The sheet's name.

At least 1 character
firstRowinteger

The part's first row.

At least 1
lastRowinteger

The part's last row.

At least 1
kindlines
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valueslines
firstLineinteger

The part's first line.

At least 1
lastLineinteger

The part's last line.

At least 1
numberobject or null

The document's number Werk read in the document, or null when it found none.

Show properties of numberHide properties of number
valuestring

The document's number as read.

From 1 to 128 characters
sourceobject

The part of the document it was read from.

Show properties of sourceHide properties of source
documentIdstring

The document's id.

At least 1 character
revisioninteger

The revision it was read in.

At least 1
pageinteger

The part, counted from 1 in Werk's own count; only a PDF page's location names a page of the file.

At least 1
sha256string

The SHA-256 of the file it was read from.

locationobject

Where in the file the part is.

Show properties of locationHide properties of location

One of 5 shapes, told apart by kind:

kindpdf_page
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuespdf_page
pageinteger

The PDF page.

At least 1
kindsection
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuessection
sectioninteger

The section, counted from 1.

At least 1
kindparagraph
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuesparagraph
paragraphinteger

The paragraph, counted from 1.

At least 1
kindsheet_rows
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuessheet_rows
sheetstring

The sheet's name.

At least 1 character
firstRowinteger

The part's first row.

At least 1
lastRowinteger

The part's last row.

At least 1
kindlines
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valueslines
firstLineinteger

The part's first line.

At least 1
lastLineinteger

The part's last line.

At least 1
dateobject or null

The date Werk read in the document, or null when it found none.

Show properties of dateHide properties of date
valuestring, date

The date as read, as YYYY-MM-DD.

sourceobject

The part of the document it was read from.

Show properties of sourceHide properties of source
documentIdstring

The document's id.

At least 1 character
revisioninteger

The revision it was read in.

At least 1
pageinteger

The part, counted from 1 in Werk's own count; only a PDF page's location names a page of the file.

At least 1
sha256string

The SHA-256 of the file it was read from.

locationobject

Where in the file the part is.

Show properties of locationHide properties of location

One of 5 shapes, told apart by kind:

kindpdf_page
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuespdf_page
pageinteger

The PDF page.

At least 1
kindsection
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuessection
sectioninteger

The section, counted from 1.

At least 1
kindparagraph
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuesparagraph
paragraphinteger

The paragraph, counted from 1.

At least 1
kindsheet_rows
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuessheet_rows
sheetstring

The sheet's name.

At least 1 character
firstRowinteger

The part's first row.

At least 1
lastRowinteger

The part's last row.

At least 1
kindlines
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valueslines
firstLineinteger

The part's first line.

At least 1
lastLineinteger

The part's last line.

At least 1
totalobject or null

The total Werk read in the document, or null when it found none.

Show properties of totalHide properties of total
valuestring

The total as read, a decimal number with a point.

Up to 128 characters
sourceobject

The part of the document it was read from.

Show properties of sourceHide properties of source
documentIdstring

The document's id.

At least 1 character
revisioninteger

The revision it was read in.

At least 1
pageinteger

The part, counted from 1 in Werk's own count; only a PDF page's location names a page of the file.

At least 1
sha256string

The SHA-256 of the file it was read from.

locationobject

Where in the file the part is.

Show properties of locationHide properties of location

One of 5 shapes, told apart by kind:

kindpdf_page
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuespdf_page
pageinteger

The PDF page.

At least 1
kindsection
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuessection
sectioninteger

The section, counted from 1.

At least 1
kindparagraph
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuesparagraph
paragraphinteger

The paragraph, counted from 1.

At least 1
kindsheet_rows
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuessheet_rows
sheetstring

The sheet's name.

At least 1 character
firstRowinteger

The part's first row.

At least 1
lastRowinteger

The part's last row.

At least 1
kindlines
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valueslines
firstLineinteger

The part's first line.

At least 1
lastLineinteger

The part's last line.

At least 1
currencyobject or null

The currency Werk read in the document, or null when it found none.

Show properties of currencyHide properties of currency
valuestring

The currency as read, its ISO 4217 code.

sourceobject

The part of the document it was read from.

Show properties of sourceHide properties of source
documentIdstring

The document's id.

At least 1 character
revisioninteger

The revision it was read in.

At least 1
pageinteger

The part, counted from 1 in Werk's own count; only a PDF page's location names a page of the file.

At least 1
sha256string

The SHA-256 of the file it was read from.

locationobject

Where in the file the part is.

Show properties of locationHide properties of location

One of 5 shapes, told apart by kind:

kindpdf_page
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuespdf_page
pageinteger

The PDF page.

At least 1
kindsection
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuessection
sectioninteger

The section, counted from 1.

At least 1
kindparagraph
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuesparagraph
paragraphinteger

The paragraph, counted from 1.

At least 1
kindsheet_rows
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valuessheet_rows
sheetstring

The sheet's name.

At least 1 character
firstRowinteger

The part's first row.

At least 1
lastRowinteger

The part's last row.

At least 1
kindlines
kindenum

Where in the file the part is: a PDF page, a section, a paragraph, a sheet's rows or a text's lines.

Allowed valueslines
firstLineinteger

The part's first line.

At least 1
lastLineinteger

The part's last line.

At least 1
failureCodeenum or null

Why reading failed, or null.

Allowed valuesparse_failedencryptedunsupported_formattranscription_failedsummary_failedinvalid_outputaccess_lostlimit_exceededprovider_unavailable
unitsinteger or null

What reading the document counts on the plan, in messages, or null before Werk inspected it.

At least 1
pagesinteger or null

A PDF's pages, or other text in pages of 3,000 characters; null when not known.

At least 1
sheetsinteger or null

A workbook's sheets with data; null for other files or when not known.

At least 1
removableboolean

True when the key's person may take this document off the card now.

consentobject

The question about the reading's cost, answered with the consent route.

Show properties of consentHide properties of consent
idstring, uuid

The question's id, sent as consentId.

versioninteger

The question's version, sent as expectedConsentVersion.

At least 1
unitsinteger

What the reading counts on the plan, in messages.

At least 1
expiresAtstring, date-time

When the question lapses.

messagestring

The question as Werk asks it, in the reader's language.

From 1 to 72 characters
kindrefused
kindenum

reading once Werk reads it, not_read when it will not, awaiting_confirmation while it waits for a yes to its cost, refused when the request could not be taken.

Allowed valuesrefused
codeenum

Why the request could not be taken.

Allowed valuesplan_limitshare_usedplan_unavailablecollaborator_unfundedsource_unavailablestale_documentinspection_requiredstale_consentconsent_expiredconsent_settlednot_approversource_conflict

Errors

400invalid_queryThe 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).
400invalid_mediaThe file, its name or the request about it is not in a 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).
401session_revokedThe request carries no session the server holds, or its session has ended.
401session_expiredThe session has expired.
404conversation_not_foundThe project the request names, or its chat, is not one the signed-in person is in.
404item_not_foundThe card the request names, or its list, is not one the signed-in person can see.
404asset_not_foundThe file the request names is not one the signed-in person can reach where the request names it, or is no longer available.
409session_changedThe session changed while the request was in flight.
409project_deletedThe project is being deleted.
409project_archivedThe project is archived, so it does not take this request.
413payload_too_largeThe request body has more bytes than the route takes.
rate_limitedMore requests of this kind were sent than Werk takes within the time it counts them over.
500server_errorThe server could not complete the request, and it is not known whether a write it holds was made.
curl
curl -X POST "https://api.getwerk.ai/api/v1/projects/2f6c9e41-7a3b-4d58-9c1e-0b8d4f2a6e73/cards/3c9e5b17-8d2f-4a64-b1e3-7f5a0c9d2b48/documents/d7e1b5c3-9a4f-4e26-b8d0-2f6a4c8e1d59/consent" \
  -H "Authorization: Bearer wk_key_..." \
  -H "Content-Type: application/json" \
  -d '{
    "consentId": "d2a6c0e4-9b3f-4d5b-87a9-2b8c0f4d6a08",
    "expectedConsentVersion": 1,
    "accept": true
  }'
TypeScript
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/consent", {
  method: "POST",
  headers: {
    Authorization: "Bearer wk_key_...",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "consentId": "d2a6c0e4-9b3f-4d5b-87a9-2b8c0f4d6a08",
    "expectedConsentVersion": 1,
    "accept": true
  }),
});
const answer = await res.json();
200JSON
{
  "kind": "reading",
  "document": {
    "id": "d7e1b5c3-9a4f-4e26-b8d0-2f6a4c8e1d59",
    "itemId": "3c9e5b17-8d2f-4a64-b1e3-7f5a0c9d2b48",
    "filename": "countertop-quote.pdf",
    "mimeType": "application/pdf",
    "revision": 1,
    "state": "reading",
    "version": 3,
    "totalSources": 2,
    "readSources": 0,
    "truncated": false,
    "summary": null,
    "fields": null,
    "failureCode": null,
    "units": 1,
    "pages": 2,
    "sheets": null,
    "removable": true
  },
  "replay": false
}