---
title: "Query stored files"
method: GET
path: "/v1/projects/{project_id}/files"
tags: ["StoredFile"]
---

# Query stored files

`GET /v1/projects/{project_id}/files`

## Request

- Base URL: `https://api.telerivet.com`
- URL: `https://api.telerivet.com/v1/projects/{project_id}/files`
- Auth: one of:
  - HTTP basic
  - OAuth 2 (authorization code, authorization URL `https://telerivet.com/oauth/authorize`, token URL `https://api.telerivet.com/oauth/token`)

Queries files stored within the given project.

## Path parameters

- `project_id` string, required

## Query parameters

- `filename` string
- `type` string
- `category` 'outgoing_media' | 'incoming_media' | 'call_audio' | 'test_recording' | 'script_module' | 'icon'
- `source` 'upload' | 'recording' | 'message' | 'api'
- `size` integer
- `time_created` integer: Unix timestamp in seconds
- `message_id` string: ID of Message
- `sha256` string
- `sort` 'default' | 'filename' | 'size' | 'time_created'
- `sort_dir` 'asc' | 'desc'
- `page_size` integer
- `offset` integer
- `marker` string
- `count` boolean

## Response `200`

Successful response. When count=1 parameter is provided, returns {"count": N} instead.

- object
  - `data` StoredFile[]: Array of results (omitted when count=1)
    - `id` string: ID of the stored file
    - `filename` string: Filename of the stored file
    - `type` string: MIME type of the file
    - `size` integer: Size of the file in bytes
    - `description` string, nullable: Description of the file
    - `vars` object: Custom variables stored for this stored file. Variable names may be up to 32 characters in length and can contain the characters a-z, A-Z, 0-9, and _. Values may be strings, numbers, or boolean (true/false). String values may be up to 4096 bytes in length when encoded as UTF-8. Up to 100 variables are supported per object. Setting a variable to null will delete the variable.
    - `category` 'outgoing_media' | 'incoming_media' | 'call_audio' | 'test_recording' | 'script_module' | 'icon': Category of the stored file
    - `source` 'upload' | 'recording' | 'message' | 'api': How the stored file was created
    - `message_id` string, nullable: ID of the message associated with this file, if any. Files associated with a message are deleted automatically when the message is deleted.
    - `sha256` string, nullable: SHA-256 hash of the file content (lowercase hex), if available
    - `time_created` integer: Time the file was created in Telerivet
    - `user_id` string, nullable: ID of the Telerivet user who created the file (if applicable)
    - `url` string: URL where the file content can be downloaded. Note: this URL is temporary and may not be valid for more than 1 day; retrieve the stored file again to get a fresh URL.
    - `thumbnail_url` string, nullable: URL of a thumbnail image for video files, if available. Note: this URL is temporary and may not be valid for more than 1 day.
    - `project_id` string: ID of the project this file belongs to
  - `truncated` boolean: True if there are more results
  - `next_marker` string: Marker for pagination
  - `page_size` integer: Number of results per page
  - `sort_dir` 'asc' | 'desc': Sort direction
  - `count` integer: Total count of matching items (only when count=1 parameter is provided)

## Other responses

- `400`: Invalid request parameters
- `401`: Invalid or missing API key or Bearer token
- `404`: Resource not found

---

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