E-Z LogoE-Z Wiki

File Upload API

Upload files to E-Z.host with automatic Cloudflare CDN distribution.

Endpoint

POST /files

Authentication Required

Headers

HeaderValueDescription
keyYOUR_API_KEYYour API key for authentication

Request Body

Form data with the following field:

FieldTypeDescription
fileFileThe file to upload

Example Request

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

Response

Success Response

{
  "success": true,
  "message": "File Uploaded",
  "imageUrl": "https://hentai.expert/q6j5a001.png",
  "rawUrl": "https://r2.e-z.host/ca19848c-de8c-4cae-9a10-858d6fd864b7/q6j5a001.png",
  "deletionUrl": "https://api.e-z.host/files/delete?key=random-deletion-key"
}

Response Fields

FieldDescription
successBoolean indicating if the request was successful
messageStatus message
imageUrlPublic URL for viewing the uploaded file
rawUrlDirect CDN URL for the uploaded file
deletionUrlURL to delete the uploaded file

Error Handling

Common error responses:

  • 400 Bad Request: Missing file or invalid file format
  • 401 Unauthorized: Invalid or missing API key
  • 413 Payload Too Large: File size exceeds the limit
  • 422 Unprocessable Entity: File validation failed
  • 429 Too Many Requests: Rate limit exceeded (3 requests per 15 seconds)

Error Response Format

{
  "success": false,
  "error": "Error description"
}

Rate Limiting

This endpoint is subject to the global rate limit of 3 requests per 15 seconds per API key.

File Types

E-Z.host supports various file types. Ensure your file is a valid format and meets the size requirements.

Need Help?

If you need assistance with the file upload API: