---
title: "Upload a file"
method: POST
path: "/files"
tags: ["Files"]
---

# Upload a file

`POST /files`

## Request

- Base URL: `https://app.gc.ai/api/external/v1`
- URL: `https://app.gc.ai/api/external/v1/files`
- Auth: API key in header `Authorization`
- TypeScript: <https://skmtc.dev/gc-ai/apis/gc-ai-external-api/docs/files/post.ts> (a function with typed inputs; its response is checked against the schema)

Upload a file to GC AI for processing and storage. Files are uploaded as multipart form data and automatically processed (text extraction, summarization, and embedding creation).

With a user-scoped key, files default to the user's "My Files" folder. With an org-scoped key, files default to the "Organization Files" folder and the `my-files` scope is not available.

For PDFs and Word documents, extraction runs asynchronously. Poll `GET /files/{id}` until `status` is `ready`.

## Request body `multipart/form-data`

- FileUploadRequest
  - `file` string, binary, required: The file to upload
  - `folder_id` string, uuid: Target folder ID. Defaults to the user's "My Files" folder. Mutually exclusive with `project_id` and `scope`.
  - `project_id` string, uuid: Upload the file into a project. The file is placed in the project's upload folder and linked to the project. Mutually exclusive with `folder_id` and `scope`.
  - `scope` 'my-files' | 'organization': Upload to the root of a meta-collection ("my-files" or "organization"). Mutually exclusive with `folder_id` and `project_id`. `shared-with-me` is not valid for upload.

## Response `200`

File uploaded successfully

- FileResponse
  - `id` string, uuid, required: Unique file identifier
  - `name` string, required: Original filename
  - `size` number, required: File size in bytes
  - `content_type` string, required: MIME type of the file
  - `status` 'extracting' | 'embedding' | 'ready' | 'failed', required: Current processing status of the file
  - `created_at` string, required: ISO 8601 creation timestamp
  - `folder_id` string, uuid, nullable: Folder the file belongs to
  - `extraction_error` string: Error message if extraction failed
  - `project_id` string, uuid: Project the file is linked to, if uploaded with project_id
  - `warning` string: Present when the file was uploaded successfully but a secondary operation (e.g. project linking) failed

## Other responses

- `400`: Invalid request (unsupported file type, empty content, etc.)
- `401`: Missing or malformed API key
- `403`: Project access required
- `404`: Project not found
- `429`: Rate limit exceeded. See [Rate Limits](https://docs.gc.ai/api-reference/concepts/rate-limits) for the tiers, limits, and how to back off.
- `500`: Internal server error
- `503`: Service temporarily unavailable

---

[API](https://skmtc.dev/gc-ai/apis/gc-ai-external-api.md) - [All operations](https://skmtc.dev/gc-ai/apis/gc-ai-external-api/llms.txt) - [OpenAPI document](https://skmtc.dev/gc-ai/apis/gc-ai-external-api/revisions/2bbdfddf7107?raw)
