Skip to content

Upload Files

You can upload files from the dashboard or via the API.

Dashboard: Upload

  1. Log in to atiru.io.
  2. Go to Files.
  3. Click Upload (or the upload button in the header).
  4. Select one or more files. Supported types include images, documents, archives, audio, video, and fonts. See Content Types for the full list.
  5. Files are uploaded and appear in the list with their URLs.

API: Upload

Endpoint: POST /files

Headers

HeaderRequiredDescription
AuthorizationYesBearer <api_key> or use X-Api-Key
Content-TypeYesMIME type of the file (e.g. image/png). Must be in the allowed list.
x-file-nameNoOriginal filename. Used for display and download.

Query

ParamDefaultDescription
isPublictrueSet 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.png
javascript
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:

PlanMax file size
Trial50 MB
Pro1 GB
Enterprise10 GB

You can optionally lower the limit via Settings (max_upload_size_bytes), but it cannot exceed your plan limit.

Errors

StatusCodeDescription
400-Content-Type not allowed. See Content Types.
413FILE_TOO_LARGEFile exceeds your max upload size.
403TRIAL_ENDEDTrial ended; upgrade to upload.
403STORAGE_LIMIT_REACHEDStorage limit reached.
403FILE_COUNT_LIMIT_REACHEDFile count limit reached (Trial: 100).