cURL
curl --request POST \ --url https://api.foxapi.cc/v1/files/upload/base64 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data ' { "file_data": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk...", "file_name": "photo.png", "purpose": "image-input" } '
{ "id": "file-abc123def456", "filename": "photo.png", "url": "https://cdn.foxapi.cc/uploads/file-abc123def456.png", "size": 204800, "created": 1757165031 }
Add to request header:
Authorization: Bearer YOUR_API_KEY
Base64-encoded file content
"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk..."
Original filename with extension
"photo.png"
Usage purpose of the uploaded file
"image-input"
File uploaded successfully
File ID
"file-abc123def456"
Original filename
Accessible URL of the uploaded file
"https://cdn.foxapi.cc/uploads/file-abc123def456.png"
File size in bytes
204800
Upload timestamp
1757165031