Skip to content

Get Files

List all your files or fetch a single file by ID.

Dashboard: View files

  1. Log in to atiru.io.
  2. Go to Files.
  3. Your files are listed in a table with name, type, size, URLs, and created date.
  4. Click a file row or URL to view details and copy URLs.

API: List files

Endpoint: GET /files

bash
curl -X GET "https://api.atiru.io/files" \
  -H "Authorization: Bearer YOUR_API_KEY"
javascript
const res = await fetch('https://api.atiru.io/files', {
  headers: { 'Authorization': `Bearer ${API_KEY}` },
})
const { files } = await res.json()
python
import requests

res = requests.get(
    'https://api.atiru.io/files',
    headers={'Authorization': f'Bearer {API_KEY}'},
)
data = res.json()
files = data['files']

Response (200)

json
{
  "files": [
    {
      "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
    }
  ]
}

For private files (is_public: false), URL fields are null in the response.

API: Get one file

Endpoint: GET /files/:id

Replace :id with the file's file_id (not the id UUID).

bash
curl -X GET "https://api.atiru.io/files/abc123" \
  -H "Authorization: Bearer YOUR_API_KEY"
javascript
const res = await fetch(`https://api.atiru.io/files/${fileId}`, {
  headers: { 'Authorization': `Bearer ${API_KEY}` },
})
const file = await res.json()
python
res = requests.get(
    f'https://api.atiru.io/files/{file_id}',
    headers={'Authorization': f'Bearer {API_KEY}'},
)
file = res.json()

Response (200)

json
{
  "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
}

Response (404) — File not found or not owned by you.