Imagify

Upload API reference

Send a file or a remote URL and get a compact, shareable link back. No SDK and no API key, just standard HTTP.

Base URL https://imagify-host.pages.dev

Quick start

Upload a local file with one command. The response contains a short link in src.

curl -X POST https://imagify-host.pages.dev/upload -F "file=@photo.jpg"

If upload protection is on, add your code in the x-upload-code header. See Upload code.

Upload a file

POST/uploadmultipart/form-data

Send the file in the file field. The endpoint returns an array with one result per file.

curl -X POST https://imagify-host.pages.dev/upload \
  -H "x-upload-code: YOUR_CODE" \
  -F "file=@photo.jpg"

Upload from a URL

POST/uploadapplication/json

Let the server fetch remote files for you. Send one url or an array of urls.

curl -X POST https://imagify-host.pages.dev/upload \
  -H "content-type: application/json" \
  -d '{"url":"https://example.com/photo.jpg"}'

Upload code

When the owner sets an upload code, uploads need it. Send it in any one of these places:

  • the x-upload-code header (recommended)
  • an Authorization: Bearer YOUR_CODE header
  • the ?authCode=YOUR_CODE query parameter

Cross-origin requests are allowed, so you can call /upload from a browser app too.

Response

A successful upload returns an array of file objects. Use src for the short link.

JSON
[
  {
    "src": "/s/Ab3xK9.jpg",
    "long": "/file/<id>.jpg",
    "id": "<id>",
    "name": "photo.jpg",
    "size": 123456,
    "type": "image/jpeg"
  }
]
FieldMeaning
srcShort link, such as /s/Ab3xK9.jpg
longDirect link that includes the file id
idFile id, used by the admin endpoints
name, size, typeStored file name, size in bytes and detected MIME type

Query options

ParameterEffect
?returnFormat=fullReturn absolute URLs instead of relative paths
?channel=r2 or ?channel=telegramChoose a storage channel that is configured on the server

Errors

Errors return JSON with an error message.

StatusWhen it happens
400No file or URL was sent, the file type is not allowed, or the channel is not available
401An upload code is required and was missing or wrong
500The server is not fully set up. The message says what is missing

Admin endpoints

These need a signed-in admin session, or an Authorization: Bearer header with the admin password.

POST/uploadUpload a file or remote URLs
GET/api/sessionSession and setup status
GET/api/files?cursor=List uploaded files
DELETE/api/filesDelete files by id
Delete a file
curl -X DELETE "https://imagify-host.pages.dev/api/files" \
  -H "content-type: application/json" \
  -H "Authorization: Bearer YOUR_ADMIN_PASSWORD" \
  -d '{"ids":["FILE_ID"]}'