Docs / API reference
Upload a photo
POST /v1/images: upload a box, component, or gameplay photo for an item or a submission, with its source and license.
POST /v1/imagesNeeds an API key: Authorization: Bearer <key>. See Authentication.
Attach a photo to an existing item (item_id) or to a submission still under review (submission_id). Users' photos wait for review; the same bytes uploaded twice are kept once. Uploading photos covers sizes, formats, and licensing.
Request body
multipart/form-data.
| Field | Type | Required | Description |
|---|---|---|---|
file | file | Yes | |
item_id | UUID | No | |
submission_id | UUID | No | |
kind | one of: box_front, box_back, box_side, components, detail, gameplay, other | No | |
caption | string | No | |
sort_order | integer, default 0 | No | |
source | string | No | Source key (bots and admins) |
source_url | URL | No | |
source_page_url | URL | No | |
license | string | No | |
attribution | string | No |
Example
curl -X POST "https://tablearchive.dev/v1/images" \
-H "Authorization: Bearer $TA_KEY" \
-F "[email protected]" \
-F "item_id=9dde0e9c-530a-4d31-80f7-38637d823f59" \
-F "kind=box_front"import fs from 'node:fs/promises'
const form = new FormData()
form.set('file', new Blob([await fs.readFile('box.jpg')]), 'box.jpg')
form.set('item_id', '9dde0e9c-530a-4d31-80f7-38637d823f59')
form.set('kind', 'box_front')
const res = await fetch('https://tablearchive.dev/v1/images', {
method: 'POST',
headers: { Authorization: `Bearer ${process.env.TA_KEY}` },
body: form,
})
const data = await res.json()import os, requests
res = requests.post(
"https://tablearchive.dev/v1/images",
headers={"Authorization": f"Bearer {os.environ['TA_KEY']}"},
files={"file": open("box.jpg", "rb")},
data={"item_id": "9dde0e9c-530a-4d31-80f7-38637d823f59", "kind": "box_front"},
)
data = res.json()Notes
- Counts against the hourly contribution budget, like submissions.
Errors
| Status | When |
|---|---|
400 | A parameter or field is missing or invalid; details names each one |
401 | No API key, or one that is not valid |
413 | The file is over the size limit |
429 | Rate limited; wait for Retry-After seconds |
Every error is JSON with an error message. See Rate limits and errors.