# Edits API overview

Suggest changes to artworks, artists, cities and more. The community checks every suggestion before it goes live.

Everything on Street Art Cities, from artworks to artists and cities, is kept up to date by our community. The Edits API is how your app joins in: it can suggest new artworks, fix details, or add tags, on behalf of the person using it.

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

**Example:** our [demo app](https://github.com/streetartcities/api-demo) logs someone in, suggests a change to an artwork, and links them to the review page.

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

## What you can change

| `entityType`     | What it is                              |
| ---------------- | --------------------------------------- |
| `marker`         | An artwork on the map                   |
| `artist`         | An artist profile                       |
| `city`           | A city                                  |
| `tag`            | A tag, like `stencil` or `mural`        |
| `calendar-event` | A street art event                      |
| `community-note` | A note from the community on an artwork |

## Endpoints

| Endpoint                                 | Scope          | What it does                                                                                                        |
| ---------------------------------------- | -------------- | ------------------------------------------------------------------------------------------------------------------- |
| `POST /api/edits`                        | `edits:write`  | [Suggest a change](/edits-api/reference/create-edit/)                                                               |
| `POST /api/edits/evaluate-permissions`   | `edits:write`  | [Check whether a change would go live right away](/edits-api/reference/check-if-an-edit-would-be-applied-directly/) |
| `GET /api/edits/mine`                    | `edits:read`   | [Changes the person suggested](/edits-api/reference/get-my-edits/)                                                  |
| `GET /api/edits/:id`                     | `edits:read`   | [One change, with a before and after preview](/edits-api/reference/get-edit/)                                       |
| `POST /api/edits/views`                  | `edits:read`   | [Previews for up to 100 changes at once](/edits-api/reference/get-pending-edit-previews/)                           |
| `POST /api/edits/:id/accept`             | `edits:review` | [Accept a change](/edits-api/reference/accept-edit/)                                                                |
| `POST /api/edits/:id/reject`             | `edits:review` | [Reject a change](/edits-api/reference/reject-edit/)                                                                |
| `POST /api/edits/:id/revert`             | `edits:review` | [Undo an accepted change](/edits-api/reference/revert-edit/)                                                        |
| `GET /api/edits/history/:entityType/:id` | none           | [All accepted changes to something](/edits-api/reference/get-entity-history/)                                       |

## Errors

Errors look like this, with a matching status code:

```json
{ "error": "You can't do that." }
```

| Status | Meaning                                                 |
| ------ | ------------------------------------------------------- |
| `400`  | Something's wrong with the request                      |
| `401`  | No token, or the token has run out                      |
| `403`  | Missing a scope, or the person isn't allowed to do this |
| `404`  | Not found, or the person can't see it                   |
