# Files (/docs/api/files)

Upload source files for deck generation.

## Upload File

`POST https://api.presentations.ai/api/v1/files`

Upload a file and enqueue extraction.

Up to 150 MB. Accepted: PDF, PPTX, DOCX, XLS/XLSX, TXT, CSV, TSV, Markdown, HTML,
JSON, EPUB, PNG, JPEG and WebP, and code files (.py, .js, .jsx, .ts, .tsx, .java, .go,
.cs, .sql, .yaml, .yml, .sh). Its extracted text counts toward the plan's content limit
when used as a deck source.

**Request body** (`multipart/form-data`): Body_uploadFile

**Responses**

- `201`: ExternalFileResponse — Successful Response
- `400`: APIErrorResponse — The file can't be read: an unsupported type or over the size limit (VALIDATION_FAILED), or a pre-2007 Office format (LEGACY_OFFICE_FORMAT).
- `401`: APIErrorResponse — Missing, malformed, expired, or revoked Bearer API key. `error.code`: `UNAUTHENTICATED`, `INVALID_TOKEN`.
- `403`: APIErrorResponse — The API key, workspace role, project scope, or plan lacks permission. `error.code`: `FORBIDDEN`, `FEATURE_NOT_IN_PLAN`, `PLAN_LIMIT_EXCEEDED`.
- `422`: RequestValidationErrorResponse — A path, query, header, or request-body field failed validation. `error.code`: `VALIDATION_FAILED`.
- `429`: APIErrorResponse — The caller exceeded the API rate limit. `error.code`: `RATE_LIMITED`.
- `500`: APIErrorResponse — Unexpected server failure. Retry only idempotent operations and retain trace_id. `error.code`: `INTERNAL_ERROR`.

## Get File

`GET https://api.presentations.ai/api/v1/files/{file_id}`

Get file metadata and extraction status.

**Path parameters**

- `file_id` (string (uuid), required) — ID of the uploaded file, from `POST /files`.

**Responses**

- `200`: ExternalFileStatusResponse — Successful Response
- `401`: APIErrorResponse — Missing, malformed, expired, or revoked Bearer API key. `error.code`: `UNAUTHENTICATED`, `INVALID_TOKEN`.
- `403`: APIErrorResponse — The API key, workspace role, project scope, or plan lacks permission. `error.code`: `FORBIDDEN`, `FEATURE_NOT_IN_PLAN`, `PLAN_LIMIT_EXCEEDED`.
- `404`: APIErrorResponse — The resource does not exist or is outside the caller's scope. `error.code`: `NOT_FOUND`.
- `422`: RequestValidationErrorResponse — A path, query, header, or request-body field failed validation. `error.code`: `VALIDATION_FAILED`.
- `429`: APIErrorResponse — The caller exceeded the API rate limit. `error.code`: `RATE_LIMITED`.
- `500`: APIErrorResponse — Unexpected server failure. Retry only idempotent operations and retain trace_id. `error.code`: `INTERNAL_ERROR`.

## Delete File

`DELETE https://api.presentations.ai/api/v1/files/{file_id}`

Delete an uploaded file and any extraction state, including a hung extraction.

**Path parameters**

- `file_id` (string (uuid), required) — ID of the uploaded file, from `POST /files`.

**Responses**

- `204` — Successful Response
- `401`: APIErrorResponse — Missing, malformed, expired, or revoked Bearer API key. `error.code`: `UNAUTHENTICATED`, `INVALID_TOKEN`.
- `403`: APIErrorResponse — The API key, workspace role, project scope, or plan lacks permission. `error.code`: `FORBIDDEN`, `FEATURE_NOT_IN_PLAN`, `PLAN_LIMIT_EXCEEDED`.
- `404`: APIErrorResponse — The resource does not exist or is outside the caller's scope. `error.code`: `NOT_FOUND`.
- `422`: RequestValidationErrorResponse — A path, query, header, or request-body field failed validation. `error.code`: `VALIDATION_FAILED`.
- `429`: APIErrorResponse — The caller exceeded the API rate limit. `error.code`: `RATE_LIMITED`.
- `500`: APIErrorResponse — Unexpected server failure. Retry only idempotent operations and retain trace_id. `error.code`: `INTERNAL_ERROR`.

# Schemas

### AsyncTaskStatus

Lifecycle state of an async task: CREATED (queued), RUNNING, then COMPLETED or FAILED.

One of: `CREATED`, `RUNNING`, `COMPLETED`, `FAILED`

### Body_uploadFile

- `file` (string, required)

### ExternalFileResponse

External upload response keyed only by file ID.

- `file_id` (string (uuid), required) — Pass in a `file` source to outline or deck creation.
- `filename` (string, required) — Original filename, for display.
- `status` (AsyncTaskStatus, required) — Text-extraction state; the file is usable once `COMPLETED`.
- `created_at` (string (date-time), required) — Upload time.

### ExternalFileStatusResponse

External file metadata and extraction status keyed only by file ID.

- `file_id` (string (uuid), required) — File id.
- `filename` (string, required) — Original filename, for display.
- `status` (AsyncTaskStatus, required) — Text-extraction state; the file is usable once `COMPLETED`. Null when no extraction task exists.
- `error` (string, required) — Extraction failure message; null unless `FAILED`.
- `size_bytes` (integer, required) — Uploaded file size in bytes.
- `content_type` (string, required) — MIME type of the uploaded file.
- `char_count` (integer, required) — Characters of extracted text; null before extraction.
- `content_sha256` (string, required) — Hex SHA-256 of the extracted text; null before extraction.
- `extracted_at` (string (date-time), required) — When extraction finished; null before then.
- `created_at` (string (date-time), required) — Upload time.