I
Image Hosting API
# Documentations
Your go-to ultra-fast image hosting API. Upload, fetch, and delete images via a single endpoint.
**Base URL:**
```
https://gkapi.jojapi.net
```
To authenticate, users must include:
```
X-JoJAPI-Key: YOUR_API_KEY
```
* * *
## 📸 What This API Can Do
* **Single Upload:** File, base64, remote URL, data URI.
* **Bulk Upload:** Upload up to 100 images at once.
* **Retrieve:** Direct image URLs.
* **Delete:** Secure delete links.
* **Caching:** Automatic CDN caching for super-fast delivery.
* **Expiration:** Optional auto-delete timer.
* * *
## 🛠️ Uploading Images (Single)
**Endpoint:** `POST /upload`
Send a request with **any** of the supported input types:
### **Input Field:**
```
image
```
### **Optional Fields:**
* **name**: Custom filename (no extension needed)
* **expiration**: Unix timestamp in seconds. `0` means never.
### **Supported Content Types**
* `multipart/form-data`
* `application/json`
* `application/x-www-form-urlencoded`
* * *
## 🚀 Bulk Uploading Images (New)
**Endpoint:** `POST /bulk-upload`
Upload multiple images in a single request. This process is asynchronous: you will receive a `batchId` to poll for status.
### **Input Field:**
```
files[]
```
*Send multiple items with the same key `files[]`.*
### **Optional Fields:**
* **expiration**: Unix timestamp in seconds. Applies to **all** images in the batch.
### **Requirements:**
* **Content-Type:** `multipart/form-data`
* **Max Files:** 100 per request.
### **Example Request (Bulk)**
```http
POST /bulk-upload
Host: https://gkapi.jojapi.net
X-JoJAPI-Key: YOUR_KEY_HERE
Content-Type: multipart/form-data; boundary=---boundary
-----boundary
Content-Disposition: form-data; name="files[]"; filename="cat.jpg"
Content-Type: image/jpeg
[...binary data...]
-----boundary
Content-Disposition: form-data; name="files[]"; filename="dog.png"
Content-Type: image/png
[...binary data...]
-----boundary
Content-Disposition: form-data; name="expiration"
1763659661
-----boundary--
```
### **Response (Immediate)**
```json
{
"success": true,
"batchId": "BX72Fk0912",
"total": 2,
"message": "Batch queued"
}
```
---
## 📊 Check Bulk Status
**Endpoint:** `GET /bulk-status/{batchId}`
Poll this endpoint to track the progress of your bulk upload and retrieve the final URLs.
### **Example Request**
```http
GET /bulk-status/BX72Fk0912
Host: https://gkapi.jojapi.net
X-JoJAPI-Key: YOUR_KEY_HERE
```
### **Response (In Progress)**
```json
{
"batchId": "BX72Fk0912",
"total": 10,
"completed": 4,
"failed": 0,
"percent": 40,
"done": false,
"items": [
{ "id": "abc1", "url": "https://i.api.dishis.tech/i/abc1", "done": true },
{ "id": "abc2", "url": "https://i.api.dishis.tech/i/abc2", "done": true },
{ "done": false },
{ "done": false }
]
}
```
### **Response (Completed)**
```json
{
"batchId": "BX72Fk0912",
"total": 10,
"completed": 9,
"failed": 1,
"percent": 100,
"done": true,
"items": [
{
"id": "abc1",
"url": "https://i.api.dishis.tech/i/abc1",
"done": true
},
{
"id": "err1",
"error": "too large",
"done": true
}
// ... all other items
]
}
```
---
## 🧩 Supported Image Formats (Single Upload)
You can send the `image` field as:
### **1. File Upload (multipart)**
```
image: <file>
```
Any normal PNG, JPEG, WEBP, GIF.
### **2. Base64 String**
```
iVBORw0KGgoAAAANSUhEUgAA...
```
### **3. Base64 Data URI**
```
data:image/png;base64,iVBORw0KG...
```
### **4. Remote Image URL**
```
https://example.com/cat.png
```
### **5. Self-URL (Re-upload)**
```
https://i.api.dishis.tech/i/abc123
```
---
## 🎯 Successful Response (Single Upload)
```json
{
"data": {
"id": "Pl5ng",
"title": "Pl5ng",
"url_viewer": "https://i.api.dishis.tech/i/Pl5ng",
"url": "https://i.dishis.tech/i/Pl5ng",
"display_url": "https://i.api.dishis.tech/i/Pl5ng",
"width": "4000",
"height": "6000",
"size": "8668552",
"time": "1763659661",
"expiration": "0",
"image": {
"filename": "Pl5ng.jpeg",
"name": "Pl5ng",
"mime": "image/jpeg",
"extension": "jpeg",
"url": "https://i.api.dishis.tech/i/Pl5ng"
},
"delete_url": "https://i.api.dishis.tech/delete/Pl5ng/207C8HPRKMwLHYJd",
"plan": "free"
},
"success": true,
"status": 200
}
```
---
## ❌ Error Responses
### Missing image/files
```json
{
"success": false,
"status": 400,
"message": "image required" // or "no files"
}
```
### Invalid Batch ID
```json
{
"success": false,
"status": 404,
"message": "Batch not found"
}
```
### Too Large (>35MB default)
```json
{
"success": false,
"status": 413,
"message": "too large"
}
```
### Expired image
```json
{
"success": false,
"status": 410,
"message": "This file has expired."
}
```
---
## 🗑️ Deleting an Image
Use the `delete_url` returned in the upload response.
### Step 1: Open delete URL in browser
You will see a confirmation prompt.
### Step 2: Click **Delete**
The file is permanently removed from storage + cache.