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

# Create file

`POST /files`

Create a new file record and receive a presigned URL for uploading content to S3.

## Request body

- object — Parameters for CreateFile
  - `filename` string, required — The name of the file including its extension (e.g., "photo.png" or "document.pdf").
  - `visibility` 'public' | 'private' — Controls whether an uploaded file is publicly accessible or requires authentication to access.

## Response `200`

A successful response

- object — A file that has been uploaded or is pending upload.
  - `content_type` string, nullable, required — The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg).
  - `filename` string, nullable, required — The original filename of the uploaded file, including its file extension.
  - `id` string, required — The unique identifier for the file.
  - `size` string, nullable, required — The file size in bytes. Null if the file has not finished uploading.
  - `upload_headers` object, nullable, required — Headers to include in the upload request. Only present in the response from the create mutation.
  - `upload_status` 'pending' | 'processing' | 'ready' | 'failed', required — The upload status of a file
  - `upload_url` string, nullable, required — The presigned URL to upload the file contents to. Only present in the response from the create mutation.
  - `url` string, nullable, required — The URL for accessing the file. For public files, this is a permanent CDN URL. For private files, this is a signed URL that expires. Null if the file has not finished uploading.
  - `visibility` 'public' | 'private', required — Controls whether an uploaded file is publicly accessible or requires authentication to access.

## Other responses

- `400` — Bad request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not found
- `422` — Verification required
- `429` — Too many requests
- `500` — Internal server error

---

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