Agenda

Referencia de 20 endpoints generados desde mosend-wb-backend/src/modules/agenda/agenda.controller.ts.

Base path: /organizations/:orgId/agenda·20 endpoints·Source: mosend-wb-backend/src/modules/agenda/agenda.controller.ts
GET/organizations/:orgId/agenda/settings
bearer

Configuración de la agenda de la organización.

Path params

  • orgIdstringrequerido

Respuestas

  • 200
curl -X GET 'https://api.mosend.dev/organizations/a1b2c3d4-1234-5678-9abc-def012345678/agenda/settings' \
  -H 'X-Api-Key: mk_live_<prefix>.<secret>'
Response · 200
{
  "data": {
    "id": "00000000-0000-0000-0000-000000000000",
    "createdAt": "2026-05-01T03:42:18.123Z"
  },
  "timestamp": "2026-05-01T03:42:18.123Z"
}
PATCH/organizations/:orgId/agenda/settings
bearer

Actualiza la configuración de la agenda (habilitar requiere la feature de plan `agenda`).

Path params

  • orgIdstringrequerido

Body (JSON)

  • enabledboolean
  • minNoticeMinnumber
  • maxAdvanceDaysnumber
  • reminderTemplateNamestring

    Plantilla aprobada para el recordatorio. Convención de variables: {{1}} = nombre del contacto, {{2}} = fecha y hora local de la cita.

  • reminderTemplateLangstring
  • reminderHoursBeforenumber

    Horas antes de la cita (0 = sin recordatorio, máx 72).

  • reminderPhoneNumberIdstring · uuid
  • bookingFlowIdstring · uuid

    WhatsAppFlow (local) publicado para reserva con date-picker nativo.

Respuestas

  • 200
curl -X PATCH 'https://api.mosend.dev/organizations/a1b2c3d4-1234-5678-9abc-def012345678/agenda/settings' \
  -H 'X-Api-Key: mk_live_<prefix>.<secret>' \
  -H 'Content-Type: application/json' \
  -d '{"enabled": true,"minNoticeMin": 0,"maxAdvanceDays": 0,"reminderTemplateName": "<reminderTemplateName>","reminderTemplateLang": "<reminderTemplateLang>","reminderHoursBefore": 0,"reminderPhoneNumberId": "00000000-0000-0000-0000-000000000000","bookingFlowId": "00000000-0000-0000-0000-000000000000"}'
Response · 200
{
  "data": {
    "id": "00000000-0000-0000-0000-000000000000",
    "name": "string",
    "description": "string"
  },
  "timestamp": "2026-05-01T03:42:18.123Z"
}
GET/organizations/:orgId/agenda/ics
bearer

Estado del feed ICS público (URL de suscripción o deshabilitado).

Path params

  • orgIdstringrequerido

Respuestas

  • 200
curl -X GET 'https://api.mosend.dev/organizations/a1b2c3d4-1234-5678-9abc-def012345678/agenda/ics' \
  -H 'X-Api-Key: mk_live_<prefix>.<secret>'
Response · 200
{
  "data": {
    "id": "00000000-0000-0000-0000-000000000000",
    "createdAt": "2026-05-01T03:42:18.123Z"
  },
  "timestamp": "2026-05-01T03:42:18.123Z"
}
POST/organizations/:orgId/agenda/ics/rotate
bearer

Genera o rota el token del feed ICS (rotar revoca las suscripciones previas).

Path params

  • orgIdstringrequerido

Respuestas

  • 201
curl -X POST 'https://api.mosend.dev/organizations/a1b2c3d4-1234-5678-9abc-def012345678/agenda/ics/rotate' \
  -H 'X-Api-Key: mk_live_<prefix>.<secret>'
Response · 200
{
  "data": {
    "id": "00000000-0000-0000-0000-000000000000",
    "createdAt": "2026-05-01T03:42:18.123Z"
  },
  "timestamp": "2026-05-01T03:42:18.123Z"
}
DELETE/organizations/:orgId/agenda/ics
bearer

Desactiva el feed ICS (borra el token).

Path params

  • orgIdstringrequerido

Respuestas

  • 200
curl -X DELETE 'https://api.mosend.dev/organizations/a1b2c3d4-1234-5678-9abc-def012345678/agenda/ics' \
  -H 'X-Api-Key: mk_live_<prefix>.<secret>'
