v8

OpenAPI 3.1.02026-08-033623795.0 MB
Files

Create file

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

post/files

Request body

filenamestring 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

A successful response

content_typestring nullable required

The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg).

filenamestring nullable required

The original filename of the uploaded file, including its file extension.

idstring required

The unique identifier for the file.

sizestring nullable required

The file size in bytes. Null if the file has not finished uploading.

upload_headersobject 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_urlstring nullable required

The presigned URL to upload the file contents to. Only present in the response from the create mutation.

urlstring 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.

Example response

{
  "content_type": "image/jpeg",
  "filename": "document.pdf",
  "id": "file_xxxxxxxxxxxxx",
  "size": "123.45",
  "upload_url": "https://media.whop.com/uploads/presigned"
}