---
title: "List files"
method: GET
path: "/files"
tags: ["Files"]
---

# List files

`GET /files`

## Request

- Base URL: `https://app.pencil.ink/api/v1`
- URL: `https://app.pencil.ink/api/v1/files`
- Auth: HTTP bearer

Returns safe file metadata and inline text content only when already stored inline. Storage URLs are not exposed.

## Query parameters

- `projectId` string
- `taskId` string
- `contentId` string
- `agentId` string
- `search` string
- `limit` integer
- `cursor` string

## Response `200`

A page of resources.

- object
  - `data` FileObject[]
    - `id` string
    - `name` string
    - `size` integer
    - `mimeType` string
    - `hasInlineContent` boolean
    - `content` string, nullable: Only present for files stored with `url: inline`.
    - `createdAt` integer
  - `pagination` Pagination
    - `nextCursor` string, nullable: Cursor for the next page, or null when there are no more results.
    - `hasMore` boolean

## Other responses

- `401`: Missing or invalid API key (`unauthorized`).

---

[API](https://skmtc.dev/pencil/apis/pencil-public-api.md) · [All operations](https://skmtc.dev/pencil/apis/pencil-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/pencil/apis/pencil-public-api/revisions/2b842698b76d?raw)
