{"openapi":"3.1.0","info":{"title":"Street Art Cities Comments API","description":"Read the comments on anything, and post comments for the person using your app.","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"}}},"security":[{"bearerAuth":[]}],"paths":{"/api/comments":{"post":{"operationId":"postApiComments","tags":["Comments"],"x-scope-required":["comments:write"],"summary":"Post a comment","description":"Comment on something for the person using your app. For now, only suggestions in the review queue (`edit.{id}`) can get comments here. The people involved and anyone mentioned get a notification.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"entity":{"type":"string","pattern":"^[a-z][a-z-]*\\.[^\\s#,]+$","description":"What the comments are on, like `edit.123`"},"comment":{"type":"string","minLength":1,"maxLength":10000},"attachments":{"description":"Links to images uploaded for the comment","maxItems":20,"type":"array","items":{"type":"string"}},"attributes":{"description":"Anything else to keep with the comment","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["entity","comment"]}}},"required":true},"responses":{"201":{"description":"The new comment","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","const":"Note"},"id":{"type":"string"},"actor":{"type":"object","properties":{"id":{"type":"string"},"displayName":{"type":"string"},"href":{"type":"string","description":"A link to a profile on Street Art Cities"},"avatar":{"type":"string"}},"required":["id","displayName","href"],"additionalProperties":{},"description":"Who wrote it"},"noteType":{"type":"string","const":"comment"},"summary":{"type":"string","description":"The author's name, as a link"},"content":{"description":"The comment itself. Mentions are stored as `<@Kim|https://streetartcities.com/users/123>`","anyOf":[{"type":"string"},{"type":"null"}]},"attachments":{"type":"array","items":{"type":"string"}},"published":{"type":"string","description":"When it was written"},"edited":{"type":"boolean"},"likesCount":{"type":"number"}},"required":["type","id","actor","noteType","summary","attachments","published","likesCount"],"additionalProperties":{}}}}},"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 comments:write scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"details":{"type":"array","items":{}}},"required":["message"]}},"required":["error"]}}}},"404":{"description":"There's nothing with that ID","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"details":{"type":"array","items":{}}},"required":["message"]}},"required":["error"]}}}}}}},"/api/comments/count":{"get":{"operationId":"getApiCommentsCount","tags":["Comments"],"security":[],"summary":"Count comments on several things","description":"How many comments each of up to 100 things has, in one request. Handy for showing counts in a list.","responses":{"200":{"description":"The number of comments on each","content":{"application/json":{"schema":{"type":"object","properties":{"counts":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"},"description":"How many comments each entity has"}},"required":["counts"]}}}},"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"]}}}}},"parameters":[{"in":"query","name":"entities","schema":{"type":"string"},"required":true,"description":"A comma-separated list, like `edit.123,edit.456`"}]}},"/api/comments/entity/{entity}":{"get":{"operationId":"getApiCommentsEntityByEntity","tags":["Comments"],"security":[],"summary":"List comments","description":"The comments on something, newest first. Anyone can read them, without a token.","parameters":[{"in":"path","name":"entity","schema":{"type":"string","pattern":"^[a-z][a-z-]*\\.[^\\s#,]+$"},"required":true,"description":"What the comments are on, like `edit.123`"}],"responses":{"200":{"description":"The comments","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","const":"Note"},"id":{"type":"string"},"actor":{"type":"object","properties":{"id":{"type":"string"},"displayName":{"type":"string"},"href":{"type":"string","description":"A link to a profile on Street Art Cities"},"avatar":{"type":"string"}},"required":["id","displayName","href"],"additionalProperties":{},"description":"Who wrote it"},"noteType":{"type":"string","const":"comment"},"summary":{"type":"string","description":"The author's name, as a link"},"content":{"description":"The comment itself. Mentions are stored as `<@Kim|https://streetartcities.com/users/123>`","anyOf":[{"type":"string"},{"type":"null"}]},"attachments":{"type":"array","items":{"type":"string"}},"published":{"type":"string","description":"When it was written"},"edited":{"type":"boolean"},"likesCount":{"type":"number"}},"required":["type","id","actor","noteType","summary","attachments","published","likesCount"],"additionalProperties":{}}}}}},"400":{"description":"Invalid entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"details":{"type":"array","items":{}}},"required":["message"]}},"required":["error"]}}}}}}},"/api/comments/entity/{entity}/count":{"get":{"operationId":"getApiCommentsEntityByEntityCount","tags":["Comments"],"security":[],"summary":"Count comments","description":"How many comments something has.","parameters":[{"in":"path","name":"entity","schema":{"type":"string","pattern":"^[a-z][a-z-]*\\.[^\\s#,]+$"},"required":true,"description":"What the comments are on, like `edit.123`"}],"responses":{"200":{"description":"The number of comments","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"number"}},"required":["count"]}}}},"400":{"description":"Invalid entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"details":{"type":"array","items":{}}},"required":["message"]}},"required":["error"]}}}}}}}}}