# Add pictures to a changelog draft (https://notert.io/docs/api/reference/add-pictures-to-a-changelog-draft)

`POST /api/v1/changelog-entries/{id}/pictures`

Stores pictures for a draft's body by their addresses, which the server fetches from the open web and draws as a WebP within 1920 pixels. The body shows none until a change places each by its storedUrl. Only a draft takes them: a published or scheduled entry is PUBLISHED until it is unpublished.

Access: A token with changelog:write.

## Path parameters

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | Yes | The entry's id. At most 64 characters. |

## Body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `pictureUrls` | uri[] | Yes | Public https addresses of pictures (JPEG, PNG, GIF or WebP, of no more pixels than 3840 x 2160, up to 10 MB each), at most 10, which the server fetches. One that can't be fetched, isn't a picture or is too large is PICTURE_REFUSED, and none is stored. |

## Response 200

| Field | Type | Description |
| --- | --- | --- |
| `pictures` | object[] | Where each picture is stored, in the order named. |
| `pictures.pictureUrl` | string | The address the picture was sent as. |
| `pictures.storedUrl` | string | Where the picture is stored, which the draft's body shows once a change places it as ![what it shows](storedUrl). |

## Errors

| Status | Code | Message |
| --- | --- | --- |
| 400 | `BAD_REQUEST` | Input validation failed. |
| 401 | `UNAUTHORIZED` | Send a valid API token as a Bearer token. |
| 403 | `HOLDER_NOT_ALLOWED` | The teammate who holds this API token's secret can't do this in the workspace now. A teammate who can should roll it in the workspace's settings. |
| 403 | `INSUFFICIENT_SCOPE` | This API token can't draft and change changelog entries or their tags. Create one that may in the workspace's settings. |
| 403 | `NETWORK_NOT_ALLOWED` | This API token works only from the networks it was made for. Call from one of them, or create a token for this one in the workspace's settings. |
| 403 | `NO_SEAT` | This workspace's plan has no seat for you. |
| 403 | `WORKSPACE_SUSPENDED` | This workspace is suspended. |
| 404 | `NOT_FOUND` | Not Found. |
| 409 | `CHANGED_MEANWHILE` | Something changed meanwhile. Try again. |
| 409 | `PUBLISHED` | Only a draft changes. Unpublish the entry first, then change it. |
| 422 | `PICTURE_REFUSED` | A picture in pictureUrls couldn't be attached, so nothing was written. data.url names it and data.reason says why. Its data holds `url`, `reason`. |
| 429 | `TOO_MANY_REQUESTS` | Too Many Requests. Its data holds `retryAfter`. |

## Example request

```sh
curl -X POST https://app.notert.io/api/v1/changelog-entries/6d2e9a1c-4b7f-4c3e-9a5d-2f8b1c6e4a90/pictures \
  -H "Authorization: Bearer $NOTERT_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "pictureUrls": [
    "https://example.com/shots/dark-mode.png"
  ]
}'
```

## Example response 200

```json
{
  "pictures": [
    {
      "pictureUrl": "https://example.com/shots/dark-mode.png",
      "storedUrl": "https://notert-content.com/requests/6d2e9a1c/2b7e4c1a.webp"
    }
  ]
}
```
