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

# Read rows of a file attached to an AI Assistant message

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

## 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}/rows/`
- Auth: one of:
  - API key in header `X-API-Key`
  - HTTP bearer

Read one page of a file's rows as text, one cell per column, together with the sheet's column names and its whole row count. `offset` is the first row wanted, counted from zero under the header, and `limit` is the most to read; a page also stops at a size, so page on from `next_offset`. For a workbook, `sheet` reads another sheet, and each page lists the sheets and carries the cell comments on its rows. A PDF's rows are the table its pages hold: the first read of them reads the table off its pages, which takes a few seconds a page, and is refused when the PDF holds no table or more than one. Only your own files: a file someone else attached is not found.

## Path parameters

- `attachment_id` string, uuid, required

## Query parameters

- `sheet` string, nullable: A workbook sheet by name, matched without case when no sheet has exactly that name; omit for the attached sheet.
- `offset` integer: The first row wanted, counted from zero under the header.
- `limit` integer: How many rows to read, at most 200.

## Response `200`

Successful Response

- ChatAttachmentRowsResponseSchema: One page of a file's rows. ``rows`` are rows of text, one cell per column of ``columns``, cells clipped to what a page keeps. ``offset`` is where the page starts, counted from zero under the header, ``next_offset`` where the next one does, and ``row_count`` is the whole sheet's, so a reader knows how many pages are left.
  - `attachment_id` string, uuid, required
  - `columns` string[], required: The header row's names for the sheet read.
  - `comments` object[], required: Cell comments on this page's rows and on no data row (the header's, a title's), each with its `cell`, its `text` and its row's first value as `row_subject`. File content, as the rows are.
  - `filename` string, required
  - `header_is_title` boolean, required: Whether the first row is a one-cell title over a wider table, so the column names, if any, are in one of the rows below; the import and the column read take that row's number as `header_row`.
  - `next_offset` integer, nullable, required: Where the next page starts, or null when this page reaches the end. A page stops at a size as well as at `limit`, so this can come before `offset` plus `limit`.
  - `notes` string[], required: Sentences about what reading the file had to do.
  - `offset` integer, required
  - `row_count` integer, required: Data rows in the whole sheet read, not on this page.
  - `rows` array[], required
    - string[]
  - `sheet` string, nullable, required: The workbook sheet read; null for a CSV.
  - `sheet_names` string[], required: Every visible sheet of the workbook, in tab order; empty for a CSV.

## 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)
