Register the sites that may show our images (paid plans)
const url = 'https://api.thebgdb.org/v1/account/media-origins';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"origins":["https://shop.example"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://api.thebgdb.org/v1/account/media-origins \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "origins": [ "https://shop.example" ] }'Replaces your sites with these, up to 5 (an empty list removes them all). Each is a scheme and host only, such as https://shop.example. A page of one of them may then show covers and approved photos from GET /media/{key}; rulebook files never. The bytes served are counted for your account. Covers belong to their publishers: this is delivery, not a licence.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Example
{ "origins": [ "https://shop.example" ]}Responses
Section titled “Responses”The sites now registered.
object
Example generated
{ "data": [ "example" ]}Not a list of up to 5 sites, or one with a path (invalid_origin).
object
What went wrong, in plain English words. The wording may change: act on code.
A stable name for this refusal, for programs and for showing the message in another language. A code is never renamed; new ones may be added.
The numbers the sentence names, when it names any: for example { "max": 20 } with daily_photo_limit.
object
On every refusal over a limit (rate_limited, weekly_limit, coverage_limit): where higher limits are to be had. The same pricing address is in the Link header, with rel="payment".
object
The plans and prices page.
The account page, where a member makes a free API token.
Example
{ "error": "Game not found", "code": "game_not_found"}The request has no valid session token.
object
What went wrong, in plain English words. The wording may change: act on code.
A stable name for this refusal, for programs and for showing the message in another language. A code is never renamed; new ones may be added.
The numbers the sentence names, when it names any: for example { "max": 20 } with daily_photo_limit.
object
On every refusal over a limit (rate_limited, weekly_limit, coverage_limit): where higher limits are to be had. The same pricing address is in the Link header, with rel="payment".
object
The plans and prices page.
The account page, where a member makes a free API token.
Example
{ "error": "Game not found", "code": "game_not_found"}Not on a paid plan (paid_plan_required).
object
What went wrong, in plain English words. The wording may change: act on code.
A stable name for this refusal, for programs and for showing the message in another language. A code is never renamed; new ones may be added.
The numbers the sentence names, when it names any: for example { "max": 20 } with daily_photo_limit.
object
On every refusal over a limit (rate_limited, weekly_limit, coverage_limit): where higher limits are to be had. The same pricing address is in the Link header, with rel="payment".
object
The plans and prices page.
The account page, where a member makes a free API token.
Example
{ "error": "Game not found", "code": "game_not_found"}Another account registered one of these sites (origin_taken).
object
What went wrong, in plain English words. The wording may change: act on code.
A stable name for this refusal, for programs and for showing the message in another language. A code is never renamed; new ones may be added.
The numbers the sentence names, when it names any: for example { "max": 20 } with daily_photo_limit.
object
On every refusal over a limit (rate_limited, weekly_limit, coverage_limit): where higher limits are to be had. The same pricing address is in the Link header, with rel="payment".
object
The plans and prices page.
The account page, where a member makes a free API token.
Example
{ "error": "Game not found", "code": "game_not_found"}