Skip to main content
POST
Create file
This page documents the Legacy API. For new integrations, use Create File in the Current API.

Yetkilendirmeler

Authorization
string
header
gerekli

An Account API key, account-scoped JWT, App API key, or user OAuth token. Prepend the key or token with Bearer, for example Bearer ***************************.

Gövde

application/json

Parameters for CreateFile

filename
string
gerekli

The name of the file including its extension (e.g., "photo.png" or "document.pdf").

visibility
enum<string> | null

Controls whether the file is publicly accessible via CDN or requires authentication. Defaults to private.

Mevcut seçenekler:
public,
private

Yanıt

A successful response

A file that has been uploaded or is pending upload.

content_type
string | null
gerekli

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

Örnek:

"image/jpeg"

filename
string | null
gerekli

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

Örnek:

"document.pdf"

id
string
gerekli

The unique identifier for the file.

Örnek:

"file_xxxxxxxxxxxxx"

size
string | null
gerekli

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

Örnek:

"123.45"

upload_headers
object | null
gerekli

Headers to include in the upload request. Only present in the response from the create mutation.

upload_status
enum<string>
gerekli

The current upload status of the file (e.g., pending, ready).

Mevcut seçenekler:
pending,
processing,
ready,
failed
upload_url
string | null
gerekli

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

Örnek:

"https://media.whop.com/uploads/presigned"

url
string | null
gerekli

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
enum<string>
gerekli

Whether the file is publicly accessible or requires authentication.

Mevcut seçenekler:
public,
private