Use the zyo.lol API to upload, list and delete Image Host files and pastes from your own scripts, bots and apps. Every response is JSON with a type of success or error and a message.
/meGet your account
GET/filesList files
POST/filesUpload a file
POST/uploadsStart a direct upload
POST/uploads/completeFinish a direct upload
GET/fileGet a file
POST/fileDelete a file
GET/pastesList pastes
POST/pastesCreate a paste
GET/pasteGet a paste
POST/pasteUpdate or delete a paste
Base URL
All endpoints live under this URL. The API works on the main site, not on short links.
https://zyo.lol/php/images/api
Authentication
You need Image Host Image Host to use the API.
- Create a key. Open Image Host settings and go to Image Host › Settings › API keys · ShareX, then click New key.
- Copy it right away. The key starts with
zyo_and is only shown once. You can also download a ready ShareX config there. - Send it with every request in the
Authorizationheader.Bearer zyo_…works too.
Authorization: zyo_your_key
POST bodies can be JSON or form data. Uploads must be multipart form data.
Anyone with the key can upload and delete your files. If it leaks, revoke it in the same place and create a new one.
Limits
| Limit | Value |
|---|---|
| API requests | 120 per minute per account |
| Uploads | 60 files every 10 minutes |
| Paste changes | 120 creates, updates or deletes every 10 minutes |
| File size | 100 MB, or 250 MB with Premium |
| One-request upload | 95 MB per file with POST /files or ShareX. Use direct upload for bigger files. |
| Storage | 30 GB, or 50 GB with Premium |
| Pastes | 500 per account, 1 MB each |
Uploaded files and pastes are scanned for unsafe content and may be hidden until an admin reviews them.
Uploading big files
There are two ways to upload a file:
- One request with Upload a file, for files up to 95 MB.
- Direct upload in three steps, for anything up to your plan limit. The file goes straight to storage, so it is faster and big files work.
- Start. Send the file name and exact size to
POST /uploads. You get anupload_url, theheadersto send and akey. - Upload.
PUTthe raw file toupload_urlwith exactly those headers. Do not add the Authorization header here. The link expires 10 minutes after step 1, so start the PUT right away. - Finish. Send the
keytoPOST /uploads/complete. You get the same file object as a normal upload.
curl -X PUT "UPLOAD_URL_FROM_STEP_1" \
-H "Content-Type: application/octet-stream" \
--upload-file video.mp4
If the PUT returns 403, the link expired or the size or headers do not match: start again. Files that are never finished are deleted after about 15 minutes.
Errors
Errors use an HTTP status code, and most include a short code you can check in your app.
{ "code": "not_found", "type": "error", "message": "File not found." }
| Status | Code | Meaning |
|---|---|---|
| 400 | invalid | A field is missing or invalid. The message says which. |
| 400 | action | The action field is missing or unknown. |
| 401 | unauthorized | The API key is missing or invalid. |
| 403 | access | Your account does not have Image Host. |
| 404 | not_found | The file or paste does not exist or is not yours. |
| 405 | method | The endpoint does not support this HTTP method. |
| 413 | use_direct_upload | The file is over 95 MB for one request. Use direct upload. |
| 429 | rate_limited | Too many requests. Wait a little and try again. |
| 500 | delete_failed | Deleting failed on our side. Try again later. |
Upload problems such as a file that is too big, an unsupported type or a full storage return status 400 with a message that says what is wrong. A single request over about 100 MB is stopped by Cloudflare with status 413 and an HTML page, before it reaches zyo.lol, so always use direct upload for big files.
Redirected here with status 307
If an API request answers with status 307 and sends you to this page, the API is briefly limited because zyo.lol is receiving unusual traffic. Your request never reached zyo.lol, so nothing was uploaded, changed or deleted.
- Wait and try again. The limit usually lifts within about 10 minutes.
- Create a new key if it keeps happening. Open Image Host settings, click New key and update your app or ShareX.
- Uploading from the zyo.lol panel still works while the API is limited.
Account
Check which account a key belongs to and how much storage is left.
Get your account
/php/images/api/meReturns your username, storage usage and limits. Sizes are in bytes.
Request
curl https://zyo.lol/php/images/api/me \
-H "Authorization: zyo_your_key"
Response
{
"user": { "id": 1, "username": "wowie" },
"usage": { "count": 42, "bytes": 9639060 },
"limits": {
"premium": true,
"quota_bytes": 53687091200,
"max_file_bytes": 262144000
},
"type": "success",
"message": "OK"
}
Files
Upload, list, look up and delete the images and videos on your Image Host.
List files
/php/images/api/filesReturns your files, newest first. When more is true, ask for the next page.
| Field | Description |
|---|---|
page Optional | Page number, starting at 1. |
per_page Optional | Files per page, 1 to 100. Default 50. |
type Optional | image, gif or video. |
sort Optional | newest, oldest, largest, smallest, views or favorites. |
q Optional | Search by file name or code. |
folder Optional | all, fav, none or a folder id. |
Request
curl "https://zyo.lol/php/images/api/files?per_page=10&type=image" \
-H "Authorization: zyo_your_key"
Response
{
"files": [
{
"id": 1042,
"code": "aB3xK9q",
"url": "https://i.zyo.lol/aB3xK9q.png",
"raw": "https://r2.zyo.lol/img/.../aB3xK9q.png",
"filename": "screenshot.png",
"size": "180 KB",
"resolution": "1920×1080",
"video": false,
"kind": "image",
"bytes": 184320,
"embed": "",
"favorite": false,
"anonymous": false,
"folder_id": null,
"views": 12,
"time": 1793023024,
"ago": "3d ago",
"expires": "",
"review": false
}
],
"page": 1,
"more": false,
"type": "success",
"message": "OK"
}
Upload a file
/php/images/api/filesUploads one file as multipart form data in a single request, up to 95 MB. PNG, JPG, GIF, WEBP, MP4, WEBM and MOV files are supported. For bigger files use Start a direct upload. The image field is a file object like the one in List files.
| Field | Description |
|---|---|
file Required | The file to upload. |
embed Optional | large, image, stats, default or a saved embed. |
folder_id Optional | Put the file in one of your folders. |
anonymous Optional | 1 to hide your name on the file page, 0 to show it. Leave it out to use your default. |
Request
curl https://zyo.lol/php/images/api/files \
-H "Authorization: zyo_your_key" \
-F "file=@screenshot.png"
Response
{
"image": {
"code": "aB3xK9q",
"url": "https://i.zyo.lol/aB3xK9q.png",
"raw": "https://r2.zyo.lol/img/.../aB3xK9q.png",
"filename": "screenshot.png"
},
"type": "success",
"message": "Uploaded."
}
Start a direct upload
/php/images/api/uploadsStep 1 of a direct upload, for files of any size up to your plan limit (100 MB, or 250 MB with Premium). Returns a one-time upload link that expires after 10 minutes. Then PUT the file to upload_url with exactly the headers from the response, and call Finish a direct upload.
| Field | Description |
|---|---|
name Required | File name with its extension, for example video.mp4. |
size Required | Exact file size in bytes. |
mime Optional | MIME type, used when the name has no known extension. |
Request
curl https://zyo.lol/php/images/api/uploads \
-H "Authorization: zyo_your_key" \
-H "Content-Type: application/json" \
-d '{"name": "video.mp4", "size": 157286400}'
Response
{
"upload_url": "https://….r2.cloudflarestorage.com/zyo/pending/1/image_….mp4?X-Amz-…",
"method": "PUT",
"headers": {
"Content-Type": "application/octet-stream",
"Content-Length": "157286400"
},
"key": "pending/1/image_7c1f….mp4",
"expires_in": 600,
"type": "success",
"message": "Upload prepared."
}
Finish a direct upload
/php/images/api/uploads/completeStep 3 of a direct upload. Call it right after the PUT finished. The file is checked, saved and returned with status 201, like Upload a file. A key works only once and only for the account that started it.
| Field | Description |
|---|---|
key Required | The key from Start a direct upload. |
name Optional | File name to show. |
embed Optional | Same as in Upload a file. |
folder_id Optional | Put the file in one of your folders. |
anonymous Optional | 1 to hide your name, 0 to show it. |
Request
curl https://zyo.lol/php/images/api/uploads/complete \
-H "Authorization: zyo_your_key" \
-H "Content-Type: application/json" \
-d '{"key": "pending/1/image_7c1f….mp4", "name": "video.mp4"}'
Response
{
"image": {
"code": "aB3xK9q",
"url": "https://i.zyo.lol/aB3xK9q.mp4",
"raw": "https://r2.zyo.lol/img/.../aB3xK9q.mp4",
"filename": "video.mp4"
},
"type": "success",
"message": "Uploaded."
}
Get a file
/php/images/api/fileReturns one of your files by its code.
| Field | Description |
|---|---|
code Required | The file code, for example aB3xK9q. |
Request
curl "https://zyo.lol/php/images/api/file?code=aB3xK9q" \
-H "Authorization: zyo_your_key"
Response
{
"file": { "code": "aB3xK9q", "url": "https://i.zyo.lol/aB3xK9q.png", "views": 12 },
"type": "success",
"message": "OK"
}
Delete a file
/php/images/api/fileDeletes one of your files. This cannot be undone.
| Field | Description |
|---|---|
code Required | The file code. |
action Required | delete |
Request
curl https://zyo.lol/php/images/api/file \
-H "Authorization: zyo_your_key" \
-H "Content-Type: application/json" \
-d '{"code": "aB3xK9q", "action": "delete"}'
Response
{
"type": "success",
"message": "File deleted"
}
Pastes
Create and manage Paste Bin notes and code snippets.
List pastes
/php/images/api/pastesReturns your pastes, recently updated first. Content is not included, use Get a paste for that.
Request
curl https://zyo.lol/php/images/api/pastes \
-H "Authorization: zyo_your_key"
Response
{
"pastes": [
{
"slug": "NbtD5TtH",
"url": "https://i.zyo.lol/NbtD5TtH",
"title": "Notes",
"mode": "markdown",
"locked": false,
"burn": false,
"views": 3,
"expires_at": null
}
],
"type": "success",
"message": "OK"
}
Create a paste
/php/images/api/pastesCreates a paste and returns it with status 201. New pastes are scanned for unsafe content shortly after they are saved.
| Field | Description |
|---|---|
content Required | The text, up to 1 MB. |
title Optional | Up to 120 characters. |
mode Optional | markdown, text or code. Default markdown. |
language Optional | Code language when mode is code. |
slug Optional | Custom link, 3 to 32 letters, numbers, - or _. |
expires Optional | Hours until it expires: 12, 24, 72, 168 or 720. 0 or nothing means never. |
password Optional | Ask for a password before showing the paste. |
burn Optional | 1 to delete it after the first view. |
anonymous Optional | 1 to hide your name. |
Request
curl https://zyo.lol/php/images/api/pastes \
-H "Authorization: zyo_your_key" \
-H "Content-Type: application/json" \
-d '{"title": "Notes", "content": "# Hello"}'
Response
{
"paste": { "slug": "NbtD5TtH", "url": "https://i.zyo.lol/NbtD5TtH", "title": "Notes" },
"type": "success",
"message": "Paste created."
}
Get a paste
/php/images/api/pasteReturns one of your pastes with its content.
| Field | Description |
|---|---|
slug Required | The paste slug. |
Request
curl "https://zyo.lol/php/images/api/paste?slug=NbtD5TtH" \
-H "Authorization: zyo_your_key"
Response
{
"paste": { "slug": "NbtD5TtH", "title": "Notes", "content": "# Hello" },
"type": "success",
"message": "OK"
}
Update or delete a paste
/php/images/api/pasteUpdates only the fields you send and keeps the rest, or deletes the paste.
| Field | Description |
|---|---|
slug Required | The paste slug. |
action Required | update or delete |
clear_password Optional | 1 to remove the password. |
other fields Optional | Any field from Create a paste. Send slug once to find the paste, it cannot be renamed here. |
Request
curl https://zyo.lol/php/images/api/paste \
-H "Authorization: zyo_your_key" \
-H "Content-Type: application/json" \
-d '{"slug": "NbtD5TtH", "action": "update", "title": "New title"}'
Response
{
"paste": { "slug": "NbtD5TtH", "title": "New title" },
"type": "success",
"message": "Paste saved."
}