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

# Create appointment

> 
When an appointment is created, a webhook event is sent to registered webhooks with details about the appointment, including the appointment ID, status, doctor ID, patient ID, and event type.

**Field Definitions**

• **event**: string - The type of resource for which event is generated. For appointments created, this will be `appointment.created`.

• **service**: string - The type of service. For appointments, this will be `appointment`.

• **data**: object - Contains detailed information about the appointment event.

• **appointment_id**: string - Unique identifier for the appointment.

• **doctor_id**: string - Unique identifier for the doctor.

• **patient_id**: string - Unique identifier for the patient.

• **status**: string - Status of the appointment. Possible values can be 

  - "BK" (Booked),

  - "OG" (Ongoing),

  - "CM" (Completed with Prescription),

  - "CMNP" (Completed without Prescription),

  - "CN" (Cancelled).


• **action**: string - Current action for the appointment. Possible values can be 

    - created

    - modified

    - completed

• **partner_meta**: key value pair specified by `partner` while creating appointment.  

• **timestamp**: string (ISO 8601) - The date and time when the event occurred.

• **custom_attibutes**: complete set of custom attributes(inclusing tags and labels) defined against this appointment. occurred.

**Example Webhook Request**

**Endpoint:** [https://your-registered-webhook-url.com](https://your-registered-webhook-url.com)

**Method:** POST



## OpenAPI

````yaml post /registered_url_for_add_appointment_events
openapi: 3.1.0
info:
  title: Transaction Status API
  version: 1.0.0
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
  - url: https://{partner_host}
    variables:
      partner_host:
        default: api.example.com
        description: Partner API host
security: []
paths:
  /registered_url_for_add_appointment_events:
    post:
      tags:
        - Appointment Webhooks
      summary: Create appointment
      description: >-

        When an appointment is created, a webhook event is sent to registered
        webhooks with details about the appointment, including the appointment
        ID, status, doctor ID, patient ID, and event type.


        **Field Definitions**


        • **event**: string - The type of resource for which event is generated.
        For appointments created, this will be `appointment.created`.


        • **service**: string - The type of service. For appointments, this will
        be `appointment`.


        • **data**: object - Contains detailed information about the appointment
        event.


        • **appointment_id**: string - Unique identifier for the appointment.


        • **doctor_id**: string - Unique identifier for the doctor.


        • **patient_id**: string - Unique identifier for the patient.


        • **status**: string - Status of the appointment. Possible values can
        be 

          - "BK" (Booked),

          - "OG" (Ongoing),

          - "CM" (Completed with Prescription),

          - "CMNP" (Completed without Prescription),

          - "CN" (Cancelled).


        • **action**: string - Current action for the appointment. Possible
        values can be 

            - created

            - modified

            - completed

        • **partner_meta**: key value pair specified by `partner` while creating
        appointment.  


        • **timestamp**: string (ISO 8601) - The date and time when the event
        occurred.


        • **custom_attibutes**: complete set of custom attributes(inclusing tags
        and labels) defined against this appointment. occurred.


        **Example Webhook Request**


        **Endpoint:**
        [https://your-registered-webhook-url.com](https://your-registered-webhook-url.com)


        **Method:** POST
      operationId: AddAppointmentWebhook
      parameters: []
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              type: object
              required:
                - event
                - event_time
                - timestamp
                - client_id
                - business_id
                - data
              properties:
                service:
                  type: string
                  example: appointment
                  description: Type of serivce
                event:
                  type: string
                  example: appointment.created
                  description: Type of event
                transaction_id:
                  type: string
                  example: 8y3458734657
                  description: Transaction ID for the appointment
                event_time:
                  type: integer
                  example: 1730189586
                  description: Event occured timestamp
                timestamp:
                  type: integer
                  example: 1730189586
                  description: Timestamp of the event
                client_id:
                  type: string
                  example: 67978400352a61001d64e9fb
                  description: Client ID for the appointment
                business_id:
                  type: string
                  example: '174159057718553'
                  description: Business ID for the appointment
                data:
                  type: object
                  required:
                    - appointment_id
                    - partner_appointment_id
                    - doctor_id
                    - patient_id
                    - clinic_id
                    - partner_doctor_id
                    - partner_patient_id
                    - partner_clinic_id
                    - status
                    - action
                    - created_at
                    - modified_at
                    - partner_meta
                    - sa_ids
                  properties:
                    appointment_id:
                      type: string
                      example: api-abb67007-1e53-4f0f-b428-a4bc025468a4
                      description: Unique appointment ID
                    partner_appointment_id:
                      type: string
                      example: 67ce9032abfba8001d17ddd2
                      description: Partner's appointment ID
                    doctor_id:
                      type: string
                      example: '174159057723920'
                      description: Identifier for the doctor in Eka
                    partner_doctor_id:
                      type: string
                      example: test-doc-123
                      description: Identifier for the partner’s doctor
                    patient_id:
                      type: string
                      example: '174678912588458'
                      description: Identifier for the patient in Eka
                    partner_patient_id:
                      type: string
                      example: '174678912588458'
                      description: Identifier for the partner’s patient
                    clinic_id:
                      type: string
                      example: 67978400352a61001d64e9fb
                      description: Identifier for the clinic in Eka
                    partner_clinic_id:
                      type: string
                      example: CL04
                      description: Identifier for the partner’s clinic
                    status:
                      type: string
                      example: BK
                      description: Status of the appointment
                    action:
                      type: string
                      example: created
                      description: Action performed
                    created_at:
                      type: integer
                      example: 1730189586
                      description: Creation timestamp
                    modified_at:
                      type: integer
                      example: 1730189586
                      description: Modification timestamp
                    custom_attributes:
                      type: object
                      properties:
                        label:
                          type: array
                          items:
                            type: string
                          example:
                            - vital_submitted
                      description: Custom attributes for the event
                    partner_meta:
                      type: object
                      properties:
                        key1:
                          type: string
                          example: value1
                      description: Partner-specific metadata
                    sa_ids:
                      type: array
                      items:
                        type: string
                      example:
                        - sa_25061014072610653
                      description: List of SA IDs
      responses:
        '200':
          description: ''
          headers: {}
      deprecated: false

````