Skip to main content
GET
/
files
/
{id}
JavaScript
import Whop from '@whop/sdk';

const client = new Whop({
  apiKey: process.env['WHOP_API_KEY'], // This is the default and can be omitted
});

const file = await client.files.retrieve('file_xxxxxxxxxxxxx');

console.log(file.id);
{
  "id": "file_xxxxxxxxxxxxx",
  "upload_status": "pending",
  "filename": "document.pdf",
  "content_type": "image/jpeg",
  "size": "123.45",
  "url": "https://media.whop.com/abc123/document.pdf"
}

Authorizations

Authorization
string
header
required

A company API key, company scoped JWT, app API key, or user OAuth token. You must prepend your key/token with the word 'Bearer', which will look like Bearer ***************************

Path Parameters

id
string
required

The unique identifier of the file to retrieve.

Example:

"file_xxxxxxxxxxxxx"

Response

A successful response

A file that has been uploaded or is pending upload.

id
string
required

The unique identifier for the file.

Example:

"file_xxxxxxxxxxxxx"

upload_status
enum<string>
required

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

Available options:
pending,
processing,
ready,
failed
filename
string | null
required

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

Example:

"document.pdf"

content_type
string | null
required

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

Example:

"image/jpeg"

size
string | null
required

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

Example:

"123.45"

url
string | null
required

The CDN URL for accessing the file. Null if the file has not finished uploading.

Example:

"https://media.whop.com/abc123/document.pdf"