---
title: "Upload File"
method: POST
path: "/tools/files/upload"
tags: ["tools > file"]
---

# Upload File

`POST /tools/files/upload`

## Request

- Base URL: `https://api.pinnacle.sh`
- URL: `https://api.pinnacle.sh/tools/files/upload`
- Auth: API key in header `PINNACLE-API-KEY`

Generate presigned URLs that let you upload files directly to our storage and allow your users to download them securely.

## Request body

- FileUploadSchema
  - `contentType` string, required: MIME type of your file. <br> Supported file types: - Audio: mp3, mp4, mpeg, ogg, aac, webm, wav, 3gpp, amr - Video: mp4, mpeg, quicktime, webm, 3gpp, H.264, m4v - Image: jpeg, png, gif, bmp, tiff, webp - Documents: pdf, csv, rtf, calendar, vcard
  - `size` integer, required: Size of your file in bytes. Should be less than 100 MB.
  - `name` string: Name of your file.
  - `options` UploadFileOptions: Additional configurations for your file.
    - `deleteAt` string: Set a deletion date for your file in ISO 8601 format. After this date, the file will be automatically deleted from our storage.<br> If this field is not provided, the file will not be deleted. You can still schedule deletion or delete the file manually in the Storage page in the dashboard.
    - `download` DownloadOptions: Configure download settings for your uploaded file.
      - `expiresAt` string: Set an expiration date for file download access.<br> If this field is not provided, then a short permalink is generated instead.

## Response `200`

Successfully uploaded the file.

- PinnacleFileUpload
  - `uploadUrl` string, required: Presigned URL for uploading your file to storage.
  - `downloadUrl` string, required: Presigned URL for downloading your file.
  - `metadata` PinnacleFileUploadMetadata, required
    - `fileName` string, required: Name of the uploaded file.
    - `contentType` string, required: MIME type of the file.
    - `expiresAt` string, nullable, required: Expiration date in ISO 8601 format for file download access.<br> Null indicates that `download.expiresAt` was not provided and the expiration time is defaulted to one hour after uploading.
    - `deleteAt` string, nullable: Deletion date for the file in ISO 8601 format. After this date, the file will be automatically deleted from our storage.<br> If this field is not provided, the file will not be deleted. You can still schedule deletion or delete the file manually in the Storage page in the dashboard.

## Other responses

- `400`: Validation failed. The payload has missing required fields and/or invalid types. <br> See https://zod.dev/error-formatting for more information.
- `401`: The request lacks valid authentication credentials or the provided credentials are invalid. <br> Ensure you're including a valid API key in the request headers and that your account has the necessary permissions to access this endpoint.
- `403`: Your subscription does not include access to this feature. <br> This occurs when attempting to use functionality that requires a higher subscription tier. Please upgrade your subscription to access this feature.
- `500`: An unexpected error occurred on Pinnacle's servers while processing your request. <br> If this error persists, please contact support with the request details.

---

[API](https://skmtc.dev/pinnacle/apis/pinnacle-2.md) - [All operations](https://skmtc.dev/pinnacle/apis/pinnacle-2/llms.txt) - [OpenAPI document](https://skmtc.dev/pinnacle/apis/pinnacle-2/revisions/45416dadab79?raw)
