---
title: "Submit an action through Electronic Prescription Service"
method: POST
path: "/api/nhs/eps/actions"
tags: ["NHS-shaped adapters"]
---

# Submit an action through Electronic Prescription Service

`POST /api/nhs/eps/actions`

## Request

- Base URL: `https://sim.animahealth.com`
- URL: `https://sim.animahealth.com/api/nhs/eps/actions`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer
  - API key in cookie `sim_session`

Delegates to the pharmacy site action engine with that scope and its existing permissions. This is the simulator's action envelope, not the production NHS API's write protocol.

## Query parameters

- `world` string

## Headers

- `Idempotency-Key` string

## Request body

- Action: Executable request fields from the runtime Zod contract. Conditional requirements and clinical workflow transitions are also checked by the engine. Use the named examples as a starting point, choose a permitted site, and copy current resource IDs/versions from a workspace response. All drug prices are integer pence. No clinical advice is provided.
  - `type` 'hospital_note' | 'save_discharge_summary' | 'process_document' | 'messaging_action' | 'place_pharmacy_order' | 'update_pharmacy_basket' | 'remove_pharmacy_basket_line' | 'checkout_pharmacy_basket' | 'cancel_pharmacy_order' | 'receive_pharmacy_order' | 'receive_pharmacy_referral' | 'update_pharmacy_referral' | 'receive_stock' | 'update_stock_price' | 'link_prescription_stock' | 'register_attendance' | 'update_attendance' | 'connect_device' | 'create_task' | 'create_referral' | 'order_test' | 'draft_prescription' | 'book_appointment' | 'create_appointment_session' | 'set_appointment_slot' | 'arrive_appointment' | 'cancel_appointment' | 'save_consultation' | 'save_problem' | 'save_allergy' | 'send_message' | 'schedule_visit' | 'dispatch_robot' | 'review' | 'accept' | 'complete' | 'reject' | 'dispense' | 'collect' | 'share_record' | 'report_absence' | 'restore_staff' | 'allocate_shift', required
  - `clientRequestId` string, uuid
  - `hospitalNoteCommand` union
    - object
      - `kind` 'save', required
      - `template` 'free-text' | 'history-physical' | 'progress', required
      - `sections` object[], required
        - `id` string, required
        - `heading` string, required
        - `text` string, required
    - object
      - `kind` 'sign', required
    - object
      - `kind` 'addendum', required
      - `text` string, required
  - `medicationOrder` object
    - `drug` string, required
    - `dose` string, required
    - `unit` string, required
    - `route` string, required
    - `frequency` string, required
    - `duration` string, required
    - `quantity` integer, required
    - `indication` string, required
  - `bloodTestOrder` object
    - `panel` string, required
    - `panelId` 'fbc' | 'ue' | 'hba1c' | 'lft' | 'crp' | 'lipids'
    - `specimen` string, required
    - `priority` 'routine' | 'urgent', required
    - `collection` 'now' | 'next-round', required
    - `clinicalDetails` string, required
  - `dischargeSections` object
    - `reason` string, required
    - `course` string, required
    - `diagnoses` string, required
    - `medicationChanges` string, required
    - `results` string, required
    - `followUp` string, required
    - `gpActions` string, required
  - `messagingCommand` union
    - object
      - `kind` 'patient_create', required
      - `subject` string, required
      - `body` string, required
      - `channel` 'sms' | 'email', required
    - object
      - `kind` 'reply', required
      - `body` string, required
    - object
      - `kind` 'create', required
      - `subject` string, required
      - `body` string, required
      - `channel` 'sms' | 'email', required
      - `allowReply` boolean, required
    - object
      - `kind` 'send', required
      - `body` string, required
      - `channel` 'sms' | 'email', required
    - object
      - `kind` 'configure_auto_reply', required
      - `steps` object[], required
        - `body` string, required
        - `delayMinutes` number, required
    - object
      - `kind` 'note', required
      - `body` string, required
    - object
      - `kind` 'assign', required
      - `assignee` string, required
    - object
      - `kind` 'complete', required
    - object
      - `kind` 'reopen', required
    - object
      - `kind` 'delivery', required
      - `entryId` string, required
      - `status` 'delivered' | 'failed', required
    - object
      - `kind` 'retry', required
      - `entryId` string, required
    - object
      - `kind` 'save_template', required
      - `title` string, required
      - `body` string, required
      - `channel` 'sms' | 'email', required
    - object
      - `kind` 'archive_template', required
  - `documentTags` string[]
  - `documentSnomedCodes` object[]
    - `code` string, required
    - `display` string, required
  - `documentCommand` 'send' | 'assign' | 'review' | 'file' | 'annotate'
  - `patientId` string
  - `resourceId` string
  - `title` string
  - `target` 'control' | 'gp' | 'hospital' | 'community' | 'pharmacy' | 'diagnostics' | 'referrals' | 'wearables' | 'legacy'
  - `expectedVersion` integer
  - `text` string
  - `consultationStatus` 'draft' | 'saved'
  - `allergyStatus` 'active' | 'inactive'
  - `reaction` string
  - `sourceAllergyKey` string
  - `problemStatus` 'active' | 'resolved'
  - `problemCode` string
  - `onsetDate` string, date
  - `sourceProblemKey` string
  - `startsAt` integer
  - `endsAt` integer
  - `slotMinutes` integer
  - `sessionId` string
  - `sessionVersion` integer
  - `slotCommand` 'block' | 'unblock'
  - `durationMinutes` integer
  - `productId` string
  - `quoteId` string
  - `quoteVersion` integer
  - `requiredUnits` integer
  - `quantity` integer
  - `costPence` integer
  - `pricePence` integer
  - `reorderLevel` integer
  - `pharmacyPathway` 'Sinusitis' | 'Sore throat' | 'Acute otitis media' | 'Infected insect bites' | 'Impetigo' | 'Shingles' | 'Uncomplicated UTI' | 'Minor illness' | 'Urgent medicine supply'
  - `referralSource` 'gp' | 'hospital' | 'patient' | 'referrals'
  - `pharmacyCommand` 'accept' | 'consult' | 'complete'
  - `hospitalCommand` 'assign' | 'assess' | 'refer' | 'admit' | 'discharge'
  - `acuity` '1' | '2' | '3' | '4' | '5'
  - `location` string
  - `disposition` string
  - `clinician` string
  - `mode` 'in-person' | 'telephone' | 'video' | 'online'

