# add_commons_photos

Add Wikimedia Commons photos to a spot or chapter.

`POST /v1/photos/commons` · MCP tool `add_commons_photos` · scope `write` · beta · since 2026-10-26.4

Up to 4 photos by their Commons file titles (search_commons), in the order given, to one spot or one chapter. Each file is read again from Commons (licence and size checked again), copied at 1920 px through the photo optimizer and stored with the author and licence as credit, the file page as source and creditUrl, and alt text when Commons has one. A photo the owner holds already is skipped. failed lists files that could not be added, with the reason.

## Body parameters

- `titles` (array of strings, required): Commons file titles from search_commons (File:...jpg), 1 to 4.
- `collectionId` (string, optional): The chapter that gets the photos (kind chapter; for its pages).
- `spotId` (string, optional): The spot that gets the photos. Send spotId or collectionId, not both.

## Returns

201: PhotosAdded.

- `added` (number, required): Photos added by this call.
- `skipped` (number, required): Photos the spot or chapter held already, not added twice.
- `failed` (array of objects, required): Photos that could not be added.
  - `id` (string, required): The photo id or file title that failed.
  - `message` (string, required): Why, in plain words.
- `mediaIds` (array of strings, required): The rows of every requested photo the spot or chapter now holds, in request order (added and skipped ones).

## Examples

### Copy a Commons photo into Grand Prismatic Spring; one it holds already is skipped

```bash
curl -X POST "https://sceniq.earth/api/v1/photos/commons" \
  -H "Authorization: Bearer $SCENIQ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "spotId": "k1709e2vj4sk8q6x0d3m5r7t9w1y3b5c",
  "titles": [
    "File:Grand Prismatic Spring 2013.jpg",
    "File:Grand Prismatic Spring and Midway Geyser Basin from above.jpg"
  ]
}'
```

MCP `tools/call`:

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "add_commons_photos",
    "arguments": {
      "spotId": "k1709e2vj4sk8q6x0d3m5r7t9w1y3b5c",
      "titles": [
        "File:Grand Prismatic Spring 2013.jpg",
        "File:Grand Prismatic Spring and Midway Geyser Basin from above.jpg"
      ]
    }
  }
}
```

Response 201:

```json
{
  "added": 1,
  "skipped": 1,
  "failed": [],
  "mediaIds": [
    "kg7j2l4n6q8s0u2w4y6a8c0e2g4i6k8n",
    "kg7p2p4j6v8y0t2r4e6w8q0a2s4d6f8g"
  ]
}
```

## Errors

- `invalid_argument` (400): A required field is missing, a field is unknown, or a value does not match its type (the Convex validator's path and value are in the message).
- `invalid_request` (400): A writer refused a value: a map link on a host that is not allowed, a title that is too long, a date that does not exist, too many items in a list. The message is the writer's own sentence.
- `unauthenticated` (401): The request carries no key. Send it as Authorization: Bearer sk_sceniq_... (or X-Api-Key).
- `invalid_api_key` (401): The key is unknown, revoked or expired.
- `api_scope_required` (403): A read-only key called a write operation, or a key without the publish option called publish_changes.
- `forbidden` (403): The key belongs to a creator account that is no longer active.
- `not_found` (404): The id does not exist or belongs to another creator. The two answers are identical on purpose, so ids never reveal what exists.
- `photo_source_failed` (400): Wikimedia Commons was busy or silent during a search or an add.
- `payload_too_large` (413): A JSON body over 2 MB, an image over 6 MB, a batch upload over 19 MB, or an MCP message over 2 MB.
- `rate_limited` (429): Over a limit: requests per key per minute, per creator per hour, uploads per key per minute, or check_links per guide per hour.
- `internal_error` (500): An unexpected failure. The message is hidden on purpose.

Reference: https://developers.sceniq.earth/reference/add_commons_photos
