E-Z Logo

Upload API Documentation

Learn how to upload files using our API

Endpoint: /files/

POSTUpload files to the E-Z.host API

Valid File MIME Types

  • Image
  • Video
  • Audio
  • Application

Headers

NameValueDescription
Content-Typemultipart/form-dataThe type of the request body.
keyYour API keyYour API key for authentication.

Body

NameTypeDescription
filefile (multipart)The file to upload

Example Request

Here's how you can upload a file:

bash
curl -X POST 'https://api.e-z.host/files' \
  -H 'key: YOUR_API_KEY' \
  -F 'file=@/path/to/file'

Response

Successful response example:

json
{
  "success": true,
  "message": "File Uploaded",
  "imageUrl": "https://i.e-z.host/filename",
  "rawUrl": "https://r2.e-z.host/uuid/filename",
  "deletionUrl": "https://api.e-z.host/delete?key=random-deletion-key"
}

File Size Limits

Standard: 25MBPremium: 100MB

Error Handling

Possible error responses include:

  • 400 Bad Request: Invalid file type.
  • 401 Unauthorized: Invalid API key.
  • 403 Forbidden: File size limit exceeded.
  • 422 Unprocessable Entity: Validation error due to missing or invalid parameters.
  • 429 Too Many Requests: Rate limit exceeded.

Need Help?

If you need assistance with our Upload API, feel free to: