---
title: "Read pages of a PDF attached to an AI Assistant message"
method: GET
path: "/chat-attachments/{attachment_id}/pages/"
tags: ["assistant"]
---

# Read pages of a PDF attached to an AI Assistant message

`GET /chat-attachments/{attachment_id}/pages/`

## Request

- Base URL: `https://api.getoneprofile.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.getoneprofile.ai/chat-attachments/{attachment_id}/pages/`
- Auth: one of:
  - API key in header `X-API-Key`
  - HTTP bearer

Read some of a PDF's pages as text, each laid out as the page prints it: a table's columns stay side by side and each of its rows stays one line, with the gaps between columns cut to three spaces. `offset` is the first page wanted, counted from zero, and `limit` the most to read; a read also stops at a size, so read on from `next_offset`. A spreadsheet has rows instead of pages. Only your own files.

## Path parameters

- `attachment_id` string, uuid, required

## Query parameters

- `offset` integer: The first page wanted, counted from zero.
- `limit` integer: How many pages to read, at most 50.

## Response `200`

Successful Response

- ChatAttachmentPagesResponseSchema: 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, nullable, 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.

## Other responses

- `401`: Unauthorized
- `403`: Forbidden
- `404`: File not found
- `422`: Invalid request made to the API.
- `500`: Internal server error.
- `502`: Bad gateway error.
- `503`: Service unavailable.

---

[API](https://skmtc.dev/getoneprofile/apis/api-reference-oneprofile.md) · [All operations](https://skmtc.dev/getoneprofile/apis/api-reference-oneprofile/llms.txt) · [OpenAPI document](https://skmtc.dev/getoneprofile/apis/api-reference-oneprofile/revisions/4a6bd71e3f02?raw)
