> ## Documentation Index
> Fetch the complete documentation index at: https://omniloy.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Send appointment confirmation or reminder

> Sends a notification to the patient via WhatsApp using a Meta-approved template, referenced by `templateId`.

- Use it to send the **appointment confirmation** right after scheduling.
- Also use it to send the **reminder** before the appointment day.
- Templates and their variables are configured in the Omniloy panel.




## OpenAPI

````yaml /openapi/openapi-maria-en.yaml post /whatsapp/messages/template
openapi: 3.1.0
info:
  title: marIA API
  version: 1.0.0
  description: >
    marIA is Omniloy's voice agent that handles incoming patient calls at
    hospitals and clinics.

    - Voice / Telephony: the patient calls and marIA answers, manages
    appointments with the EHR/HIS, answers FAQs and escalates to a human when
    necessary.

    - WhatsApp Notifications: appointment confirmations and reminders via
    approved template.

    - Centers and services: consultation and management of centers, specialties
    and coverages configured in marIA.

    - FAQ Knowledge Base: documents that feed the agent's knowledge about
    centers and services.

    - Outbound calls and questionnaires: outbound scheduling and follow up
    questionnaires.

    - EHR/HIS integration via webhooks: marIA ⇄ Hospital for benefits, slots and
    appointments.

    - Webhook management: registration and configuration of endpoints to receive
    events from marIA.

    Top-level webhooks notify events (e.g. call status, appointments) signed
    with `webhookHmac`.
servers:
  - url: https://{your-prod-endpoint}
    description: Production
    variables:
      your-prod-endpoint:
        default: your-prod-endpoint
        description: Replace this value with the real host before trying the request.
  - url: https://{your-dev-endpoint}
    description: Staging
    variables:
      your-dev-endpoint:
        default: your-dev-endpoint
        description: Replace this value with the staging or development host.
security: []
tags:
  - name: Health
    description: Service status and availability.
  - name: Centers
    description: Medical centers with their services and coverages configured in marIA.
  - name: WhatsApp Notifications
    description: Sending appointment confirmations and reminders via WhatsApp template.
  - name: FAQ
    description: >-
      FAQ documents so the agent can answer questions about centers and
      services.
  - name: Webhooks - Appointments
    description: Appointment events integrated with the EHR/HIS.
  - name: Webhooks - Voice
    description: Telephony events (call status, escalation, answers and transcripts).
  - name: Voice Calls
    description: Inbound and outbound calls registered in MarIA Core.
  - name: Voice Answers
    description: Access and filtering of answers captured during calls.
  - name: Voice Transcripts
    description: Access to transcripts and recording links.
  - name: Content - Questionnaires
    description: Questionnaire definitions for outbound calls.
  - name: Questionnaire Instances
    description: Questionnaire instance status, review state, and results.
  - name: Scheduling - Time Ranges
    description: Reusable time ranges for scheduling calls.
  - name: Gestión de webhooks
    description: Webhook configuration and management; endpoints for integrators.
paths:
  /whatsapp/messages/template:
    post:
      tags:
        - WhatsApp Notifications
      summary: Send appointment confirmation or reminder
      description: >
        Sends a notification to the patient via WhatsApp using a Meta-approved
        template, referenced by `templateId`.


        - Use it to send the **appointment confirmation** right after
        scheduling.

        - Also use it to send the **reminder** before the appointment day.

        - Templates and their variables are configured in the Omniloy panel.
      operationId: send-whatsapp-template
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TemplateIdMessage'
            examples:
              confirmacion:
                summary: Confirmación de cita
                value:
                  phoneNumber: '+34600111222'
                  templateId: 2f3f8e64-2a1d-4b73-b7e4-9f0a7d6f8e10
                  params:
                    - Dr. García
                    - martes 15 de julio
                    - '11:00'
                    - Cardiología - Centro Norte
              recordatorio:
                summary: Recordatorio de cita
                value:
                  phoneNumber: '+34600111222'
                  templateId: 8a1c3d22-5f9e-4b12-a7c1-0e3f2a8b9d44
                  params:
                    - mañana martes 15 de julio
                    - '11:00'
      responses:
        '202':
          description: Notification accepted for sending
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDto'
      security:
        - apiKeyAuth: []
components:
  schemas:
    TemplateIdMessage:
      type: object
      description: WhatsApp template notification referenced by UUID.
      required:
        - phoneNumber
        - templateId
      properties:
        phoneNumber:
          type: string
          description: Recipient's E.164 number.
        templateId:
          type: string
          format: uuid
          description: UUID of the template approved by Meta.
        params:
          type: array
          description: Values (in order) for the template variables.
          items:
            type: string
        mediaUrl:
          type: string
          format: uri
          description: Optional media URL.
    NotificationResponse:
      type: object
      description: Response when sending a notification.
      properties:
        messageId:
          type: string
          description: Internal ID.
        status:
          type: string
          enum:
            - queued
            - sent
          description: Initial status.
    ErrorDto:
      type: object
      properties:
        status:
          type: string
          enum:
            - error
        code:
          type: integer
        error_code:
          type: string
        message:
          type: string
      required:
        - status
        - code
        - error_code
        - message
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key
      description: >-
        API Key provided by Omniloy. The same key is used for inbound and
        outbound calls.

````