# Neurologyca Engine 2 API

Version: v2

The HTTP API of Neurologyca Engine 2, the one your backend calls. With the SDK you rarely call it yourself.

Base URL: `$ENGINE` (your environment's Engine URL is in your kit). Your backend exchanges your API key for a token with `POST /token` and sends it as `Authorization: Bearer <token>`.

_Example values are synthetic. Schemas marked as derived show the shape of one real, sanitized response, not a contract._

- `POST /token` — Obtain a JWT bearer token
- `POST /token/capture` — Obtain a short-lived token limited to one capture
- `GET /user-protocols/{userProtocolId}/health` — Status of one of a user's protocols
- `PATCH /user-protocols/{userProtocolId}/{protocolMechanicId}/query` — Update the active query phrase
- `POST /user-protocols/{userProtocolId}/{protocolMechanicId}/context` — Set or update the Constellation context
- `POST /user-protocols` — Assign a protocol to a user
- `GET /user-protocols/{userProtocolId}` — Get user-protocol detail and mechanic checklist
- `GET /user-protocols/{userProtocolId}/interruptions` — List the microinterventions of a user-protocol
- `GET /user-protocols/{userProtocolId}/{protocolMechanicId}/sessions` — List session attempts for a protocol mechanic
- `GET /user-protocols/{userProtocolId}/mechanics/{protocolMechanicId}` — Get the script for a mechanic
- `GET /user-protocols/{userProtocolId}/schema` — Get the whole protocol in one call
- `POST /user-protocols/{userProtocolId}/{protocolMechanicId}/cancel` — Cancel the capture in progress for a mechanic
- `POST /user-protocols/{userProtocolId}/{protocolMechanicId}/recordings` — Announce the upload of a recording
- `POST /user-protocols/{userProtocolId}/{protocolMechanicId}/recordings/{captureId}/complete` — Confirm the upload of a recording
- `GET /user-protocols/{userProtocolId}/{protocolMechanicId}/recordings/{captureId}` — Get the state of a recording upload
- `GET /user-protocols/{userProtocolId}/{protocolMechanicId}/recordings/{captureId}/video` — Get a read URL for the uploaded video
- `POST /process-kpn-emo` — Submit a batch of biometric frames for processing
- `POST /analyze` — Run psychophysiological analysis
- `POST /analyze/stream` — Run analysis and stream the result over SSE
- `GET /users` — List users
- `POST /users` — Create an app_user in the token's organization
- `PATCH /users/{external_id}` — Update a user's profile
- `DELETE /users/{external_id}` — Delete a user and all their data
- `GET /catalog/media` — List catalog media
- `GET /catalog/step_types` — List catalog step types
- `GET /catalog/contexts` — List catalog contexts
- `GET /catalog/mechanics` — List catalog mechanics
- `GET /catalog/mechanics/{pid}` — Read a mechanic and its script from the catalog
- `GET /catalog/protocols` — List catalog protocols
- `GET /catalog/step_type_media` — List step_type ↔ media associations
- `GET /catalog/mechanic_step` — List the steps that make up each mechanic
- `GET /catalog/protocol_mechanic` — List the mechanics that make up each protocol
- `GET /catalog/protocol_group` — List catalog protocol groups
- `GET /users/{external_id}/status` — Status of all of a user's protocols
- `POST /users/block` — Block users
- `POST /users/unblock` — Unblock users
- `GET /stream/{userProtocolId}` — Subscribe to live SSE events for a user protocol
- `POST /interruptions/{interruptionId}/process-kpn-emo` — Upload frames for a microintervention
- `GET /interruptions/{interruptionId}` — What microintervention is offered, and what to show
- `GET /results/{userProtocolId}/{protocolMechanicId}/{stepOrder}` — Retrieve HCI results of one step
- `GET /results/{userProtocolId}/{protocolMechanicId}` — Retrieve HCI results of one mechanic
- `GET /results/{userProtocolId}` — Retrieve HCI results of every mechanic of a user-protocol
- `GET /results/interruption/{interruptionId}` — Results of a microintervention: both sides
- `GET /users/{app_user}/baseline` — Check baseline status for a user
- `POST /users/{app_user}/baseline` — Capture or refresh a user's baseline
- `GET /users/{app_user}/user-protocols` — List protocol assignments for a user
- `POST /interruptions/{interruptionId}/cancel` — Cancel the microintervention in progress