## Response `200`

Success

- Resource
  - `id` string, required
  - `patientId` string
  - `kind` string, required
  - `title` string, required
  - `status` string, required
  - `owner` string, required
  - `visibleTo` string[], required
  - `priority` 'routine' | 'urgent', required
  - `createdAt` number, required: Simulation Unix timestamp in milliseconds.
  - `dueAt` number: Simulation Unix timestamp in milliseconds.
  - `data` object, required: Kind-specific payload. Hospital notes, medication orders and blood-test orders use the named schemas; the full workspace payload is returned without projection.
  - `version` integer, required
  - `provenance` object
    - `created` RecordChange, required
      - `actor` object, required
        - `kind` 'team' | 'operator' | 'simulation', required
        - `name` string, required
      - `source` string, required
      - `action` string, required
      - `time` number, required: Simulation Unix timestamp in milliseconds.
      - `version` integer, required
    - `changes` RecordChange[], required
      - `actor` object, required
        - `kind` 'team' | 'operator' | 'simulation', required
        - `name` string, required
      - `source` string, required
      - `action` string, required
      - `time` number, required: Simulation Unix timestamp in milliseconds.
      - `version` integer, required
    - `recovery` object

## Other responses

- `400`: Invalid input or unsupported workflow
- `401`: Missing or invalid credentials
- `403`: Scope, origin or operator restriction
- `404`: Unknown resource
- `409`: Stale version, invalid transition or unavailable capacity
- `413`: Request exceeds this operation's body-size limit
- `429`: Deployment has reached its 5,000-team capacity
- `500`: Internal simulation error

---

[API](https://skmtc.dev/animahealth/apis/nhs-sim-api.md) - [All operations](https://skmtc.dev/animahealth/apis/nhs-sim-api/llms.txt) - [OpenAPI document](https://skmtc.dev/animahealth/apis/nhs-sim-api/revisions/c7803d7a3e58?raw)
