Skip to content
Bakhtarian edited this page May 14, 2026 · 1 revision

File

A file is an uploaded asset (image, video, document, etc.) referenced by Whop resources such as products, courses, and messages. The SDK exposes a single endpoint that creates a file record and returns a presigned URL the client then uploads the bytes to directly.

SDK access

$client->files // Matchable\Whop\Resource\FileResource

Endpoints

create(string $filename): array

HTTP POST files
Does Creates a file record and returns a presigned upload URL. The request body is { "filename": $filename }.
Parameters $filename — the name of the file to be uploaded.
Returns array — the decoded API response, including the file record and presigned upload URL.

Note: this resource exposes only create. Uploading the actual file bytes is done by the caller against the returned presigned URL — it is not an SDK call.

Example

$file = $client->files->create('lesson-thumbnail.png');
// $file contains the file record and a presigned URL to PUT the bytes to.

Reference

Official Whop documentation: https://docs.whop.com

Clone this wiki locally