Skip to main content
Use this endpoint to modify an existing medication. Only the fields you include in the request body are changed — all other fields remain untouched. A common use case is marking a medication inactive or updating its expiration date when a new lot arrives.

Request

PATCH https://api.clinikapi.com/v1/medications/:id

Headers

x-api-key
string
required
Your ClinikAPI secret key (clk_live_* or clk_test_*).
Content-Type
string
required
Must be application/json.

Path parameters

id
string
required
The ID of the medication to update (e.g. med_abc123).

Body

status
string
Updated medication status. One of: active, inactive.
form
string
Updated dosage form (e.g. "tablet", "capsule", "injection").
ingredient
array
Replacement ingredient list. Providing this field replaces the entire existing list.
batch
object
Updated batch information. Providing this field replaces the existing batch object.

Response

Returns 200 OK with the full updated medication resource.
data.id
string
The medication ID.
data.status
string
Updated status value.
data.batch
object
Updated batch details, if changed.
meta
object
Standard response metadata including requestId, timestamp, status, and rate-limit fields.

Examples

curl

curl -X PATCH https://api.clinikapi.com/v1/medications/med_abc123 \
  -H "x-api-key: clk_live_abc123" \
  -H "Content-Type: application/json" \
  -d '{
    "status": "inactive",
    "batch": { "expirationDate": "2025-06-30" }
  }'

TypeScript SDK

import { Clinik } from '@clinikapi/sdk';

const clinik = new Clinik(process.env.CLINIKAPI_SECRET_KEY!);

const { data } = await clinik.medications.update('med_abc123', {
  status: 'inactive',
  batch: { expirationDate: '2025-06-30' },
});

console.log(data.status); // 'inactive'