---
search:
  tags:
    - Images
    - POST
seo:
  description: >-
    Admin, inventory manager, or branch manager. Returns a presigned… Reference
    for the POST /api/v1/images/medicines/upload-url endpoint in the PharmaFlow
    API.
sidebar:
  label: Create a medicine photo upload URL
  badge: POST
title: Create a medicine photo upload URL
type: openapi-operation
---
Admin, inventory manager, or branch manager. Returns a presigned medicine photo upload URL. The key sits under the medicines prefix and allows JPEG, PNG, or WebP photos of 5 MB or less.

`POST /api/v1/images/medicines/upload-url`

**Request body** (`application/json`, required)

- `content_type` (string, required)
- `size_bytes` (integer, required)

Request body example:

```json
{
  "content_type": "string",
  "size_bytes": 1
}
```

**Responses**

- `200` — The presigned upload and the key it targets
- `400` — The size is not a positive whole number, the content type is not JPEG, PNG, or WebP, or the photo is more than 5 MB
- `401` — Not authenticated
- `403` — Caller is not an admin, inventory manager, or branch manager
- `500` — Image storage is not configured

Response example, 200:

```json
{
  "key": "string",
  "uploadUrl": "string",
  "publicUrl": "string"
}
```
