Docs / API reference
Register a source
POST /v1/sources: register or update a source before a bot submits data from it. Bots and admins only.
POST /v1/sourcesNeeds a bot or admin API key.
For importers. Register the source once (sending it again updates it), then name its key on each submission so every fact keeps where it came from. A submission can also carry the source inline; see Submissions.
Request body
JSON.
| Field | Type | Required | Description |
|---|---|---|---|
key | string, up to 200 characters | Yes | |
name | string, up to 300 characters | Yes | |
kind | one of: manufacturer, open_data, community, other | Yes | |
url | string | No | |
license | string, up to 200 characters | No |
Example
curl -X POST "https://tablearchive.dev/v1/sources" \
-H "Authorization: Bearer $TA_KEY" \
-H "Content-Type: application/json" -d '{"key":"shopify:example.com","name":"Example Games","kind":"manufacturer","url":"https://example.com","license":"proprietary"}'const res = await fetch('https://tablearchive.dev/v1/sources', {
method: 'POST',
headers: { Authorization: `Bearer ${process.env.TA_KEY}`, 'Content-Type': 'application/json' },
body: JSON.stringify({
"key": "shopify:example.com",
"name": "Example Games",
"kind": "manufacturer",
"url": "https://example.com",
"license": "proprietary"
}),
})
const data = await res.json()import os, requests
res = requests.post(
"https://tablearchive.dev/v1/sources",
headers={"Authorization": f"Bearer {os.environ['TA_KEY']}"},
json={
"key": "shopify:example.com",
"name": "Example Games",
"kind": "manufacturer",
"url": "https://example.com",
"license": "proprietary"
},
)
data = res.json()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 |
403 | The key is not a bot or admin key |
429 | Rate limited; wait for Retry-After seconds |
Every error is JSON with an error message. See Rate limits and errors.