Response · 200
{
  "data": {
    "id": "00000000-0000-0000-0000-000000000000",
    "createdAt": "2026-05-01T03:42:18.123Z"
  },
  "timestamp": "2026-05-01T03:42:18.123Z"
}
GET/organizations/:orgId/agenda/types
bearer

Lista los tipos de cita (servicios reservables).

Path params

  • orgIdstringrequerido

Respuestas

  • 200
curl -X GET 'https://api.mosend.dev/organizations/a1b2c3d4-1234-5678-9abc-def012345678/agenda/types' \
  -H 'X-Api-Key: mk_live_<prefix>.<secret>'
Response · 200
{
  "data": [
    {
      "id": "00000000-0000-0000-0000-000000000000",
      "createdAt": "2026-05-01T03:42:18.123Z"
    }
  ],
  "timestamp": "2026-05-01T03:42:18.123Z"
}
POST/organizations/:orgId/agenda/types
bearer

Crea un tipo de cita (duración + colchón).

Path params

  • orgIdstringrequerido

Body (JSON)

  • namestringrequerido
  • descriptionstring
  • durationMinnumberrequerido
  • bufferMinnumber

Respuestas

  • 201
curl -X POST 'https://api.mosend.dev/organizations/a1b2c3d4-1234-5678-9abc-def012345678/agenda/types' \
  -H 'X-Api-Key: mk_live_<prefix>.<secret>' \
  -H 'Content-Type: application/json' \
  -d '{"name": "<name>","description": "<description>","durationMin": 0,"bufferMin": 0}'
Response · 200
{
  "data": {
    "id": "00000000-0000-0000-0000-000000000000",
    "name": "string",
    "description": "string"
  },
  "timestamp": "2026-05-01T03:42:18.123Z"
}
PATCH/organizations/:orgId/agenda/types/:id
bearer

Actualiza (o desactiva) un tipo de cita.

Path params

  • orgIdstringrequerido
  • idstringrequerido

Body (JSON)

  • namestring
  • descriptionstring
  • durationMinnumber
  • bufferMinnumber
  • activeboolean

Respuestas

  • 200
curl -X PATCH 'https://api.mosend.dev/organizations/a1b2c3d4-1234-5678-9abc-def012345678/agenda/types/00000000-0000-0000-0000-000000000000' \
  -H 'X-Api-Key: mk_live_<prefix>.<secret>' \
  -H 'Content-Type: application/json' \
  -d '{"name": "<name>","description": "<description>","durationMin": 0,"bufferMin": 0,"active": true}'
Response · 200
{
  "data": {
    "id": "00000000-0000-0000-0000-000000000000",
    "name": "string",
    "description": "string"
  },
  "timestamp": "2026-05-01T03:42:18.123Z"
}
GET/organizations/:orgId/agenda/staff
bearer

Profesionales de la org (para agenda por profesional) + si ya tienen disponibilidad.

Path params

  • orgIdstringrequerido

Respuestas

  • 200
curl -X GET 'https://api.mosend.dev/organizations/a1b2c3d4-1234-5678-9abc-def012345678/agenda/staff' \
  -H 'X-Api-Key: mk_live_<prefix>.<secret>'
Response · 200
{
  "data": [
    {
      "id": "00000000-0000-0000-0000-000000000000",
      "createdAt": "2026-05-01T03:42:18.123Z"
    }
  ],
  "timestamp": "2026-05-01T03:42:18.123Z"
}
GET/organizations/:orgId/agenda/availability
bearer

Reglas semanales de disponibilidad (weekday + minutos locales de la org). `staffUserId` para agenda por profesional.

Path params

  • orgIdstringrequerido

Query params

  • staffUserIdstringrequerido

Respuestas

  • 200
curl -X GET 'https://api.mosend.dev/organizations/a1b2c3d4-1234-5678-9abc-def012345678/agenda/availability' \
  -H 'X-Api-Key: mk_live_<prefix>.<secret>'
Response · 200
{
  "data": [
    {
      "id": "00000000-0000-0000-0000-000000000000",
      "createdAt": "2026-05-01T03:42:18.123Z"
    }
  ],
  "timestamp": "2026-05-01T03:42:18.123Z"
}
PUT/organizations/:orgId/agenda/availability
bearer

Reemplaza el set completo de reglas semanales.

Path params

  • orgIdstringrequerido

Query params

  • staffUserIdstringrequerido

Body (JSON)

  • rulesAvailabilityRuleDto[]requerido

    Reemplaza TODAS las reglas de la agenda general (staffUserId null).

Respuestas

  • 200
