{"openapi":"3.1.0","info":{"title":"Street Art Cities Hunts API","description":"Artworks people know about but haven't photographed yet, and the hunters who claim them.","version":"1.0.0"},"servers":[{"url":"https://streetartcities.com","description":"Production"},{"url":"https://streetartdev.com","description":"Development"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"Hunt":{"type":"object","properties":{"comment":{"type":"string","minLength":1,"maxLength":1000,"description":"What hunters should know, for example where to look"},"location":{"type":"object","properties":{"lat":{"type":"number","minimum":-90,"maximum":90},"lng":{"type":"number","minimum":-180,"maximum":180}},"required":["lat","lng"],"description":"Where the artwork is"},"address":{"type":"string"},"city":{"type":"string"},"country":{"description":"Two-letter country code","type":"string"},"id":{"type":"string"},"createdBy":{"type":"string","description":"The id of the person who reported it"},"oauthClientId":{"description":"Set when it was reported through a third-party app","type":"string"},"claimedBy":{"description":"The id of the hunter who's going to photograph it","type":"string"},"claimedUntil":{"description":"When the claim runs out, three days after claiming","type":"string"},"reporter":{"$ref":"#/components/schemas/HuntPerson"},"hunter":{"$ref":"#/components/schemas/HuntPerson"},"commentsCount":{"description":"How many comments it has, when listing hunts","type":"number"},"createdAt":{"type":"string"}},"required":["comment","location","id","createdBy","createdAt"]},"HuntPerson":{"type":"object","properties":{"id":{"type":"string"},"displayName":{"type":"string"},"avatar":{"type":"string"}},"required":["id","displayName"]},"HuntComment":{"type":"object","properties":{"id":{"type":"string"},"actor":{"type":"object","properties":{"id":{"type":"string"},"displayName":{"type":"string"},"avatar":{"type":"string"},"href":{"type":"string"}},"required":["id","displayName","href"]},"content":{"description":"The comment, with @mentions as links","type":"string"},"attachments":{"type":"array","items":{"type":"string"}},"published":{"type":"string"},"edited":{"type":"boolean"}},"required":["id","actor","attachments","published"]}}},"security":[{"bearerAuth":[]}],"paths":{"/api/hunts":{"get":{"operationId":"getApiHunts","tags":["Hunts"],"x-scope-required":["hunts:read"],"summary":"List open hunts","description":"Artworks waiting to be hunted, newest first. Claims that ran out are left out, so those hunts show up as free again.","responses":{"200":{"description":"Open hunts","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Hunt"}}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"details":{"type":"array","items":{}}},"required":["message"]}},"required":["error"]}}}},"403":{"description":"The app doesn't have the scope for this","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"details":{"type":"array","items":{}}},"required":["message"]}},"required":["error"]}}}}}},"post":{"operationId":"postApiHunts","tags":["Hunts"],"x-scope-required":["hunts:write"],"summary":"Report an artwork to hunt","description":"Tell hunters about an artwork you can't photograph yourself. When this is called through an app, the hunt shows a 'Via' badge with the app's name.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"comment":{"type":"string","minLength":1,"maxLength":1000,"description":"What hunters should know, for example where to look"},"location":{"type":"object","properties":{"lat":{"type":"number","minimum":-90,"maximum":90},"lng":{"type":"number","minimum":-180,"maximum":180}},"required":["lat","lng"],"description":"Where the artwork is"},"address":{"type":"string"},"city":{"type":"string"},"country":{"description":"Two-letter country code","type":"string"}},"required":["comment","location"]}}}},"responses":{"200":{"description":"The new hunt","content":{"application/json":{"schema":{"type":"object","properties":{"comment":{"type":"string","minLength":1,"maxLength":1000,"description":"What hunters should know, for example where to look"},"location":{"type":"object","properties":{"lat":{"type":"number","minimum":-90,"maximum":90},"lng":{"type":"number","minimum":-180,"maximum":180}},"required":["lat","lng"],"description":"Where the artwork is"},"address":{"type":"string"},"city":{"type":"string"},"country":{"description":"Two-letter country code","type":"string"},"id":{"type":"string"},"createdBy":{"type":"string","description":"The id of the person who reported it"},"oauthClientId":{"description":"Set when it was reported through a third-party app","type":"string"},"claimedBy":{"description":"The id of the hunter who's going to photograph it","type":"string"},"claimedUntil":{"description":"When the claim runs out, three days after claiming","type":"string"},"reporter":{"$ref":"#/components/schemas/HuntPerson"},"hunter":{"$ref":"#/components/schemas/HuntPerson"},"commentsCount":{"description":"How many comments it has, when listing hunts","type":"number"},"createdAt":{"type":"string"}},"required":["comment","location","id","createdBy","createdAt"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"details":{"type":"array","items":{}}},"required":["message"]}},"required":["error"]}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"details":{"type":"array","items":{}}},"required":["message"]}},"required":["error"]}}}},"403":{"description":"The app doesn't have the scope for this","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"details":{"type":"array","items":{}}},"required":["message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"details":{"type":"array","items":{}}},"required":["message"]}},"required":["error"]}}}},"409":{"description":"Someone else is already hunting it","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"details":{"type":"array","items":{}}},"required":["message"]}},"required":["error"]}}}}}}},"/api/hunts/mine":{"get":{"operationId":"getApiHuntsMine","tags":["Hunts"],"x-scope-required":["hunts:read"],"summary":"List your hunting list","description":"Open hunts the person has claimed and not finished yet.","responses":{"200":{"description":"Their hunts","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Hunt"}}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"details":{"type":"array","items":{}}},"required":["message"]}},"required":["error"]}}}},"403":{"description":"The app doesn't have the scope for this","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"details":{"type":"array","items":{}}},"required":["message"]}},"required":["error"]}}}}}}},"/api/hunts/{huntId}/comments":{"get":{"operationId":"getApiHuntsByHuntIdComments","tags":["Hunts"],"x-scope-required":["hunts:read"],"summary":"List the comments on a hunt","description":"What people said about this hunt, newest first. Comments are added on the website and in the app.","parameters":[{"name":"huntId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Its comments","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/HuntComment"}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"details":{"type":"array","items":{}}},"required":["message"]}},"required":["error"]}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"details":{"type":"array","items":{}}},"required":["message"]}},"required":["error"]}}}},"403":{"description":"The app doesn't have the scope for this","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"details":{"type":"array","items":{}}},"required":["message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"details":{"type":"array","items":{}}},"required":["message"]}},"required":["error"]}}}},"409":{"description":"Someone else is already hunting it","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"details":{"type":"array","items":{}}},"required":["message"]}},"required":["error"]}}}}}}},"/api/hunts/{huntId}/claim":{"post":{"operationId":"postApiHuntsByHuntIdClaim","tags":["Hunts"],"x-scope-required":["hunts:write"],"summary":"Claim a hunt","description":"Say you're going to hunt this. The claim lasts three days, after which someone else can pick it up. Claiming a hunt you already claimed starts the three days again.","parameters":[{"name":"huntId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The hunt","content":{"application/json":{"schema":{"type":"object","properties":{"comment":{"type":"string","minLength":1,"maxLength":1000,"description":"What hunters should know, for example where to look"},"location":{"type":"object","properties":{"lat":{"type":"number","minimum":-90,"maximum":90},"lng":{"type":"number","minimum":-180,"maximum":180}},"required":["lat","lng"],"description":"Where the artwork is"},"address":{"type":"string"},"city":{"type":"string"},"country":{"description":"Two-letter country code","type":"string"},"id":{"type":"string"},"createdBy":{"type":"string","description":"The id of the person who reported it"},"oauthClientId":{"description":"Set when it was reported through a third-party app","type":"string"},"claimedBy":{"description":"The id of the hunter who's going to photograph it","type":"string"},"claimedUntil":{"description":"When the claim runs out, three days after claiming","type":"string"},"reporter":{"$ref":"#/components/schemas/HuntPerson"},"hunter":{"$ref":"#/components/schemas/HuntPerson"},"commentsCount":{"description":"How many comments it has, when listing hunts","type":"number"},"createdAt":{"type":"string"}},"required":["comment","location","id","createdBy","createdAt"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"details":{"type":"array","items":{}}},"required":["message"]}},"required":["error"]}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"details":{"type":"array","items":{}}},"required":["message"]}},"required":["error"]}}}},"403":{"description":"The app doesn't have the scope for this","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"details":{"type":"array","items":{}}},"required":["message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"details":{"type":"array","items":{}}},"required":["message"]}},"required":["error"]}}}},"409":{"description":"Someone else is already hunting it","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"details":{"type":"array","items":{}}},"required":["message"]}},"required":["error"]}}}}}}},"/api/hunts/{huntId}/release":{"post":{"operationId":"postApiHuntsByHuntIdRelease","tags":["Hunts"],"x-scope-required":["hunts:write"],"summary":"Give up a claim","description":"Frees up a hunt you claimed, so someone else can pick it up.","parameters":[{"name":"huntId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Released","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"details":{"type":"array","items":{}}},"required":["message"]}},"required":["error"]}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"details":{"type":"array","items":{}}},"required":["message"]}},"required":["error"]}}}},"403":{"description":"The app doesn't have the scope for this","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"details":{"type":"array","items":{}}},"required":["message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"details":{"type":"array","items":{}}},"required":["message"]}},"required":["error"]}}}},"409":{"description":"Someone else is already hunting it","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"details":{"type":"array","items":{}}},"required":["message"]}},"required":["error"]}}}}}}},"/api/hunts/{huntId}/done":{"post":{"operationId":"postApiHuntsByHuntIdDone","tags":["Hunts"],"x-scope-required":["hunts:write"],"summary":"Mark a hunt as done","description":"Only the hunter who claimed it can do this. The hunt disappears from the lists, and shows up in the hunter's logbook. The first hunt a hunter finishes earns them the Trailblazer badge. Pass the `markerId` of the artwork the hunter added to link it in the reporter's notification, and to show \"Hunt suggested by\" with the reporter's name on the artwork. The body is optional.","parameters":[{"name":"huntId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"markerId":{"description":"The id of the artwork the hunter added for this hunt","type":"string"}}}}}},"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"details":{"type":"array","items":{}}},"required":["message"]}},"required":["error"]}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"details":{"type":"array","items":{}}},"required":["message"]}},"required":["error"]}}}},"403":{"description":"The app doesn't have the scope for this","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"details":{"type":"array","items":{}}},"required":["message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"details":{"type":"array","items":{}}},"required":["message"]}},"required":["error"]}}}},"409":{"description":"Someone else is already hunting it","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"details":{"type":"array","items":{}}},"required":["message"]}},"required":["error"]}}}}}}},"/api/hunts/{huntId}":{"delete":{"operationId":"deleteApiHuntsByHuntId","tags":["Hunts"],"x-scope-required":["hunts:write"],"summary":"Delete a hunt","description":"Only the person who reported it, or an admin, can do this.","parameters":[{"name":"huntId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"details":{"type":"array","items":{}}},"required":["message"]}},"required":["error"]}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"details":{"type":"array","items":{}}},"required":["message"]}},"required":["error"]}}}},"403":{"description":"The app doesn't have the scope for this","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"details":{"type":"array","items":{}}},"required":["message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"details":{"type":"array","items":{}}},"required":["message"]}},"required":["error"]}}}},"409":{"description":"Someone else is already hunting it","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"details":{"type":"array","items":{}}},"required":["message"]}},"required":["error"]}}}}}}}}}