---
title: "Choose a Commons file"
method: POST
path: "/api/media/commons"
tags: ["Proposing changes"]
---

# Choose a Commons file

`POST /api/media/commons`

## Request

- Base URL: `https://verifiedhandles.org`
- URL: `https://verifiedhandles.org/api/media/commons`
- Auth: HTTP bearer

Turns a search hit’s `token` into an image the site holds, so a proposal can name it (`image_id`). The same file picked again answers the same image. It takes the token, never a file name: only a file a search found can be chosen.

## Request body

- object
  - `token` string, required

## Response `200`

Held: its id.

- object
  - `ok` true, required
  - `mediaId` string, required
  - `filename` string, required: The file’s name, as Commons spells it.

## Other responses

- `400`: Not JSON (`bad_json`), no token (`bad_payload`), or the token is forged or expired (`bad_token`). Or the request sent a key and a session cookie together (`bearer_with_cookie`): send one.
- `401`: No key was sent (`auth_required`), or the key was refused: unknown, revoked or expired, its holder may no longer use keys, or this instance takes none. Carries `WWW-Authenticate: Bearer`. After 60 refused keys from one IP address in a minute, every key from there is answered `429` (text, with `Retry-After`) until the minute is up.
- `403`: A read-only key tried to change something (`read_only_key`), or the account is blocked (`forbidden`).
- `409`: The file is withdrawn here (`image_withdrawn`), or restricted (`image_unavailable`).
- `429`: Too many changes in the last minute: counted per IP address, per account and per key (an admin key’s per key alone, at the limit set on Console → Rate limits). Wait the number of seconds `Retry-After` gives.
- `503`: The site is down for maintenance. The body is the maintenance page, as HTML. Try again later: `Retry-After` gives the seconds.

---

[API](https://skmtc.dev/verifiedhandles/apis/verified-handles-api.md) · [All operations](https://skmtc.dev/verifiedhandles/apis/verified-handles-api/llms.txt) · [OpenAPI document](https://skmtc.dev/verifiedhandles/apis/verified-handles-api/revisions/40720de2e0ec?raw)