curl -X PUT 'https://api.mosend.dev/organizations/a1b2c3d4-1234-5678-9abc-def012345678/agenda/availability' \
  -H 'X-Api-Key: mk_live_<prefix>.<secret>' \
  -H 'Content-Type: application/json' \
  -d '{"rules": []}'
Response · 200
{
  "data": {
    "id": "00000000-0000-0000-0000-000000000000",
    "name": "string",
    "description": "string"
  },
  "timestamp": "2026-05-01T03:42:18.123Z"
}
GET/organizations/:orgId/agenda/exceptions
bearer

Días bloqueados (festivos, vacaciones).

Path params

  • orgIdstringrequerido

Query params

  • staffUserIdstringrequerido

Respuestas

  • 200
curl -X GET 'https://api.mosend.dev/organizations/a1b2c3d4-1234-5678-9abc-def012345678/agenda/exceptions' \
  -H 'X-Api-Key: mk_live_<prefix>.<secret>'
Response · 200
{
  "data": [
    {
      "id": "00000000-0000-0000-0000-000000000000",
      "createdAt": "2026-05-01T03:42:18.123Z"
    }
  ],
  "timestamp": "2026-05-01T03:42:18.123Z"
}
POST/organizations/:orgId/agenda/exceptions
bearer

Bloquea un día completo (YYYY-MM-DD local).

Path params

  • orgIdstringrequerido

Query params

  • staffUserIdstringrequerido

Body (JSON)

  • datestringrequerido

    Día local de la org, formato YYYY-MM-DD.

  • reasonstring

Respuestas

  • 201
curl -X POST 'https://api.mosend.dev/organizations/a1b2c3d4-1234-5678-9abc-def012345678/agenda/exceptions' \
  -H 'X-Api-Key: mk_live_<prefix>.<secret>' \
  -H 'Content-Type: application/json' \
  -d '{"date": "<date>","reason": "<reason>"}'
Response · 200
{
  "data": {
    "id": "00000000-0000-0000-0000-000000000000",
    "name": "string",
    "description": "string"
  },
  "timestamp": "2026-05-01T03:42:18.123Z"
}
DELETE/organizations/:orgId/agenda/exceptions/:id
bearer

Desbloquea un día.

Path params

  • orgIdstringrequerido
  • idstringrequerido

Respuestas

  • 204
curl -X DELETE 'https://api.mosend.dev/organizations/a1b2c3d4-1234-5678-9abc-def012345678/agenda/exceptions/00000000-0000-0000-0000-000000000000' \
  -H 'X-Api-Key: mk_live_<prefix>.<secret>'
Response · 200
{
  "data": {
    "id": "00000000-0000-0000-0000-000000000000",
    "createdAt": "2026-05-01T03:42:18.123Z"
  },
  "timestamp": "2026-05-01T03:42:18.123Z"
}
GET/organizations/:orgId/agenda/slots
bearer

Slots disponibles para un tipo de cita (TZ de la org; respeta antelación, excepciones y citas existentes).

Path params

  • orgIdstringrequerido

Query params

  • typeIdstringrequerido
  • fromstring

    Fecha/hora ISO desde la que buscar (default: ahora).

  • daysnumber

    Cuántos días explorar (default 7, tope maxAdvanceDays del settings).

  • staffUserIdstring

    Profesional cuya disponibilidad consultar. Vacío = agenda general.

Respuestas

  • 200
curl -X GET 'https://api.mosend.dev/organizations/a1b2c3d4-1234-5678-9abc-def012345678/agenda/slots' \
  -H 'X-Api-Key: mk_live_<prefix>.<secret>'
Response · 200
{
  "data": [
    {
      "id": "00000000-0000-0000-0000-000000000000",
      "createdAt": "2026-05-01T03:42:18.123Z"
    }
  ],
  "timestamp": "2026-05-01T03:42:18.123Z"
}
GET/organizations/:orgId/agenda/appointments
bearer

Lista citas con filtros (rango, estado, contacto).

Path params

  • orgIdstringrequerido

Query params

  • fromstring
  • tostring
  • statusstring
  • contactIdstring
  • staffUserIdstring

    Filtra por profesional. `general` = agenda general (staffUserId null).

Respuestas

  • 200
curl -X GET 'https://api.mosend.dev/organizations/a1b2c3d4-1234-5678-9abc-def012345678/agenda/appointments' \
  -H 'X-Api-Key: mk_live_<prefix>.<secret>'
