ANABOX smart
API Guide

Create a Medication Schedule

Create an organization medication, assign an intake entry to a patient, and verify the resulting calendar data.

This example creates a medication record and a single calendar entry. Use test data first: these writes can become part of a real patient's medication plan.

Set the IDs and credential you discovered in Your First Requests:

export ORGANIZATION_ID="..."
export PATIENT_ID="..."
export MEMO_API_KEY="..."

1. Create a medication

curl --fail-with-body \
  "https://api.memo.wirewire.de/v1/medications/" \
  --request POST \
  --header "Content-Type: application/json" \
  --header "x-api-key: $MEMO_API_KEY" \
  --data "{
    \"organization\": \"$ORGANIZATION_ID\",
    \"name\": \"Example medication\",
    \"meta\": {
      \"dosageForm\": \"tablet\"
    }
  }"

The response contains the new medication id. Save it as MEDICATION_ID for the next request.

2. Create a calendar entry

curl --fail-with-body \
  "https://api.memo.wirewire.de/v1/calendars/" \
  --request POST \
  --header "Content-Type: application/json" \
  --header "x-api-key: $MEMO_API_KEY" \
  --data "{
    \"patient\": \"$PATIENT_ID\",
    \"organization\": \"$ORGANIZATION_ID\",
    \"medication\": \"$MEDICATION_ID\",
    \"date\": \"2026-08-10T06:00:00.000Z\",
    \"timeCategory\": \"morning\",
    \"amount\": 1,
    \"unit\": \"tablet\",
    \"emptyStomach\": false,
    \"instruction\": \"Take with water\"
  }"

Use a future timestamp appropriate for the patient's time zone. Do not copy the example date into production.

3. Verify the schedule

curl --fail-with-body --get \
  "https://api.memo.wirewire.de/v1/calendars/" \
  --header "Accept: application/json" \
  --header "x-api-key: $MEMO_API_KEY" \
  --data-urlencode "patient=$PATIENT_ID" \
  --data-urlencode "limit=50"

Confirm the patient, medication, timestamp, amount, and instruction in the returned entry before moving on.

Recurrence and baking

Calendar entries can include recurrence data in rrule. The API also provides bake and unbake operations for materializing schedule entries across a from/to window.

Review before finalizing

Recurrence and bake operations can produce many intake events. Generate the smallest practical window, inspect the resulting entries, and avoid automatic retries: the current schema does not define idempotency keys for these writes.

See the Create calendar entry reference for the current request fields and response schemas.