---
title: "Upload an image for embedding in an article figure"
method: POST
path: "/api/user/article-images"
tags: ["article-images"]
---

# Upload an image for embedding in an article figure

`POST /api/user/article-images`

## Request

- The document declares no server URL.
- Auth: none declared

Accepts JPEG, PNG, or WebP up to 5 MB. The image is re-encoded
server-side (downscaled to at most 2000px on the longest side, lossy
WebP, metadata stripped) and stored under a content-addressed key.

## Request body `multipart/form-data`

- UploadImageForm: Documentation-only shape of the multipart upload body; the handler reads the `file` part via `axum::extract::Multipart`.
  - `file` string, binary, required

## Response `200`

Image stored

- UploadedImageResponse
  - `byte_size` integer, required: Stored (re-encoded) size in bytes.
  - `height` integer, required
  - `storage_key` string, required
  - `url` string, required: First-party URL to embed in the `::figure{}` directive.
  - `width` integer, required

## Other responses

- `400`: Missing, oversized, or invalid image
- `401`: Not authenticated
- `403`: Insufficient permissions

## Changes

- **2026-09-08** `2a60b4064d2e`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/scholia-study/apis/scholia-api/changes/api/user/article-images/post.md)

---

[API](https://skmtc.dev/scholia-study/apis/scholia-api.md) - [All operations](https://skmtc.dev/scholia-study/apis/scholia-api/llms.txt) - [OpenAPI document](https://skmtc.dev/scholia-study/apis/scholia-api/revisions/684b3751bfd3?raw)
