{ "openapi": "3.0.0", "info": { "title": "AI Therapy API", "version": "1.0.0", "description": "API documentation for the AI Therapy application." }, "servers": [ { "url": "http://localhost:3000/api/v1" } ], "paths": { "/ai/chat": { "post": { "summary": "AI chat for mental support of patient", "description": "Sends a user question and relevant patient summaries to the Azure OpenAI model\nto generate a response. The response is streamed back chunk by chunk, \nusing 'text/plain' and 'Transfer-Encoding: chunked'.\n", "tags": [ "AI" ], "security": [ { "BearerAuth": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "patientId", "question" ], "properties": { "patientId": { "type": "string", "description": "The ID of the patient whose summaries will be used as context (RAG)." }, "aiSessionId": { "type": "string", "description": "The ID of the AI chat session that this message belongs to." }, "question": { "type": "string", "description": "The user's query or instruction for the AI model." } }, "additionalProperties": false } } } }, "responses": { "200": { "description": "Streaming AI response successful (text/plain, chunked).", "content": { "text/plain": { "schema": { "type": "string", "example": "Based on the summaries, the patient's current status appears stable..." } } }, "headers": { "Transfer-Encoding": { "schema": { "type": "string", "example": "chunked" }, "description": "Indicates that the response is being sent in a streaming fashion." } } }, "default": { "$ref": "#/components/responses/DefaultErrorResponse" } } } }, "/authentication/register": { "post": { "summary": "User registration", "tags": [ "Authentication" ], "description": "Registers a new user.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "email": { "type": "string" }, "password": { "type": "string" }, "role": { "type": "string" }, "surname": { "type": "string" }, "givenName": { "type": "string" } }, "required": [ "email", "password", "role", "surname", "givenName" ], "additionalProperties": false } } } }, "responses": { "201": { "description": "User created successfully", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "email": { "type": "string" }, "role": { "type": "string" }, "surname": { "type": "string" }, "givenName": { "type": "string" } }, "required": [ "id", "email", "role", "surname", "givenName" ], "additionalProperties": false } } } }, "default": { "$ref": "#/components/responses/DefaultErrorResponse" } } } }, "/authentication/login": { "post": { "summary": "User login", "tags": [ "Authentication" ], "description": "Authenticates a user and returns a JWT token.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "email": { "type": "string" }, "password": { "type": "string" } }, "required": [ "email", "password" ], "additionalProperties": false } } } }, "responses": { "200": { "description": "Successful login", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "email": { "type": "string" }, "role": { "type": "string" }, "surname": { "type": "string", "nullable": true }, "givenName": { "type": "string", "nullable": true }, "token": { "type": "string", "description": "JWT token" } }, "required": [ "id", "email", "role", "surname", "givenName", "token" ], "additionalProperties": false } } } }, "default": { "$ref": "#/components/responses/DefaultErrorResponse" } } } }, "/authentication/logout": { "post": { "summary": "User logout", "tags": [ "Authentication" ], "description": "Logs out a user by blacklisting the provided JWT token.", "security": [ { "BearerAuth": [] } ], "responses": { "200": { "description": "Logged out successfully", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } }, "default": { "$ref": "#/components/responses/DefaultErrorResponse" } } } }, "/patients/{patientId}/therapists/{therapistId}/therapy-sessions": { "get": { "summary": "Get all therapy sessions a patient has with a selected therapist", "tags": [ "Patients" ], "security": [ { "BearerAuth": [] } ], "parameters": [ { "in": "path", "name": "patientId", "required": true, "schema": { "type": "string" }, "description": "The ID of the patient." }, { "in": "path", "name": "therapistId", "required": true, "schema": { "type": "string" }, "description": "The ID of the therapist." } ], "responses": { "200": { "description": "A list of therapy sessions.", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "required": [ "id", "patientId", "therapistId", "scheduledAt", "endedAt", "createdAt" ], "properties": { "id": { "type": "string" }, "patientId": { "type": "string" }, "therapistId": { "type": "string" }, "scheduledAt": { "type": "string", "format": "date-time" }, "endedAt": { "type": "string", "format": "date-time", "nullable": true }, "createdAt": { "type": "string", "format": "date-time" } }, "additionalProperties": false } } } } }, "default": { "$ref": "#/components/responses/DefaultErrorResponse" } } }, "post": { "summary": "Book a therapy session from an availability slot", "tags": [ "Patients" ], "security": [ { "BearerAuth": [] } ], "parameters": [ { "in": "path", "name": "patientId", "required": true, "schema": { "type": "string" }, "description": "The ID of the patient." }, { "in": "path", "name": "therapistId", "required": true, "schema": { "type": "string" }, "description": "The ID of the therapist." } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "slotId", "generateAiSummary" ], "properties": { "slotId": { "type": "string", "description": "The availability slot to book." }, "generateAiSummary": { "type": "boolean", "description": "Whether to generate an AI summary for the session." } }, "additionalProperties": false } } } }, "responses": { "201": { "description": "Therapy session created successfully.", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "patientId", "therapistId", "scheduledAt", "endedAt", "createdAt" ], "properties": { "id": { "type": "string" }, "patientId": { "type": "string" }, "therapistId": { "type": "string" }, "scheduledAt": { "type": "string", "format": "date-time" }, "endedAt": { "type": "string", "format": "date-time", "nullable": true }, "createdAt": { "type": "string", "format": "date-time" } }, "additionalProperties": false } } } }, "default": { "$ref": "#/components/responses/DefaultErrorResponse" } } } }, "/patients": { "get": { "summary": "Get a list of all active patients of a therapist. Used to display all active patients to the therapist.", "tags": [ "Patients" ], "security": [ { "BearerAuth": [] } ], "responses": { "200": { "description": "A list of all active patients.", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "required": [ "id", "surname", "givenName" ], "properties": { "id": { "type": "string" }, "surname": { "type": "string", "nullable": true }, "givenName": { "type": "string", "nullable": true } }, "additionalProperties": false } } } } }, "default": { "$ref": "#/components/responses/DefaultErrorResponse" } } } }, "/patients/{patientId}/assign-therapist": { "post": { "summary": "Assign a therapist to a patient", "tags": [ "Patients" ], "security": [ { "BearerAuth": [] } ], "parameters": [ { "in": "path", "name": "patientId", "required": true, "schema": { "type": "string" }, "description": "The ID of the patient." } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "therapistId" ], "properties": { "therapistId": { "type": "string" } }, "additionalProperties": false } } } }, "responses": { "201": { "description": "Therapist assigned successfully", "content": { "application/json": { "schema": { "type": "object", "required": [ "patientId", "therapistId", "active", "startedAt" ], "properties": { "patientId": { "type": "string" }, "therapistId": { "type": "string" }, "active": { "type": "boolean" }, "startedAt": { "type": "string", "format": "date-time" } }, "additionalProperties": false } } } }, "default": { "$ref": "#/components/responses/DefaultErrorResponse" } } } }, "/patients/{patientId}/therapists": { "get": { "summary": "Get active therapists assigned to a patient", "tags": [ "Patients" ], "security": [ { "BearerAuth": [] } ], "parameters": [ { "in": "path", "name": "patientId", "required": true, "schema": { "type": "string" }, "description": "The ID of the patient." } ], "responses": { "200": { "description": "A list of assigned therapists.", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "required": [ "id", "surname", "givenName" ], "properties": { "id": { "type": "string" }, "surname": { "type": "string", "nullable": true }, "givenName": { "type": "string", "nullable": true } }, "additionalProperties": false } } } } }, "default": { "$ref": "#/components/responses/DefaultErrorResponse" } } } }, "/patients/{patientId}/deassign-therapist": { "patch": { "summary": "Deassign a therapist from a patient", "tags": [ "Patients" ], "security": [ { "BearerAuth": [] } ], "parameters": [ { "in": "path", "name": "patientId", "required": true, "schema": { "type": "string" }, "description": "The ID of the patient." } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "therapistId" ], "properties": { "therapistId": { "type": "string" } }, "additionalProperties": false } } } }, "responses": { "200": { "description": "Therapist deassigned successfully", "content": { "application/json": { "schema": { "type": "object", "required": [ "patientId", "therapistId", "active", "endedAt" ], "properties": { "patientId": { "type": "string" }, "therapistId": { "type": "string" }, "active": { "type": "boolean" }, "endedAt": { "type": "string", "format": "date-time" } }, "additionalProperties": false } } } }, "default": { "$ref": "#/components/responses/DefaultErrorResponse" } } } }, "/patients/{patientId}/ai-sessions": { "post": { "summary": "Create a new ai session for a patient", "tags": [ "Patients" ], "security": [ { "BearerAuth": [] } ], "parameters": [ { "in": "path", "name": "patientId", "required": true, "schema": { "type": "string" }, "description": "The ID of the patient." } ], "responses": { "201": { "description": "AI session created successfully.", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "patientId", "createdAt" ], "properties": { "id": { "type": "string" }, "patientId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" } }, "additionalProperties": false } } } }, "default": { "$ref": "#/components/responses/DefaultErrorResponse" } } }, "get": { "summary": "Get all ai sessions for a patient", "tags": [ "Patients" ], "security": [ { "BearerAuth": [] } ], "parameters": [ { "in": "path", "name": "patientId", "required": true, "schema": { "type": "string" }, "description": "The ID of the patient." } ], "responses": { "200": { "description": "A list of ai sessions.", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "required": [ "id", "patientId", "createdAt", "closedAt" ], "properties": { "id": { "type": "string" }, "patientId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "closedAt": { "type": "string", "format": "date-time", "nullable": true } }, "additionalProperties": false } } } } }, "default": { "$ref": "#/components/responses/DefaultErrorResponse" } } } }, "/patients/{patientId}/ai-sessions/{aiSessionId}/messages": { "get": { "summary": "Get all ai chat messages for a patient", "tags": [ "Patients" ], "security": [ { "BearerAuth": [] } ], "parameters": [ { "in": "path", "name": "patientId", "required": true, "schema": { "type": "string" }, "description": "The ID of the patient." }, { "in": "path", "name": "aiSessionId", "required": true, "schema": { "type": "string" }, "description": "The ID of the ai chat session." } ], "responses": { "200": { "description": "A list of ai sessions.", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "required": [ "id", "aiSessionId", "role", "content", "createdAt" ], "properties": { "id": { "type": "string" }, "aiSessionId": { "type": "string" }, "role": { "type": "string" }, "content": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" } }, "additionalProperties": false } } } } }, "default": { "$ref": "#/components/responses/DefaultErrorResponse" } } } }, "/sessions/{therapySessionId}/join": { "post": { "summary": "Returns the JWT token to join a LiveKit session", "tags": [ "Sessions" ], "security": [ { "BearerAuth": [] } ], "parameters": [ { "in": "path", "name": "therapySessionId", "required": true, "schema": { "type": "string" }, "description": "The ID of the session." } ], "responses": { "200": { "description": "Returned the JWT token and URL to join a LiveKit session.", "content": { "application/json": { "schema": { "type": "object", "required": [ "token", "url" ], "properties": { "token": { "type": "string" }, "url": { "type": "string" } }, "additionalProperties": false } } } }, "default": { "$ref": "#/components/responses/DefaultErrorResponse" } } } }, "/therapists": { "get": { "summary": "Get a list of all therapists. Used to display all therapists to the patient.", "tags": [ "Therapists" ], "security": [ { "BearerAuth": [] } ], "responses": { "200": { "description": "A list of all therapists.", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "required": [ "id", "surname", "givenName" ], "properties": { "id": { "type": "string" }, "surname": { "type": "string", "nullable": true }, "givenName": { "type": "string", "nullable": true } }, "additionalProperties": false } } } } }, "default": { "$ref": "#/components/responses/DefaultErrorResponse" } } } }, "/therapists/me/availability": { "get": { "summary": "Get therapist availability slots", "tags": [ "Therapists" ], "security": [ { "BearerAuth": [] } ], "responses": { "200": { "description": "A list of availability slots.", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "required": [ "id", "therapistId", "startedAt", "endedAt", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "therapistId": { "type": "string" }, "startedAt": { "type": "string", "format": "date-time" }, "endedAt": { "type": "string", "format": "date-time" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "bookedBySessionId": { "type": "string", "nullable": true } }, "additionalProperties": false } } } } }, "default": { "$ref": "#/components/responses/DefaultErrorResponse" } } }, "post": { "summary": "Create an availability slot", "tags": [ "Therapists" ], "security": [ { "BearerAuth": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "startedAt" ], "properties": { "startedAt": { "type": "string", "format": "date-time", "description": "UTC start time for the slot." }, "endedAt": { "type": "string", "format": "date-time", "description": "UTC end time for the slot (optional, must be exactly 1 hour after startedAt)." } }, "additionalProperties": false } } } }, "responses": { "200": { "description": "Availability slot created.", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "therapistId", "startedAt", "endedAt", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "therapistId": { "type": "string" }, "startedAt": { "type": "string", "format": "date-time" }, "endedAt": { "type": "string", "format": "date-time" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } }, "additionalProperties": false } } } }, "default": { "$ref": "#/components/responses/DefaultErrorResponse" } } } }, "/therapists/{therapistId}/availability": { "get": { "summary": "Get availability slots for a therapist (patient view)", "tags": [ "Therapists" ], "security": [ { "BearerAuth": [] } ], "parameters": [ { "in": "path", "name": "therapistId", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "A list of availability slots.", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "required": [ "id", "therapistId", "startedAt", "endedAt", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "therapistId": { "type": "string" }, "startedAt": { "type": "string", "format": "date-time" }, "endedAt": { "type": "string", "format": "date-time" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } }, "additionalProperties": false } } } } }, "default": { "$ref": "#/components/responses/DefaultErrorResponse" } } } }, "/therapists/me/therapy-sessions/ai-summaries": { "get": { "summary": "Get all AI chat session summaries before specific therapy sessions", "tags": [ "Therapists" ], "security": [ { "BearerAuth": [] } ], "responses": { "200": { "description": "A list of ai chat session summaries.", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "required": [ "id", "patientId", "therapySessionId", "reportData", "includedSessionIds", "createdAt" ], "properties": { "id": { "type": "string" }, "patientId": { "type": "string" }, "therapySessionId": { "type": "string" }, "reportData": { "type": "object" }, "includedSessionIds": { "type": "array", "items": { "type": "string" } }, "createdAt": { "type": "string", "format": "date-time" } }, "additionalProperties": false, "description": "AI-generated summary payload. The structure in reportData is not yet finalized and may change." } } } } }, "default": { "$ref": "#/components/responses/DefaultErrorResponse" } } } }, "/therapists/me/therapy-sessions/{therapySessionId}/ai-summary": { "get": { "summary": "Get AI chat session summary before a specific therapy session", "tags": [ "Therapists" ], "security": [ { "BearerAuth": [] } ], "parameters": [ { "in": "path", "name": "therapySessionId", "required": true, "schema": { "type": "string" }, "description": "The ID of the therapy session." } ], "responses": { "200": { "description": "A session summary object.", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "patientId", "therapySessionId", "reportData", "includedSessionIds", "createdAt" ], "properties": { "id": { "type": "string" }, "patientId": { "type": "string" }, "therapySessionId": { "type": "string" }, "reportData": { "type": "object" }, "includedSessionIds": { "type": "array", "items": { "type": "string" } }, "createdAt": { "type": "string", "format": "date-time" } }, "additionalProperties": false, "description": "AI-generated summary payload. The structure in reportData is not yet finalized and may change." } } } }, "default": { "$ref": "#/components/responses/DefaultErrorResponse" } } } }, "/therapists/{therapistId}/therapy-sessions": { "post": { "summary": "Create a new therapy session", "description": "Creates a new therapy session between a therapist and a patient.\nOnly the therapist is allowed to create sessions.\n\nAfter the session is created, a background job is enqueued to\ngenerate an AI-based summary that provides the therapist with\nrelevant context about the patient before the session starts.\nThe summary is generated based on the patient's previous chat\nsessions. Currently, the summary is created 24 hours before\nthe scheduled session time and includes insights from the\npatient's chat history over the past 7 days.\n", "tags": [ "Therapists" ], "security": [ { "BearerAuth": [] } ], "parameters": [ { "in": "path", "name": "therapistId", "required": true, "schema": { "type": "string" }, "description": "The ID of the therapist." } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "patientId", "scheduledAt", "generateAiSummary" ], "properties": { "patientId": { "type": "string", "description": "The ID of the patient." }, "scheduledAt": { "type": "string", "format": "date-time", "description": "The scheduled date and time for the therapy session." }, "generateAiSummary": { "type": "boolean", "description": "Whether to generate an AI-based summary before the session.\nThis saves ai cost in development environments. Currently, this flag is not saved\nto the database and is only used to conditionally enqueue the background job.\nSo you will not be able to retrigger the summary generation job for this session.\nIn the future this flag will be stored in the therapy session table to allow\ntherapists to requeue summaries before upcoming sessions. \n" } }, "additionalProperties": false } } } }, "responses": { "200": { "description": "Therapy session created successfully.", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "patientId", "scheduledAt", "endedAt", "createdAt" ], "properties": { "id": { "type": "string" }, "patientId": { "type": "string" }, "scheduledAt": { "type": "string", "format": "date-time" }, "endedAt": { "type": "string", "format": "date-time", "nullable": true }, "createdAt": { "type": "string", "format": "date-time" } }, "additionalProperties": false } } } }, "default": { "$ref": "#/components/responses/DefaultErrorResponse" } } }, "get": { "summary": "Get all therapy sessions", "tags": [ "Therapists" ], "security": [ { "BearerAuth": [] } ], "parameters": [ { "in": "path", "name": "therapistId", "required": true, "schema": { "type": "string" }, "description": "The ID of the therapist." } ], "responses": { "200": { "description": "A list of therapy sessions.", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "required": [ "id", "patientId", "scheduledAt", "endedAt", "createdAt" ], "properties": { "id": { "type": "string" }, "patientId": { "type": "string" }, "scheduledAt": { "type": "string", "format": "date-time" }, "endedAt": { "type": "string", "format": "date-time", "nullable": true }, "createdAt": { "type": "string", "format": "date-time" } }, "additionalProperties": false } } } } }, "default": { "$ref": "#/components/responses/DefaultErrorResponse" } } } }, "/therapists/{therapistId}/therapy-sessions/{therapySessionId}/summary": { "post": { "summary": "Upload a session summary", "tags": [ "Therapists" ], "security": [ { "BearerAuth": [] } ], "parameters": [ { "in": "path", "name": "therapistId", "required": true, "schema": { "type": "string" }, "description": "The ID of the therapist." }, { "in": "path", "name": "therapySessionId", "required": true, "schema": { "type": "string" }, "description": "The ID of the therapy session." } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "summary" ], "properties": { "summary": { "type": "string", "description": "The summary of the therapy session." } }, "additionalProperties": false } } } }, "responses": { "200": { "description": "Therapy session summary uploaded successfully.", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "sessionType", "therapySessionId", "summaryText", "createdBy", "createdAt" ], "properties": { "id": { "type": "string" }, "sessionType": { "type": "string" }, "therapySessionId": { "type": "string" }, "summaryText": { "type": "string" }, "createdBy": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" } }, "additionalProperties": false } } } }, "default": { "$ref": "#/components/responses/DefaultErrorResponse" } } } }, "/therapists/{therapistId}/therapy-sessions/{therapySessionId}/ai-summary": { "post": { "summary": "Request an AI-generated summary of a therapy session between the therapist and patient.", "tags": [ "Therapists" ], "security": [ { "BearerAuth": [] } ], "parameters": [ { "in": "path", "name": "therapistId", "required": true, "schema": { "type": "string" }, "description": "The ID of the therapist." }, { "in": "path", "name": "therapySessionId", "required": true, "schema": { "type": "string" }, "description": "The ID of the therapy session." } ], "responses": { "200": { "description": "AI-generated therapy session summary successfully requested." }, "default": { "$ref": "#/components/responses/DefaultErrorResponse" } } }, "get": { "summary": "Get an AI-generated summary of a therapy session between the therapist and patient.", "tags": [ "Therapists" ], "security": [ { "BearerAuth": [] } ], "parameters": [ { "in": "path", "name": "therapistId", "required": true, "schema": { "type": "string" }, "description": "The ID of the therapist." }, { "in": "path", "name": "therapySessionId", "required": true, "schema": { "type": "string" }, "description": "The ID of the therapy session." } ], "responses": { "200": { "description": "AI-generated therapy session summary successfully retrieved.", "content": { "application/json": { "schema": { "type": "object", "required": [ "summary" ], "properties": { "summary": { "type": "object", "description": "The AI-generated summary of the therapy session." } }, "additionalProperties": false } } } }, "default": { "$ref": "#/components/responses/DefaultErrorResponse" } } } }, "/therapists/{therapistId}/therapy-sessions/summaries": { "get": { "summary": "Get all session summaries", "tags": [ "Therapists" ], "security": [ { "BearerAuth": [] } ], "parameters": [ { "in": "path", "name": "therapistId", "required": true, "schema": { "type": "string" }, "description": "The ID of the therapist." } ], "responses": { "200": { "description": "A list of session summaries.", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "required": [ "id", "sessionType", "therapySessionId", "summaryText", "createdBy", "createdAt" ], "properties": { "id": { "type": "string" }, "sessionType": { "type": "string" }, "therapySessionId": { "type": "string" }, "summaryText": { "type": "string" }, "createdBy": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" } }, "additionalProperties": false } } } } }, "default": { "$ref": "#/components/responses/DefaultErrorResponse" } } } }, "/therapists/{therapistId}/therapy-sessions/{therapySessionId}": { "get": { "summary": "Get a specific therapy session", "tags": [ "Therapists" ], "security": [ { "BearerAuth": [] } ], "parameters": [ { "in": "path", "name": "therapistId", "required": true, "schema": { "type": "string" }, "description": "The ID of the therapist." }, { "in": "path", "name": "therapySessionId", "required": true, "schema": { "type": "string" }, "description": "The ID of the therapy session." } ], "responses": { "200": { "description": "A therapy session object.", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "patientId", "scheduledAt", "endedAt", "createdAt" ], "properties": { "id": { "type": "string" }, "patientId": { "type": "string" }, "scheduledAt": { "type": "string", "format": "date-time" }, "endedAt": { "type": "string", "format": "date-time", "nullable": true }, "createdAt": { "type": "string", "format": "date-time" } }, "additionalProperties": false } } } }, "default": { "$ref": "#/components/responses/DefaultErrorResponse" } } } }, "/therapists/{therapistId}/therapy-sessions/summaries/{summaryId}": { "get": { "summary": "Get session summary for a specific therapy session", "tags": [ "Therapists" ], "security": [ { "BearerAuth": [] } ], "parameters": [ { "in": "path", "name": "therapistId", "required": true, "schema": { "type": "string" }, "description": "The ID of the therapist." }, { "in": "path", "name": "summaryId", "required": true, "schema": { "type": "string" }, "description": "The ID of the session summary." } ], "responses": { "200": { "description": "A session summary object.", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "sessionType", "therapySessionId", "summaryText", "createdBy", "createdAt" ], "properties": { "id": { "type": "string" }, "sessionType": { "type": "string" }, "therapySessionId": { "type": "string" }, "summaryText": { "type": "string" }, "createdBy": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" } }, "additionalProperties": false } } } }, "default": { "$ref": "#/components/responses/DefaultErrorResponse" } } } }, "/webhooks/livekit": { "post": { "summary": "LiveKit Webhook Receiver", "description": "Endpoint for self-hosted LiveKit server to send event updates.\nThis endpoint expects a **raw request body** and a valid LiveKit HMAC signature\nprovided via the Authorization header.\n", "tags": [ "Webhooks" ], "parameters": [ { "in": "header", "name": "Authorization", "required": true, "schema": { "type": "string" }, "description": "LiveKit webhook signature (HMAC-SHA256)." } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "string", "format": "binary" } } } }, "responses": { "200": { "description": "Webhook received and verified successfully." }, "400": { "description": "Invalid signature or malformed payload." } } } } }, "components": { "responses": { "DefaultErrorResponse": { "description": "Default error response", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": false, "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } } }, "securitySchemes": { "BearerAuth": { "type": "http", "scheme": "bearer", "bearerFormat": "JWT" } } }, "tags": [] }