# Images and animations

Upload a cover image, place illustrations in the body and embed short videos that readers can play.

## Choose a file

Grant `media:upload` to the client handling the file and `drafts:write` or `revisions:write` to the client that will place it in a guide. Use an image for a banner or an inline illustration, and a short video for an inline animation.

| Use | Supported types | Maximum size |
| --- | --- | --- |
| Banner or inline image | PNG, JPEG, WebP | 3 MiB (3,145,728 bytes) |
| Inline animation | MP4, WebM | 10 MiB (10,485,760 bytes) |

## Upload the original bytes

1. Call `begin_media_upload` with the exact byte count and MIME type, for example `{"size":42681,"contentType":"image/png"}`. It returns `method`, `uploadUrl`, `headers`, `path` and `expiresAt`.
2. Use the returned HTTP method (`PUT`) and every returned header to send the raw file bytes to `uploadUrl`. The body is the file itself. Keep the temporary upload URL private and complete the transfer before `expiresAt`.
3. After the PUT succeeds, call `finish_media_upload` with that same `path`. The server checks the file type and returns the stable DevGuides path and Markdown. If you lose the finish response, repeat the finish call with the same path.

A client needs a way to send file bytes over HTTPS to perform step two. If your chat client cannot transfer a file, open the draft’s Studio link and attach it there.

## Add a banner, image or animation

For a banner, put the finished image’s `banner` value in the guide’s `banner` field. A video is only available for inline placement.

For an inline image, insert the returned `markdown` into `bodyMarkdown` and add descriptive alt text inside the square brackets. For an animation, put the returned `[Guide animation](…)` Markdown on its own line and keep that label. Studio and the guide page recognize this line as a video player.

When modifying an existing draft, preserve the rest of its Markdown and send the current `expectedRevision`. Open the Studio link and check the banner, images and playback before [publishing the reviewed version](https://www.devguides.com/docs/publishing).