Response · 200
{
  "data": [
    {
      "id": "00000000-0000-0000-0000-000000000000",
      "createdAt": "2026-05-01T03:42:18.123Z"
    }
  ],
  "timestamp": "2026-05-01T03:42:18.123Z"
}
POST/organizations/:orgId/agenda/appointments
bearer

Reserva un slot exacto (de GET slots) para un contacto. 409 si el horario ya no está disponible.

Path params

  • orgIdstringrequerido

Body (JSON)

  • typeIdstring · uuidrequerido
  • contactIdstring · uuidrequerido
  • startAtstringrequerido

    Inicio exacto de un slot devuelto por GET slots (ISO).

  • conversationIdstring · uuid
  • phoneNumberIdstring · uuid
  • notesstring
  • staffUserIdstring · uuid

    Profesional con el que se reserva. Vacío = agenda general.

Respuestas

  • 201
curl -X POST 'https://api.mosend.dev/organizations/a1b2c3d4-1234-5678-9abc-def012345678/agenda/appointments' \
  -H 'X-Api-Key: mk_live_<prefix>.<secret>' \
  -H 'Content-Type: application/json' \
  -d '{"typeId": "00000000-0000-0000-0000-000000000000","contactId": "00000000-0000-0000-0000-000000000000","startAt": "<startAt>","conversationId": "00000000-0000-0000-0000-000000000000","phoneNumberId": "00000000-0000-0000-0000-000000000000","notes": "<notes>","staffUserId": "00000000-0000-0000-0000-000000000000"}'
Response · 200
{
  "data": {
    "id": "00000000-0000-0000-0000-000000000000",
    "name": "string",
    "description": "string"
  },
  "timestamp": "2026-05-01T03:42:18.123Z"
}
PATCH/organizations/:orgId/agenda/appointments/:id/cancel
bearer

Cancela una cita confirmada.

Path params

  • orgIdstringrequerido
  • idstringrequerido

Body (JSON)

  • reasonstring

Respuestas

  • 200
curl -X PATCH 'https://api.mosend.dev/organizations/a1b2c3d4-1234-5678-9abc-def012345678/agenda/appointments/00000000-0000-0000-0000-000000000000/cancel' \
  -H 'X-Api-Key: mk_live_<prefix>.<secret>' \
  -H 'Content-Type: application/json' \
  -d '{"reason": "<reason>"}'
Response · 200
{
  "data": {
    "id": "00000000-0000-0000-0000-000000000000",
    "name": "string",
    "description": "string"
  },
  "timestamp": "2026-05-01T03:42:18.123Z"
}
PATCH/organizations/:orgId/agenda/appointments/:id/reschedule
bearer

Reprograma una cita confirmada a un nuevo horario disponible.

Path params

  • orgIdstringrequerido
  • idstringrequerido

Body (JSON)

  • startAtstringrequerido

    Nuevo inicio (ISO); debe ser un slot disponible del mismo tipo de cita.

Respuestas

  • 200
curl -X PATCH 'https://api.mosend.dev/organizations/a1b2c3d4-1234-5678-9abc-def012345678/agenda/appointments/00000000-0000-0000-0000-000000000000/reschedule' \
  -H 'X-Api-Key: mk_live_<prefix>.<secret>' \
  -H 'Content-Type: application/json' \
  -d '{"startAt": "<startAt>"}'
Response · 200
{
  "data": {
    "id": "00000000-0000-0000-0000-000000000000",
    "name": "string",
    "description": "string"
  },
  "timestamp": "2026-05-01T03:42:18.123Z"
}
PATCH/organizations/:orgId/agenda/appointments/:id/status
bearer

Marca una cita como COMPLETED o NO_SHOW.

Path params

  • orgIdstringrequerido
  • idstringrequerido

Body (JSON)

  • statusstringrequerido
    NO_SHOWCOMPLETED

Respuestas

  • 200
curl -X PATCH 'https://api.mosend.dev/organizations/a1b2c3d4-1234-5678-9abc-def012345678/agenda/appointments/00000000-0000-0000-0000-000000000000/status' \
  -H 'X-Api-Key: mk_live_<prefix>.<secret>' \
  -H 'Content-Type: application/json' \
  -d '{"status": "NO_SHOW"}'
Response · 200
{
  "data": {
    "id": "00000000-0000-0000-0000-000000000000",
    "name": "string",
    "description": "string"
  },
  "timestamp": "2026-05-01T03:42:18.123Z"
}