Mediquo documentation home

API Reference

Full method reference for MediquoApiChatClient and its sub-clients.

MediquoApiChatClient

import { MediquoApiChatClient } from "@mediquo/core/api-client";

const client = new MediquoApiChatClient(config?);

Constructor

OptionTypeDefaultDescription
env"production" | "development""production"Selects the base URL for the target environment.
baseURLstringOverrides env. Use for proxies or custom deployments.

Methods

MethodSignatureDescription
setAuthToken(token: string) => voidSets Authorization: Bearer <token> on all subsequent requests.
setApiKey(apiKey: string) => voidSets the x-api-key header on all subsequent requests.
setLanguage(language: string) => voidSets the Accept-Language header on all subsequent requests.

Sub-clients

PropertyType
client.authApiChatAuthClient
client.appointmentsApiChatAppointmentsClient
client.schedulesApiChatSchedulesClient
client.roomsApiChatRoomsClient
client.profileApiChatProfileClient
client.professionalsApiChatProfessionalsClient
client.organizationsApiChatOrganizationsClient
client.paymentsApiChatPaymentsClient
client.flashApiChatFlashClient
client.documentsApiChatDocumentsClient

auth

import type { LoginTokenRequest, LoginTokenResponse } from "@mediquo/core/api-client/auth";

loginToken(request)

Exchanges an API key + patient token for a session access_token.

const { data } = await client.auth.loginToken({
  api_key: "your-api-key",
  token: "patient-token",
});
// data.access_token — use with setAuthToken()

Request

FieldTypeDescription
api_keystringYour platform API key.
tokenstringPatient-scoped token issued by your backend.

Response

FieldTypeDescription
access_tokenstringJWT to pass to setAuthToken().
patientobjectPatient profile and legal consent state.

appointments

import type { ... } from "@mediquo/core/api-client/appointments";

getAppointments(request)

Returns the authenticated patient's appointment list.

FieldTypeDescription
(no required fields)All filters are optional.

createAppointment(request)

Books a new appointment.

FieldTypeDescription
slot_idstringID of the schedule slot to book.
channelAppointmentChannel"videocall" | "chat" | "phonecall"
consultation_reasonstringOptional reason for the appointment.

getAppointment(request)

Fetches a single appointment by ID.

FieldTypeDescription
appointment_idstringUUID of the appointment.

rescheduleAppointment(request)

Moves an existing appointment to a new slot.

FieldTypeDescription
appointment_idstringUUID of the appointment to reschedule.
slot_idstringUUID of the new slot.

cancelAppointment(request)

Cancels an appointment.

FieldTypeDescription
appointment_idstringUUID of the appointment to cancel.

updateAppointment(request)

Updates mutable fields on an appointment.

FieldTypeDescription
appointment_idstringUUID of the appointment.
consultation_reasonstringUpdated consultation reason.

addDocument(request) / deleteDocument(request)

Attaches or removes a pre-consultation document from an appointment.

FieldTypeDescription
appointment_idstringUUID of the appointment.
document_idstringUUID of the document.

getDocumentsStorage()

Returns available storage quota for appointment documents.

reconnectAppointment(request)

Signals a reconnect intent for an in-progress appointment.

FieldTypeDescription
appointment_idstringUUID of the appointment.

schedules

import type { ... } from "@mediquo/core/api-client/schedules";

getScheduleServices()

Returns the list of bookable services for the authenticated organization.

getProfessionalsBySpecialtyAndService(request)

Returns professionals available for a given specialty and service combination.

FieldTypeDescription
specialty_idnumberID of the medical specialty.
service_idstringUUID of the service.

getScheduleServiceProfessionalSlots(request)

Returns available slots for a professional within a service.

FieldTypeDescription
service_idstringUUID of the service.
professional_idstringUUID of the professional.

getScheduleSlot(request)

Fetches a single schedule slot by ID.

FieldTypeDescription
slot_idstringUUID of the slot.

rooms

import type { ... } from "@mediquo/core/api-client/rooms";

getRoomMessages(request)

Returns the message history for a chat room.

FieldTypeDescription
room_idstringID of the chat room.

getUnreadMessagesCount(request)

Returns the unread message count for a room.

FieldTypeDescription
room_idstringID of the chat room.

profile

import type { ... } from "@mediquo/core/api-client/profile";

getPatientProfile()

Returns the authenticated patient's full profile.

getProfessionalPublicProfile(request)

Returns a professional's public-facing profile.

FieldTypeDescription
professional_idstringUUID of the professional.

acceptLegalConsent(request)

Records the patient's acceptance of legal consent terms.

FieldTypeDescription
consent_idstringID of the consent document accepted.

professionals

import type { ... } from "@mediquo/core/api-client/professionals";

getProfessional(request)

Fetches a professional's full record.

FieldTypeDescription
professional_idstringUUID of the professional.

readAllMessages(request)

Marks all messages in a professional's room as read.

FieldTypeDescription
professional_idstringUUID of the professional.

organizations

import type { ... } from "@mediquo/core/api-client/organizations";

getOrganizationSpecialties()

Returns the specialties configured for the authenticated organization.

getOrganizationSetup()

Returns the full setup configuration for the organization (feature flags, branding, enabled modules).


payments

import type { ... } from "@mediquo/core/api-client/payments";

createPaymentLink(request)

Generates a payment link for an appointment.

FieldTypeDescription
appointment_idstringUUID of the appointment to pay for.

Response

FieldTypeDescription
urlstringRedirect URL for the payment flow.

getPaymentSession(sessionId)

Retrieves the state of an existing payment session.

ParameterTypeDescription
sessionIdstringPayment session identifier.

flash

Flash appointments are immediate, on-demand consultations with a shorter lifecycle than scheduled ones.

import type { ... } from "@mediquo/core/api-client/flash";

getAppointment(request)

Returns a flash appointment by ID.

FieldTypeDescription
appointment_idstringUUID of the flash appointment.

joinCall(request)

Joins an active flash call session.

FieldTypeDescription
appointment_idstringUUID of the flash appointment.

Response

FieldTypeDescription
call_tokenstringToken for the video/audio call session.

setReady(request)

Signals that the patient is ready to start the flash call.

FieldTypeDescription
appointment_idstringUUID of the flash appointment.

getSharedDocuments(request) / downloadDocument(request)

Lists or downloads documents shared during a flash session.

FieldTypeDescription
appointment_idstringUUID of the flash appointment.
document_idstring(download only) UUID of the document.

downloadDocument returns a Blob.

updatePatientProfile(request)

Updates the patient's profile within the flash flow.

getPatientDocuments(request)

Returns the patient's document list in the context of a flash appointment.

FieldTypeDescription
appointment_idstringUUID of the flash appointment.

documents

import type { ... } from "@mediquo/core/api-client/documents";

uploadFile(request)

Uploads a file as a multipart form submission.

FieldTypeDescription
fileFile | BlobThe file to upload.
appointment_idstringUUID of the appointment to attach the file to.

Response

FieldTypeDescription
document_idstringUUID of the created document.
file_pathstringStorage path of the uploaded file.
file_namestringOriginal filename.