Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.nextmed.med.br/llms.txt

Use this file to discover all available pages before exploring further.

Videochamadas

Criar meeting no Dyte

POST /api/dyte/meeting
Body:
{
  "titleMeet": "referral-id-ou-titulo"
}
Chamada server-side para Dyte:
POST {DYTE_BASE_URL}/meetings
Authorization: Basic {DYTE_TOKEN}
Payload enviado para Dyte:
{
  "title": "referral-id-ou-titulo",
  "preferred_region": "ap-south-1",
  "record_on_start": false,
  "live_stream_on_start": false
}
Resposta interna:
{
  "data": {
    "id": "meeting-id",
    "title": "titulo",
    "preferred_region": "ap-south-1",
    "created_at": "2026-01-01T00:00:00Z",
    "record_on_start": false,
    "updated_at": "2026-01-01T00:00:00Z",
    "live_stream_on_start": false,
    "persist_chat": false,
    "summarize_on_end": false,
    "status": "ACTIVE",
    "recording_config": "NOT_CONFIGURED"
  }
}

Adicionar participante

POST /api/dyte/participants
Body:
type AddParticipantRequest = {
  user: {
    name: string;
    avatar: string;
    id: string;
  };
  idMeet: string;
  type_preset: "group_call_host" | "group_call_participant";
};
Resposta:
{
  "data": {
    "id": "participant-id",
    "name": "Nome",
    "picture": "https://...",
    "custom_participant_id": "user-id",
    "preset_name": "group_call_host",
    "created_at": "2026-01-01T00:00:00Z",
    "updated_at": "2026-01-01T00:00:00Z",
    "token": "dyte-token"
  }
}

Atualizar status do usuario na meeting

POST /attendance-service/referrals/{referralId}/meetings/{meetingId}/user
Body:
{
  "inMeeting": false,
  "userId": "doctor-id"
}

Endpoint interno para saida de medico

POST /api/update-doctor-meet
Body:
{
  "doctorID": "doctor-id",
  "referralID": "referral-id",
  "meetID": "meet-id"
}

Webhook Dyte

POST /api/dyte/webhook
Body:
type DyteWebhookRequest = {
  event: string;
  meeting: {
    id?: string;
    sessionId?: string;
    title: string;
    status?: string;
    createdAt?: string;
    startedAt?: string;
    endedAt?: string;
    organizedBy?: {
      id: string;
      name: string;
    };
  };
  reason: "HOST_ENDED_MEETING" | "ALL_PARTICIPANTS_LEFT";
};
Regra:
  • meeting.title e tratado como referralID.
  • quando reason e ALL_PARTICIPANTS_LEFT, a BFF busca o encaminhamento e marca solicitante e especialista como inMeeting: false.
Resposta:
{
  "message": "Videochamada atualizada com sucesso!"
}