Skip to main content
POST
/
storage
/
upload
JavaScript
const formData = new FormData();
const fileInput = document.querySelector('input[type="file"]');
formData.append('file', fileInput.files[0]);
formData.append('path', 'documents/invoices/');

const response = await fetch('https://api.worqhat.com/storage/upload', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY'
  },
  body: formData
});
const data = await response.json();
{
  "success": true,
  "file": {
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "filename": "invoice_2025.pdf",
    "path": "org_123/documents/invoices/invoice_2025.pdf",
    "size": 245678,
    "contentType": "application/pdf",
    "uploadedAt": "2025-07-26T03:28:08.123Z",
    "url": "https://storage.worqhat.com/org_123/documents/invoices/invoice_2025.pdf"
  }
}

Authorizations

Authorization
string
header
required

API key authentication. Format - "Bearer YOUR_API_KEY"

Body

multipart/form-data
file
file
required

File to upload (max 50MB)

path
string

Optional custom path within organization storage

Example:

"documents/invoices/"

Response

File uploaded successfully

success
boolean
Example:

true

file
object
I