POST
/
documents
/
get-page-info
curl --request POST \
  --url https://api.zeroentropy.dev/v1/documents/get-page-info \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "collection_name": "<string>",
  "path": "<string>",
  "page_index": 123,
  "include_content": false,
  "include_image": false
}'
{
  "page": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "collection_name": "<string>",
    "path": "<string>",
    "page_index": 123,
    "content": "<string>",
    "image_base64_data": "<string>"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
collection_name
string
required

The name of the collection.

path
string
required

The filepath of the document whose page you are requesting. A 404 Not Found status code will be returned if no document with this path was found.

page_index
integer
required

The specific page index whose info is being requested. Pages are 0-indexed, so that the 1st page of a PDF is of page index 0. You may use the num_pages attribute of /documents/get-document-info or /documents/get-document-info-list to know what the range of valid indices are. A 404 Not Found status code will be returned if no such page index exists.

include_content
boolean
default:false

If true, then the response will have the content attribute be a string, rather than null. This string will contain the full contents of the page.

include_image
boolean
default:false

If true, then the response will have the image_base64_data attribute be a string*, rather than null. This string will contain the image data of the document, as a base64-encoded string. Currently, this data is guaranteed to be a JPEG-encoded image.

*Note that the response may still be null, if the page has no image data, such as if the document was uploaded with raw text rather than as a PDF.

Response

200
application/json
Successful Response
page
object
required