---
search:
  tags:
    - Images
    - POST
seo:
  description: >-
    Admin, inventory manager, or branch manager. Points a… Reference for the
    POST /api/v1/images/medicines/{medicineId}/image endpoint in the PharmaFlow
    API.
sidebar:
  label: Attach an uploaded photo to a medicine
  badge: POST
title: Attach an uploaded photo to a medicine
type: openapi-operation
---
Admin, inventory manager, or branch manager. Points a medicine at an already stored photo. The key must sit under the medicines prefix at 5 MB or less, and the medicine must exist.

`POST /api/v1/images/medicines/{medicineId}/image`

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

- `image_key` (string, required)

Request body example:

```json
{
  "image_key": "string"
}
```

**Responses**

- `200` — The medicine with its new photo
- `400` — The image key is not under the medicines prefix, or the upload is missing or larger than 5 MB
- `401` — Not authenticated
- `403` — Caller is not an admin, inventory manager, or branch manager
- `404` — Medicine not found
- `500` — Image storage is unavailable

Response example, 200:

```json
{
  "id": "string",
  "name": "string",
  "generic_name": "string",
  "barcode": "string",
  "category": "string",
  "form": "string",
  "strength": "string",
  "unit": "string",
  "selling_price": "string",
  "max_public_price": "string",
  "stock_quantity": -9007199254740991,
  "low_stock_threshold": -9007199254740991,
  "requires_prescription": true,
  "is_controlled": true,
  "vat_category": "string",
  "requires_cold_chain": true,
  "sfda_registration_no": "string",
  "image_key": "string",
  "image_url": "string",
  "is_active": true,
  "created_at": "string",
  "updated_at": "string"
}
```
