Skip to main content
GET
Read pages of a PDF attached to an AI Assistant message

Authorizations

X-API-Key
string
header
required

Path Parameters

attachment_id
string<uuid>
required

Query Parameters

offset
integer
default:0

The first page wanted, counted from zero.

Required range: x >= 0
limit
integer
default:50

How many pages to read, at most 50.

Required range: 1 <= x <= 50

Response

Successful Response

Some of a PDF's pages, as text.

Each page is laid out as the page prints it, so a table's rows stay one line each, with every gap between columns cut to three spaces. offset is where the read starts, counted from zero, next_offset where the next one does, and page_count is the whole PDF's.

attachment_id
string<uuid>
required
filename
string
required
next_offset
integer | null
required

Where the next read starts, or null when this read reaches the last page. A read stops at a size as well as at limit, so this can come before offset plus limit.

offset
integer
required

The first page here, counted from zero.

page_count
integer
required

Pages in the whole PDF, not in this read.

pages
string[]
required

Each page's text, in page order. A page with no text is empty, and a page whose text could not be read says so.