---
title: "Generate Presigned Url"
method: PUT
path: "/api/v1/files"
tags: ["Files"]
---

# Generate Presigned Url

`PUT /api/v1/files`

Create a presigned URL for uploading a file.

The URL is valid for a limited time. Use it to upload the file
content directly to storage via an HTTP PUT request.

## Query parameters

- `expires_at_seconds` integer, nullable
- `project_id` string, uuid, nullable
- `organization_id` string, uuid, nullable

## Cookies

- `session` string, nullable

## Request body

- FileCreate — Schema for creating a file.
  - `name` string, required — Name that will be used for created file. If possible, always include the file extension in the name.
  - `external_file_id` string, nullable — The ID of the file in the external system
  - `file_size` integer, nullable — Size of the file in bytes
  - `last_modified_at` string, date-time, nullable — The last modified time of the file
  - `resource_info` object, nullable — Resource information for the file
  - `permission_info` object, nullable — Permission information for the file
  - `data_source_id` string, uuid, nullable — The ID of the data source that the file belongs to
  - `storage_type` union — Storage type for the file. Valid values: 'Ephemeral', 'Permanent' (no expiration). If not specified, defaults to permanent storage.
    - 'ephemeral' | 'permanent'
    - string

## Response `200`

Successful Response

- FileIdPresignedUrl — Schema for a presigned URL with a file ID.
  - `url` string, uri, required — A presigned URL for IO operations against a private file
  - `expires_at` string, date-time, required — The time at which the presigned URL expires
  - `form_fields` object, nullable — Form fields for a presigned POST request
  - `file_id` string, uuid, required — The ID of the file associated with the presigned URL

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/run-llama/apis/llama-platform.md) · [All operations](https://skmtc.dev/run-llama/apis/llama-platform/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/run-llama/llama-platform/revisions/01ac7197eb4a/schema)
