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

# List files

`GET /files`

## Request

- Base URL: `https://api.parley.so/v1`
- URL: `https://api.parley.so/v1/files`
- Auth: HTTP bearer

List the files and folders of one location, newest first by default: pass exactly one of projectId, accountId, contactId, intakeId, or library=true. Starts at the location's top level: pass folderId to list inside a folder, and recursive=true to include everything below. Returns 400 INVALID_REFERENCE when the location or folder doesn't exist or you can't see it.

## Query parameters

- `projectId` string: List this project's files. Pass exactly one of projectId, accountId, contactId, intakeId, or library.
- `accountId` string: List this account's files. Pass exactly one of projectId, accountId, contactId, intakeId, or library.
- `contactId` string: List this contact's files. Pass exactly one of projectId, accountId, contactId, intakeId, or library.
- `intakeId` string: List this intake's files. Pass exactly one of projectId, accountId, contactId, intakeId, or library.
- `library` unknown
- `folderId` string: List inside this folder, which must be in the location. Omit to start at the top level.
- `recursive` boolean: Include everything below the starting point, not just the files and folders directly in it.
- `search` string: Case-insensitive. Only files and folders whose name contains this text.
- `type` 'file' | 'folder': Only files, or only folders.
- `createdSince` string: Only records created at or after this time. An ISO 8601 date (YYYY-MM-DD, read as UTC midnight) or date-time.
- `createdBefore` string: Only records created before this time. An ISO 8601 date (YYYY-MM-DD, read as UTC midnight) or date-time.
- `updatedSince` string: Only records last updated at or after this time. An ISO 8601 date (YYYY-MM-DD, read as UTC midnight) or date-time.
- `updatedBefore` string: Only records last updated before this time. An ISO 8601 date (YYYY-MM-DD, read as UTC midnight) or date-time.
- `sort` 'name' | '-name' | 'createdAt' | '-createdAt' | 'updatedAt' | '-updatedAt': Sort order: a field name, prefixed with - for descending. Defaults to -createdAt.
- `cursor` string: Opaque cursor from nextCursor. Pass the same filters and sort. Omit for the first page.
- `limit` integer: Maximum number of items to return.

## Response `200`

OK

- object
  - `data` File[], required
    - union: A file or a folder, told apart by type.
      - FileItem
        - `type` 'file', required
        - `id` string, required: The file or folder ID.
        - `name` string, required: The name, including any file extension.
        - `location` union, required: Whose files these are: a project's, an account's, a contact's, or an intake's, or the organization's Library.
          - RecordRef: A reference to a project, account, or contact.
            - `type` 'project' | 'account' | 'contact', required: The kind of record: project, account, or contact.
            - `id` string, required: Its ID.
            - `name` string, required: The record's name. A contact's is its first and last name, or an email address when it has no name.
          - object: The intake's type, ID, and name.
            - `type` 'intake', required
            - `id` string, required: Its ID.
            - `name` string, required: The intake title.
          - object: The organization's shared Library.
            - `type` 'library', required
        - `folder` object, nullable, required: The folder's type, ID, and name.
          - `type` 'folder', required
          - `id` string, required: Its ID.
          - `name` string, required: The folder name.
        - `createdAt` string, date-time, required: When it was added.
        - `updatedAt` string, date-time, required: When it was last updated, including processing, renames, and moves.
        - `mediaType` string, nullable, required: The file's media type, such as application/pdf, from its extension, or null when the extension isn't recognized.
        - `status` 'pending' | 'processing' | 'ready' | 'failed', required: Whether Parley has extracted the file's text: pending (queued), processing, ready (its text can be read), or failed (download it instead).
      - FolderItem
        - `type` 'folder', required
        - `id` string, required: The file or folder ID.
        - `name` string, required: The name, including any file extension.
        - `location` union, required: Whose files these are: a project's, an account's, a contact's, or an intake's, or the organization's Library.
          - RecordRef: A reference to a project, account, or contact.
            - `type` 'project' | 'account' | 'contact', required: The kind of record: project, account, or contact.
            - `id` string, required: Its ID.
            - `name` string, required: The record's name. A contact's is its first and last name, or an email address when it has no name.
          - object: The intake's type, ID, and name.
            - `type` 'intake', required
            - `id` string, required: Its ID.
            - `name` string, required: The intake title.
          - object: The organization's shared Library.
            - `type` 'library', required
        - `folder` object, nullable, required: The folder's type, ID, and name.
          - `type` 'folder', required
          - `id` string, required: Its ID.
          - `name` string, required: The folder name.
        - `createdAt` string, date-time, required: When it was added.
        - `updatedAt` string, date-time, required: When it was last updated, including processing, renames, and moves.
  - `nextCursor` string, nullable, required: Cursor for the next page, or null on the last page.

## Other responses

- `400`: The request was invalid. VALIDATION_FAILED, INVALID_CURSOR, INVALID_REFERENCE.
- `401`: Missing or invalid credentials. UNAUTHORIZED.
- `403`: You don't have permission. FORBIDDEN.
- `429`: Too many requests, or a usage limit was reached. TOO_MANY_REQUESTS.

---

[API](https://skmtc.dev/parley/apis/parley-api.md) - [All operations](https://skmtc.dev/parley/apis/parley-api/llms.txt) - [OpenAPI document](https://skmtc.dev/parley/apis/parley-api/revisions/6b78aeee07bc?raw)
