# Hunts API overview

Report artworks that still need to be photographed, and let hunters claim them.

Sometimes people know an artwork exists, but can't hunt it themselves. A **hunt** is a tip with a location and a comment. Hunters can claim it, go there, and mark it as done.

**Base link:** `https://streetartcities.com/api/hunts`

**API reference:** [open in Swagger UI](https://petstore3.swagger.io/?url=https://streetartcities.com/api/hunts/openapi), or grab the [OpenAPI spec](https://streetartcities.com/api/hunts/openapi) directly.

<Admonition kind="info" title="Hunts reported by your app">
  Hunts you report through the API show a "Via" badge with the name of your app,
  so hunters know where the tip came from.
</Admonition>

## Endpoints

| Endpoint                      | Scope         | What it does                                                                          |
| ----------------------------- | ------------- | ------------------------------------------------------------------------------------- |
| `GET /api/hunts`              | `hunts:read`  | [Hunts waiting to be done, newest first](/hunts-api/reference/list-open-hunts/)       |
| `GET /api/hunts/mine`         | `hunts:read`  | [The hunts the person has claimed](/hunts-api/reference/list-your-hunting-list/)      |
| `POST /api/hunts`             | `hunts:write` | [Report an artwork to hunt](/hunts-api/reference/report-an-artwork-to-hunt/)          |
| `GET /api/hunts/:id/comments` | `hunts:read`  | [Comments on a hunt, newest first](/hunts-api/reference/list-the-comments-on-a-hunt/) |
| `POST /api/hunts/:id/claim`   | `hunts:write` | [Claim a hunt](/hunts-api/reference/claim-a-hunt/)                                    |
| `POST /api/hunts/:id/release` | `hunts:write` | [Give up a claim](/hunts-api/reference/give-up-a-claim/)                              |
| `POST /api/hunts/:id/done`    | `hunts:write` | [Mark a hunt as done](/hunts-api/reference/mark-a-hunt-as-done/)                      |
| `DELETE /api/hunts/:id`       | `hunts:write` | [Delete a hunt](/hunts-api/reference/delete-a-hunt/)                                  |

## A hunt

```json
{
  "id": "5f0e8a2c-…",
  "comment": "New mural behind the bakery",
  "location": { "lat": 52.37, "lng": 4.9 },
  "address": "Damstraat 1, Amsterdam",
  "city": "Amsterdam",
  "country": "NL",
  "createdBy": "9b1c…",
  "oauthClientId": "your-app",
  "claimedBy": "3d7a…",
  "claimedUntil": "2026-10-26T12:00:00.000Z",
  "reporter": {
    "id": "9b1c…",
    "displayName": "Banksy Fan",
    "avatar": "https://…"
  },
  "hunter": { "id": "3d7a…", "displayName": "Sam", "avatar": "https://…" },
  "createdAt": "2026-10-23T12:00:00.000Z"
}
```

Only `comment` and `location` are needed to report a hunt. `oauthClientId` is set when it was reported through an app.

The lists also include `commentsCount`, how many comments the hunt has. Comments are added on the website and in the app.

The lists and the claim endpoint also include `reporter` and `hunter`, with the name and profile picture of the person who reported it and the hunter who claimed it.

When a hunt is marked as done, it disappears from the lists and shows up in the hunter's logbook. The first hunt a hunter finishes earns them the Trailblazer badge.

## Claims

A hunter claims a hunt to tell others they're on it. A claim lasts **three days**, then it runs out and the hunt is free for anyone to claim again. Claiming a hunt you already claimed starts the three days again.

Claiming a hunt that someone else is hunting gives a `409`. Only the hunter who claimed a hunt can release it or mark it as done. Finished hunts disappear from the lists.

The person who reported a hunt gets a notification when a hunter claims it, and again when it's done. When marking a hunt as done you can optionally send the `markerId` of the artwork the hunter added, so the notification links to it. The artwork then also shows "Hunt suggested by" with a link to the person who reported the hunt. Leaving out the body still works. Both they and the current hunter are notified of new comments.

## Errors

Errors look like this:

```json
{ "error": { "message": "Someone else is already hunting this." } }
```
