Skip to content
PharmaFlow Knowledgebase
Esc
↑↓navigate↵open⌘Jpreview

Create a medicine photo upload URL

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
Authorization
AuthorizationBearer token (JWT) · headerrequired

JWT from POST /api/v1/auth/login sent as Authorization Bearer.

Request body
requiredapplication/json
content_typestringrequired
min length 1
size_bytesintegerrequired
max 9007199254740991
Responses
200

The presigned upload and the key it targets

keystringrequired
uploadUrlstringrequired
publicUrlstringrequired
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

detailstringrequired
401

Not authenticated

detailstringrequired
403

Caller is not an admin, inventory manager, or branch manager

detailstringrequired
500

Image storage is not configured

detailstringrequired
Try it
Server
Authorization
Bodyapplication/json
Request
curl -X POST 'http://localhost:8000/api/v1/images/medicines/upload-url' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "content_type": "string",
  "size_bytes": 1
}'
Response
{
  "key": "string",
  "uploadUrl": "string",
  "publicUrl": "string"
}