---
title: "Upload File"
method: POST
path: "/v2/files"
tags: ["Files"]
---

# Upload File

`POST /v2/files`

Request upload URLs for one or more files. Use this for batch uploads or when
uploading files hosted at remote URLs.

Args:
    upload_request (FileUploadRequest): Contains files to upload and workspace UUID.
        - Set remote_uri to fetch files from external URLs
        - Set local_file_path to generate an upload URL for client-side uploads

Returns:
    FileUploadResponse: For each file, includes:
        - file_uuid: Use this to reference the file in eval runs
        - file_url: Upload URL (PUT your file here) or download URL (for remote_uri files)
        - processing_status: "pending" for remote files or videos, "completed" otherwise

Example:
    POST /api/files
    {
        "workspace_uuid": "...",
        "files": [
            {"local_file_path": "data.csv"},
            {"remote_uri": "https://example.com/file.mp4"}
        ]
    }

## Request body

- FileUploadRequest
  - `workspace_uuid` string, nullable — UUID of the workspace to associate with the upload, if any.
  - `files` FileUpload[], required — List of files to upload.
    - `local_file_path` string, nullable — Local file path of the uploaded file, if available.
    - `remote_uri` string, nullable — Remote URI to fetch the file from, if available.
    - `content_type` string, nullable — MIME type of the file (e.g., 'video/mp4'). If not provided, will be inferred from file extension.

## Response `200`

OK

- FileUploadResponse
  - `workspace_uuid` string, nullable — UUID of the workspace associated with the upload, if any.
  - `files` FileUploadResult[], required — List of results for each uploaded file.
    - `local_file_path` string, nullable — Local file path of the uploaded file, if available.
    - `remote_uri` string, nullable — Remote URI to fetch the file from, if available.
    - `content_type` string, nullable — MIME type of the file (e.g., 'video/mp4'). If not provided, will be inferred from file extension.
    - `file_uuid` string, nullable — Unique identifier for the uploaded file.
    - `file_url` string, nullable — URL to access the uploaded file, if available.
    - `remote_file_path` string, nullable — Remote file path of the uploaded file, if available.
    - `processing_status` string — Processing status: pending, processing, completed, or failed.

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found
- `409` — Conflict
- `422` — Unprocessable Entity
- `429` — Too Many Requests
- `500` — Internal Server Error
- `503` — Service Unavailable

---

[API](https://skmtc.net/aymara-ai/apis/aymara-api.md) · [All operations](https://skmtc.net/aymara-ai/apis/aymara-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/aymara-ai/aymara-api/versions/0cb64ef11adf/schema)
