Appearance
Upload Files
You can upload files from the dashboard or via the API.
Dashboard: Upload
- Log in to atiru.io.
- Go to Files.
- Click Upload (or the upload button in the header).
- Select one or more files. Supported types include images, documents, archives, audio, video, and fonts. See Content Types for the full list.
- Files are uploaded and appear in the list with their URLs.
API: Upload
Endpoint: POST /files
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer <api_key> or use X-Api-Key |
Content-Type | Yes | MIME type of the file (e.g. image/png). Must be in the allowed list. |
x-file-name | No | Original filename. Used for display and download. |
Query
| Param | Default | Description |
|---|---|---|
isPublic | true | Set to false to upload as private. Private files are not served on /m/ or /d/. |
bash
curl -X POST "https://api.atiru.io/files" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: image/png" \
-H "x-file-name: example.png" \
--data-binary @/path/to/file.pngjavascript
const res = await fetch('https://api.atiru.io/files', {
method: 'POST',
headers: {
'Authorization': `Bearer ${API_KEY}`,
'Content-Type': 'image/png',
'x-file-name': 'example.png',
},
body: fileBuffer,
})
const { file, message } = await res.json()
console.log(file.public_url)python
import requests
with open('example.png', 'rb') as f:
res = requests.post(
'https://api.atiru.io/files',
headers={
'Authorization': f'Bearer {API_KEY}',
'Content-Type': 'image/png',
'x-file-name': 'example.png',
},
data=f.read(),
)
data = res.json()
print(data['file']['public_url'])Response (201)
json
{
"file": {
"id": "uuid",
"user_id": "uuid",
"file_id": "abc123",
"name": "example.png",
"content_type": "image/png",
"size": 12345,
"public_url": "https://cdn.atiru.io/m/abc123",
"default_url": "https://cdn.atiru.io/m/abc123",
"default_download_url": "https://cdn.atiru.io/d/abc123",
"public_download_url": "https://cdn.atiru.io/d/abc123",
"created_at": "2024-01-15T12:00:00.000Z",
"is_public": true
},
"message": "File uploaded"
}If you use a custom CDN URL, public_url and public_download_url use your base. default_url and default_download_url always use cdn.atiru.io.
Size limits
Max file size depends on your plan:
| Plan | Max file size |
|---|---|
| Trial | 50 MB |
| Pro | 1 GB |
| Enterprise | 10 GB |
You can optionally lower the limit via Settings (max_upload_size_bytes), but it cannot exceed your plan limit.
Errors
| Status | Code | Description |
|---|---|---|
| 400 | - | Content-Type not allowed. See Content Types. |
| 413 | FILE_TOO_LARGE | File exceeds your max upload size. |
| 403 | TRIAL_ENDED | Trial ended; upgrade to upload. |
| 403 | STORAGE_LIMIT_REACHED | Storage limit reached. |
| 403 | FILE_COUNT_LIMIT_REACHED | File count limit reached (Trial: 100). |