API Reference
Episode Events

Episode Events

Episode events form the timeline within an episode — every status change, note, assignment, and clinical action is recorded as an event. Events are append-only and cannot be edited or deleted.

Endpoints

MethodEndpointDescription
GET/episodes/{id}/eventsList events for an episode
POST/episodes/{id}/eventsCreate an event on an episode
GET/episode-events/{id}Retrieve an event by ID (direct lookup)

Events are append-only. PATCH and DELETE return 405. To correct an event, create a new event with event_type: "note" referencing the original.

The Event Object

{
  "id": "evt_123e4567-e89b-12d3-a456-426614174000",
  "episode_id": "ep_456e7890-e89b-12d3-a456-426614174111",
  "event_type": "note",
  "title": "Clinical note added",
  "description": "Patient reported improvement in symptoms after medication change.",
  "created_by": "usr_789a0123-e89b-12d3-a456-426614174222",
  "created_by_type": "user",
  "mentioned_users": [],
  "extracted_tags": ["medication", "improvement"],
  "related_object_type": null,
  "related_object_id": null,
  "created_at": "2025-01-15T14:30:00Z",
  "updated_at": "2025-01-15T14:30:00Z"
}

Event Types

TypeDescription
noteFree-text clinical note
status_changeEpisode status transition (auto-created by close/reopen actions)
assignmentAssignment change (auto-created by assign action)
priority_changePriority change (auto-created by change-priority action)
questionnaireQuestionnaire request
questionnaire_responseQuestionnaire submitted
communicationEmail/SMS sent or received
appointmentAppointment-related activity
lab_resultLab result received
invoiceBilling event
prescriptionPrescription activity
identity_verificationIdentity check completed
automationSystem automation event
notificationNotification sent
systemSystem event

List Events for an Episode

GET /episodes/{id}/events

Query Parameters

ParameterTypeDescription
limit / offsetintegerPagination (default 20)
searchstringSearch by title or description
event_typestringFilter by event type
event_type_instringMultiple types (comma-separated)
created_bystringFilter by creator ID
created_by_typestringuser, system, or patient
related_object_typestringFilter by related object type
related_object_idstringFilter by related object ID
created_at_gte / created_at_ltestringDate range filter

Create an Event

POST /episodes/{id}/events

Add a new event to an episode's timeline. Supports idempotency via Idempotency-Key header (scoped to the episode).

Required Fields

FieldTypeDescription
event_typestringOne of the event types listed above
descriptionstringEvent description

Optional Fields

FieldTypeDefaultDescription
titlestring-Short title
created_bystring-User UUID who created the event
created_by_typestringsystemuser, system, or patient
mentioned_usersarray-UUIDs of mentioned users
extracted_tagsarray-Tags
related_object_typestring-Type of related object
related_object_idstring-ID of related object

The episode_id comes from the URL — do not include it in the request body.

Request

curl -X POST "https://app.usejump.co.uk/functions/v1/api-v1/episodes/ep_456e7890/events" \
  -H "Authorization: Bearer pk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "event_type": "note",
    "title": "Follow-up call",
    "description": "Spoke with patient, symptoms improving. Will review in 2 weeks."
  }'

Response (201 Created)

{
  "data": {
    "id": "evt_new123",
    "episode_id": "ep_456e7890",
    "event_type": "note",
    "title": "Follow-up call",
    "description": "Spoke with patient, symptoms improving. Will review in 2 weeks.",
    "created_by_type": "system",
    "created_at": "2025-01-15T15:00:00Z"
  },
  "meta": {
    "request_id": "req_abc123"
  }
}

Retrieve an Event

GET /episode-events/{id}

Direct lookup by event ID. Useful when you have an event ID from a webhook or another source.


Related Resources