API Reference
Episodes

Episodes

Episodes are the core clinical workflow unit in Jump EHR — they represent items in the practice inbox. Each episode tracks a clinical workflow for a patient, from initial trigger (appointment booking, lab result, questionnaire submission) through to resolution.

Endpoints

MethodEndpointDescription
GET/episodesList episodes
GET/episodes/{id}Retrieve an episode
POST/episodesCreate an episode
PATCH/episodes/{id}Update an episode
POST/episodes/{id}/closeClose an episode
POST/episodes/{id}/reopenReopen a closed episode
POST/episodes/{id}/assignAssign an episode
POST/episodes/{id}/change-priorityChange priority
GET/episodes/{id}/eventsList events for an episode
POST/episodes/{id}/eventsAdd an event to an episode

Status, priority, and assignment changes must use action endpoints — they cannot be changed via PATCH. This ensures audit trails are maintained.

The Episode Object

{
  "id": "ep_123e4567-e89b-12d3-a456-426614174000",
  "patient_id": "pat_456e7890-e89b-12d3-a456-426614174111",
  "title": "Lab result review — Blood panel",
  "description": "Routine blood test results received from TDL",
  "status": "open",
  "responsibility": "practice",
  "assigned_to": "usr_789a0123-e89b-12d3-a456-426614174222",
  "priority": "medium",
  "journey_type": "clinical_result",
  "source_type": "lab_result",
  "source_id": "lr_012b3456-e89b-12d3-a456-426614174333",
  "problem_ids": [],
  "tags": ["blood-panel", "routine"],
  "due_date": "2025-01-20T17:00:00Z",
  "closed_at": null,
  "programme_id": null,
  "inbox_visibility": "surface",
  "created_at": "2025-01-15T10:30:00Z",
  "updated_at": "2025-01-15T14:20:00Z"
}

Status Values

StatusResponsibilityDescription
openpractice or patientActive, awaiting action
pending_patientpatientWaiting on patient response
awaiting_reviewpracticeReady for clinical review
closednoneResolved

Journey Types

Episodes are partitioned by journey type to prevent unrelated events from merging:

general, access, questionnaire, clinical_result, communication, identity, billing, prescription, clinical_access, document

Priority Values

low, medium, high, urgent


List Episodes

GET /episodes

Sorted by updated_at descending (most recently active first) — inbox semantics.

Query Parameters

ParameterTypeDescription
limit / offsetintegerPagination (default 20)
searchstringSearch by title or description
patient_idstringFilter by patient
statusstringFilter by status
status_instringMultiple statuses (comma-separated)
responsibilitystringFilter by practice or patient
assigned_tostringFilter by assigned user ID
prioritystringFilter by priority
priority_instringMultiple priorities (comma-separated)
journey_typestringFilter by journey type
journey_type_instringMultiple journey types (comma-separated)
source_typestringFilter by source type
source_idstringFilter by source ID
programme_idstringFilter by care programme
inbox_visibilitystringsurface or silent
due_date_gte / due_date_ltestringDue date range
created_at_gte / created_at_ltestringCreation date range

Request

curl -X GET "https://app.usejump.co.uk/functions/v1/api-v1/episodes?status=open&priority_in=high,urgent&limit=20" \
  -H "Authorization: Bearer pk_live_your_api_key"

Create an Episode

POST /episodes

Supports idempotency via Idempotency-Key header.

Required Fields

FieldTypeDescription
patient_idstringPatient ID
titlestringEpisode title

Optional Fields

FieldTypeDescription
descriptionstringDetailed description
statusstringInitial status (not closed)
responsibilitystringpractice, patient, or none
assigned_tostringUser ID to assign
prioritystringlow, medium, high, urgent
journey_typestringJourney type classification
source_typestringWhat created this episode
source_idstringSource object ID
problem_idsarrayLinked problem UUIDs
tagsarrayTags
due_datestringISO 8601 due date
programme_idstringCare programme ID
inbox_visibilitystringsurface or silent
⚠️

Consistency rules are enforced on create: status: "pending_patient" requires responsibility: "patient", and responsibility: "none" is only valid for closed episodes.


Update an Episode

PATCH /episodes/{id}

Updates metadata fields only. For status, priority, and assignment changes, use the action endpoints below.

Updatable Fields

title, description, due_date, problem_ids, tags, journey_type, source_type, source_id, programme_id, inbox_visibility


Close an Episode

POST /episodes/{id}/close

Close an open, pending_patient, or awaiting_review episode. Already-closed episodes return 422 INVALID_STATE_TRANSITION.

Request Body (optional)

FieldTypeDescription
reasonstringresolved, duplicate, patient_declined, or admin_closed
notestringFree-text note

Response

{
  "data": { "id": "ep_123", "status": "closed", "responsibility": "none", "closed_at": "2025-01-15T15:00:00Z" },
  "meta": {
    "request_id": "req_abc123",
    "action": "closed",
    "performed_at": "2025-01-15T15:00:00Z",
    "performed_by": "key_abc123"
  }
}

Reopen an Episode

POST /episodes/{id}/reopen

Reopen a closed episode. Only closed episodes can be reopened.

Request Body (optional)

FieldTypeDefaultDescription
statusstringopenTarget status (open, pending_patient, awaiting_review)
responsibilitystringpracticepractice or patient
reasonstring-Free-text reason

Assign an Episode

POST /episodes/{id}/assign

Assign or unassign an episode. Cannot assign closed episodes.

Request Body

FieldTypeRequiredDescription
assigned_tostring|nullYesUser UUID, or null to unassign
responsibilitystringNopractice or patient
⚠️

You cannot set responsibility: "practice" with assigned_to: null. Either provide an assignee or set responsibility to patient.


Change Priority

POST /episodes/{id}/change-priority

Change the priority of a non-closed episode.

Request Body

FieldTypeRequiredDescription
prioritystringYeslow, medium, high, or urgent
reasonstringNoReason for change

Episode Events

See Episode Events for the nested event endpoints (GET /episodes/{id}/events and POST /episodes/{id}/events).


Related Resources