openapi: 3.0.0
info:
  title: Notification
  description: 'This is the documentation for the Quick Enrollment Notification API in ID360.'
  version: 1.1.1
servers:
  - url: 'https://id360.manageengine.com/api/v1'
    description: 'API Endpoint'
tags:
  - name: qe-notification
    description: 'Quick Enrollment Notification API'
paths:
  /protection/quick-enrollment/notification-auto-schedule:
    get:
      tags:
        - qe-notification
      summary: Get All Notification Auto Schedule
      description: 'The Get All Notification Auto Schedule API can be used to get the list of all notification auto schedule configurations for quick enrollment.'
      parameters:
        - $ref: '#/components/parameters/acceptHeader'
      responses:
        '200':
          description: 'OK'
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/notificationAutoSchedules'
                  meta:
                    $ref: '#/components/schemas/meta'
        '401':
          description: 'Unauthorized'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/unauthorized'
        '500':
          description: 'Internal Server Error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/serverError'
      security:
        - Zoho_Auth:
            - id360.quick_enrollment.ALL
            - id360.quick_enrollment.READ
    post:
      tags:
        - qe-notification
      summary: Create Notification Auto Schedule
      description: 'The Create Notification Auto Schedule API can be used to create a new notification auto schedule configuration for quick enrollment.'
      parameters:
        - $ref: '#/components/parameters/acceptHeader'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/notificationAutoScheduleResource'
      responses:
        '201':
          description: 'Created'
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/notificationAutoScheduleResource'
        '401':
          description: 'Unauthorized'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/unauthorized'
        '500':
          description: 'Internal Server Error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/serverError'
      security:
        - Zoho_Auth:
            - id360.quick_enrollment.ALL
            - id360.quick_enrollment.WRITE
            - id360.quick_enrollment.CREATE

  /protection/quick-enrollment/notification-auto-schedule/{id}:
    get:
      tags:
        - qe-notification
      summary: Get Notification Auto Schedule
      description: 'The Get Notification Auto Schedule API can be used to get a specific notification auto schedule configuration for quick enrollment.'
      parameters:
        - $ref: '#/components/parameters/acceptHeader'
        - $ref: '#/components/parameters/notificationAutoScheduleId'
      responses:
        '200':
          description: 'OK'
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/notificationAutoScheduleResource'
        '401':
          description: 'Unauthorized'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/unauthorized'
        '500':
          description: 'Internal Server Error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/serverError'
      security:
        - Zoho_Auth:
            - id360.quick_enrollment.ALL
            - id360.quick_enrollment.READ
    patch:
      tags:
        - qe-notification
      summary: Update Notification Auto Schedule
      description: 'The Update Notification Auto Schedule API can be used to update a specific notification auto schedule configuration for quick enrollment.'
      parameters:
        - $ref: '#/components/parameters/acceptHeader'
        - $ref: '#/components/parameters/notificationAutoScheduleId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/notificationAutoScheduleResource'
      responses:
        '200':
          description: 'OK'
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/notificationAutoScheduleResource'
        '401':
          description: 'Unauthorized'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/unauthorized'
        '500':
          description: 'Internal Server Error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/serverError'
      security:
        - Zoho_Auth:
            - id360.quick_enrollment.ALL
            - id360.quick_enrollment.WRITE
            - id360.quick_enrollment.UPDATE
    delete:
      tags:
        - qe-notification
      summary: Delete Notification Auto Schedule
      description: 'The Delete Notification Auto Schedule API can be used to delete a specific notification auto schedule configuration for quick enrollment.'
      parameters:
        - $ref: '#/components/parameters/acceptHeader'
        - $ref: '#/components/parameters/notificationAutoScheduleId'
      responses:
        '204':
          description: 'No Content'
        '401':
          description: 'Unauthorized'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/unauthorized'
        '500':
          description: 'Internal Server Error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/serverError'
      security:
        - Zoho_Auth:
            - id360.quick_enrollment.ALL
            - id360.quick_enrollment.WRITE
            - id360.quick_enrollment.DELETE

  /protection/quick-enrollment/notification-auto-schedule/{id}/history:
    get:
      tags:
        - qe-notification
      summary: Get Notification Auto Schedule History
      description: 'The Get Notification Auto Schedule History API can be used to get all the history of notification auto schedule runs for quick enrollment.'
      parameters:
        - $ref: '#/components/parameters/acceptHeader'
        - $ref: '#/components/parameters/notificationAutoScheduleId'
        - $ref: '#/components/parameters/from'
        - $ref: '#/components/parameters/limit'
      responses:
        '200':
          description: 'OK'
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/notificationAutoScheduleHistories'
                  meta:
                    $ref: '#/components/schemas/meta'
        '401':
          description: 'Unauthorized'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/unauthorized'
        '500':
          description: 'Internal Server Error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/serverError'
      security:
        - Zoho_Auth:
            - id360.quick_enrollment.ALL
            - id360.quick_enrollment.READ

  /protection/quick-enrollment/notification-auto-schedule/{id}/enable:
    post:
      tags:
        - qe-notification
      summary: Enable Notification Auto Schedule
      description: 'The Enable Notification Auto Schedule API can be used to enable a specific notification auto schedule configuration for quick enrollment.'
      parameters:
        - $ref: '#/components/parameters/acceptHeader'
        - $ref: '#/components/parameters/notificationAutoScheduleId'
      responses:
        '204':
          description: No Content
        '401':
          description: 'Unauthorized'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/unauthorized'
        '500':
          description: 'Internal Server Error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/serverError'
      security:
        - Zoho_Auth:
            - id360.quick_enrollment.ALL
            - id360.quick_enrollment.WRITE
            - id360.quick_enrollment.UPDATE

  /protection/quick-enrollment/notification-auto-schedule/{id}/disable:
    post:
      tags:
        - qe-notification
      summary: Disable Notification Auto Schedule
      description: 'The Disable Notification Auto Schedule API can be used to disbale a specific notification auto schedule configuration for quick enrollment.'
      parameters:
        - $ref: '#/components/parameters/acceptHeader'
        - $ref: '#/components/parameters/notificationAutoScheduleId'
      responses:
        '204':
          description: No Content
        '401':
          description: 'Unauthorized'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/unauthorized'
        '500':
          description: 'Internal Server Error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/serverError'
      security:
        - Zoho_Auth:
            - id360.quick_enrollment.ALL
            - id360.quick_enrollment.WRITE
            - id360.quick_enrollment.UPDATE

  /protection/quick-enrollment/notification-auto-schedule/{id}/runnow:
    post:
      tags:
        - qe-notification
      summary: Run Notification Auto Schedule Now
      description: >
        The Run Notification Auto Schedule Now API can be used to trigger a specific notification auto schedule configuration immediately for quick enrollment.
        <br>
        Note: This API will return job resource
      parameters:
        - $ref: '#/components/parameters/acceptHeader'
        - $ref: '#/components/parameters/notificationAutoScheduleId'
      responses:
        '202':
          description: Accepted
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/notificationScheduleStatus'
                  links:
                    $ref: '#/components/schemas/links'
        '401':
          description: 'Unauthorized'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/unauthorized'
        '500':
          description: 'Internal Server Error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/serverError'
      security:
        - Zoho_Auth:
            - id360.quick_enrollment.ALL
            - id360.quick_enrollment.WRITE
            - id360.quick_enrollment.UPDATE

  /protection/quick-enrollment/notification-auto-schedule/{id}/groups:
    get:
      tags:
        - qe-notification
      summary: Get Notification Auto Schedule Groups
      description: 'The Get Notification Auto Schedule Groups API can be used to get the list of groups associated with a specific notification auto schedule.'
      parameters:
        - $ref: '#/components/parameters/acceptHeader'
        - $ref: '#/components/parameters/notificationAutoScheduleId'
      responses:
        '200':
          description: 'OK'
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    description: 'List of group IDs associated with the notification auto schedule'
                    items:
                      type: integer
                      example: 2000000283042
                    example:
                      - 2000000283042
                      - 2000000283043
                      - 2000000283044
        '401':
          description: 'Unauthorized'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/unauthorized'
        '500':
          description: 'Internal Server Error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/serverError'
      security:
        - Zoho_Auth:
            - id360.quick_enrollment.ALL
            - id360.quick_enrollment.READ

  /protection/quick-enrollment/manual-notification:
    post:
      tags:
        - qe-notification
      summary: Send Manual Notification
      description: >
        The Send Manual Notification API can be used to send a manual notification to users for quick enrollment.
        <br>
        Note: This API will return job resource
      parameters:
        - $ref: '#/components/parameters/acceptHeader'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/manualNotificationResource'
      responses:
        '202':
          description: 'Accepted'
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/notificationScheduleStatus'
                  links:
                    $ref: '#/components/schemas/links'
        '401':
          description: 'Unauthorized'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/unauthorized'
        '500':
          description: 'Internal Server Error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/serverError'
      security:
        - Zoho_Auth:
            - id360.quick_enrollment.ALL
            - id360.quick_enrollment.WRITE
components:
  parameters:
    authorization:
      name: Authorization
      in: header
      schema:
        type: string
      description: 'Authorization OAuth token for the API'
      required: true
      example: 'Zoho-oauthtoken 1000.41d**************125f'
    acceptHeader:
      name: Accept
      in: header
      schema:
        type: string
      description: 'Accept header for the API'
      required: false
      example: 'application/json'
    notificationAutoScheduleId:
      name: id
      in: path
      required: true
      description: 'The ID of the notification auto schedule to be fetched or modified'
      example: '2000000293042'
      schema:
        type: string
    limit:
      name: limit
      in: query
      required: false
      description: The maximum number of records to return in the response.
      example: '100'
      schema:
        type: integer
    from:
      name: from
      in: query
      required: false
      description: The starting index of the records to return in the response.
      example: '1'
      schema:
        type: integer
  schemas:
    gendoc-attributes-schema:
      $ref: '#/components/schemas/notificationAutoScheduleResource'
    #Resource representation of notification auto schedule

    notificationAutoScheduleResource:
      type: object
      properties:
        id:
          type: string
          example: '2000000293042'
          description: 'ID of the notification auto schedule'
          readOnly: true
        name:
          type: string
          example: 'Notification schedule'
          description: 'Name of the notification auto schedule'
        description:
          type: string
          example: 'Notification scheduler description'
          description: 'Description of the notification auto schedule'
        groups:
          type: array
          items:
            type: integer
            example: 2000000283042
          description: 'List of group IDs to which the notification will be sent'
          example:
            - 2000000283042
            - 2000000283043
            - 2000000283044
          writeOnly: true
        notification_template_id:
          type: string
          example: '2000000293042'
          description: 'ID of the notification template to be used for the schedule'
          writeOnly: true
        notification_template:
          type: object
          description: 'Notification template to be used for the schedule'
          readOnly: true
          properties:
            id:
              type: string
              example: '2000000293042'
              description: 'ID of the notification template'
            name:
              type: string
              example: 'Enrollment Notification Template'
              description: 'Name of the notification template'
        is_enabled:
          type: boolean
          example: true
          description: 'Indicates if the notification auto schedule is enabled'
          readOnly: true
        technician:
          type: object
          description: 'Technician assigned to manage the notification auto schedule'
          properties:
            id:
              type: string
              example: '2000000293042'
              description: 'ID of the technician'
            name:
              type: string
              example: 'Technician 1'
              description: 'Name of the technician'
          readOnly: true
        last_run_time:
          type: string
          format: date-time
          example: '2023-10-27T03:30:12Z'
          description: 'Last run time of the notification auto schedule'
          readOnly: true
        next_run_time:
          type: string
          format: date-time
          example: '2023-10-28T03:30:12Z'
          description: 'Next run time of the notification auto schedule'
          readOnly: true
        associated_groups_count:
          type: string
          example: '30'
          description: 'Number of groups associated with the notification auto schedule'
          readOnly: true
        schedule_settings:
          type: object
          properties:
            scheduler_interval:
              type: string
              example: 'WEEKLY'
              enum:
                - DAILY
                - WEEKLY
                - MONTHLY
              description: The interval type for the schedule.
            hours:
              type: string
              example: '21'
              description: 'The hour at which the notification will be sent'
            minutes:
              type: string
              example: '0'
              description: 'The minute at which the notification will be sent'
            day_of_week:
              type: string
              example: '5'
              description: 'The day of the week for the schedule (1-7, where 1 is Sunday)'
            day_of_month:
              type: string
              example: '10'
              description: 'The day of the month for the schedule (1-31)'
            month_of_year:
              type: string
              example: '12'
              description: 'The month of the year for the schedule (1-12)'

    notificationAutoSchedules:
      type: array
      items:
        $ref: '#/components/schemas/notificationAutoScheduleResource'
      example:
        - id: '2000000293042'
          name: 'Notification schedule'
          description: 'Notification scheduler description'
          notification_template:
            id: '2000000293042'
            name: 'Enrollment Notification Template'
          is_enabled: true
          technician: 'Technician 1'
          last_run_time: '2023-10-27T03:30:12Z'
          next_run_time: '2023-10-28T03:30:12Z'
          associated_groups_count: '30'
          schedule_settings:
            scheduler_interval: 'WEEKLY'
            hours: '21'
            minutes: '0'
            day_of_week: '5'
            day_of_month: '10'
            month_of_year: '12'
        - id: '2000000293043'
          name: 'Notification schedule 2'
          description: 'Notification scheduler description 2'
          notification_template:
            id: '2000000293043'
            name: 'Enrollment Notification Template 2'
          is_enabled: false
          technician: 'Technician 2'
          last_run_time: '2023-10-27T04:00:00Z'
          next_run_time: '2023-10-28T04:00:00Z'
          associated_groups_count: '20'
          schedule_settings:
            scheduler_interval: 'DAILY'
            hours: '10'
            minutes: '30'
            day_of_week: '1'
            day_of_month: '15'
            month_of_year: '6'
        - id: '2000000293044'
          name: 'Notification schedule 3'
          description: 'Notification scheduler description 3'
          notification_template:
            id: '2000000293044'
            name: 'Enrollment Notification Template 3'
          is_enabled: true
          technician: 'Technician 3'
          last_run_time: '2023-10-27T04:30:00Z'
          next_run_time: '2023-10-28T04:30:00Z'
          associated_groups_count: '25'
          schedule_settings:
            scheduler_interval: 'MONTHLY'
            hours: '15'
            minutes: '45'
            day_of_week: '2'
            day_of_month: '20'
            month_of_year: '11'
    #Resource representation of Notification Schedule auto/manual Status
    notificationScheduleStatus:
      allOf:
        - $ref: '#/components/schemas/acceptJobResponse'
        - type: object
          properties:
            message:
              type: string
              example: 'Enrollment notification scheduler is started. Check Notification delivery reports once execution is completed.'
              description: 'A message providing additional information about the execution status'

    #Resource representation of Notification Schedule auto Histories
    notificationAutoScheduleHistory:
      type: array
      items:
        type: object
        properties:
          id:
            type: string
            example: '2000000293042'
            description: 'ID of the notification auto schedule history'
          start_time:
            type: string
            format: date-time
            example: '2023-10-27T03:30:12Z'
            description: 'Start time of the notification auto schedule execution'
          end_time:
            type: string
            format: date-time
            example: '2023-10-27T03:35:12Z'
            description: 'End time of the notification auto schedule execution'
          notification_type:
            type: string
            example: 'Mail, SMS'
            description: 'Type of notifications sent during the execution'
          total_attempted_count:
            type: integer
            example: 100
            description: 'Total number of attempts made during the notification auto schedule execution'
          success_count:
            type: integer
            example: 100
            description: 'Number of successful executions during the notification auto schedule execution'
          initiated_by:
            type: string
            example: 'System'
            description: 'User or system that initiated the notification auto schedule execution'

    notificationAutoScheduleHistories:
      type: array
      items:
        $ref: '#/components/schemas/notificationAutoScheduleHistory'
      example:
        - id: '2000000293042'
          start_time: '2023-10-27T03:30:12Z'
          end_time: '2023-10-27T03:35:12Z'
          notification_type: 'Mail, SMS'
          total_attempted_count: 100
          success_count: 100
          initiated_by: 'System'
        - id: '2000000293043'
          start_time: '2023-10-27T04:00:00Z'
          end_time: '2023-10-27T04:05:00Z'
          notification_type: 'Mail, SMS'
          total_attempted_count: 100
          success_count: 25
          initiated_by: 'Technician 1'
        - id: '2000000293044'
          start_time: '2023-10-27T04:30:00Z'
          end_time: '2023-10-27T04:35:00Z'
          notification_type: 'Mail, SMS'
          total_attempted_count: 100
          success_count: 15
          initiated_by: 'Technician 2'

    #Resource representation of manual notification
    manualNotificationResource:
      type: object
      properties:
        groups:
          type: array
          description: List of group IDs to which the manual notification will be sent.
          items:
            type: integer
          example:
            - 2000000283042
            - 2000000283043
            - 2000000283044
        users:
          type: array
          description: List of user IDs to which the manual notification will be sent.
          items:
            type: integer
          example:
            - 2000000283042
            - 2000000283043
            - 2000000283044
        notification_template:
          type: string
          example: '2000000293042'
          description: 'ID of the notification template to be used for the schedule'
        mail:
          type: object
          description: Contains mail attributes
          properties:
            to:
              type: array
              description: Contains mail id values for TO recipient
              example:
                - "a@A.com"
                - "V@A.com"
              items:
                type: string
                pattern: ^[A-Za-z0-9]+$
            cc:
              type: array
              description: Contains mail id values for CC recipient
              example:
                - "b@A.com"
                - "b@A.com"
              items:
                type: string
                pattern: ^[A-Za-z0-9]+$
            subject:
              type: string
              description: Subject of the mail
              example: "Report available"
              pattern: ^[A-Za-z0-9]+$
            content:
              type: string
              description: Body of the mail
              example: Mail content goes here
              pattern: ^[A-Za-z0-9]+$
            #            text_editor:
            #              type: string
            #              description: To store editor type value. It defines what editor the mail templates opens with
            #              example: rtEditor
            #              pattern: (rtEditor | plainEditor)
            severity:
              type: string
              description: To store the severity of the mail.
              example: low
              enum:
                - LOW
                - MEDIUM
                - HIGH
              pattern: (LOW | MEDIUM | HIGH)
            attachment_ids:
              type: array
              description: List of attachment ids used in the mail template
              items:
                type: string
                pattern: ^[0-9]+$
              example:
                - "200000000000001"
              writeOnly: true
            attachments:
              type: array
              description: The data of the mail attachment added in the RT Editor
              readOnly: true
              items:
                type: object
                properties:
                  id:
                    type: string
                    description: Unique ID for the attachment
                    example: "200000000000001"
                    pattern: ^[0-9]+$
                    readOnly: true
                  name:
                    type: string
                    description: Name of the file on the client side
                    example: Active_User_Sessions.csv
                    readOnly: true
                  file:
                    type: string
                    format: binary
                    description: The file to upload as an attachment.
                    example: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA..."
                    writeOnly: true
            inline_images:
              type: array
              description: List of inline images ids used in the mail template
              items:
                type: string
              example:
                - "200000000000001"
        sms:
          type: object
          properties:
            to:
              type: array
              example:
                - "+91-9807654321"
              description: Mobile numbers to send SMS
              items:
                type: string
                pattern: ^\+?[0-9-]+$
            content:
              type: string
              description: Content of the SMS
              example: Sample sms text
              pattern: ^[A-Za-z0-9]+$

    acceptJobResponse:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the job.
          example: '2000000293042'
          readOnly: true
        status:
          type: string
          description: Status of the CSV file upload.
          enum:
            - 'QUEUED'
            - 'RUNNING'
            - 'WARNING'
            - 'COMPLETED'
            - 'ERROR'
          example: RUNNING
          readOnly: true
        message:
          type: string
          description: Message providing additional information about the accept response.
          example: Process is initiated, check jobs for current status.
          readOnly: true

    links:
      type: object
      readOnly: true
      properties:
        status:
          type: object
          properties:
            href:
              type: string
              example: /jobs/2000000293042
              description: URL to get the status of the job

    meta:
      type: object
      properties:
        start_index:
          type: integer
          description: The starting index of the records in the response.
          example: 1
        limit:
          type: integer
          description: The maximum number of records returned in the response.
          example: 100
        total_no_of_objects:
          type: integer
          description: The total number of records available for the request.
          example: 3

    unauthorized:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: '00000101'
            title:
              type: string
              example: 'Unauthorized'
            detail:
              type: string
              example: 'The OAuth token is invalid.'
    serverError:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: '00000000'
            title:
              type: string
              example: 'Internal Server Error'
            detail:
              type: string
              example: 'An unexpected internal error has occurred on the server. Please try again later.'
  securitySchemes:
    Zoho_Auth:
      type: oauth2
      x-authorization-example: 'Zoho-oauthtoken 1000.41d9f2cfbd1b7a8f9e314b7aff7bc2d1.8fcc9810810a216793f385b9dd6e125f'
      flows:
        authorizationCode:
          authorizationUrl: 'https://accounts.zoho.com/oauth/v2/auth'
          tokenUrl: 'https://accounts.zoho.com/oauth/v2/token'
          scopes:
            id360.quick_enrollment.READ: 'Get quick enrollment details'
            id360.quick_enrollment.WRITE: 'Create/Update/Delete quick enrollment'
            id360.quick_enrollment.DELETE: 'Delete quick enrollment'
            id360.quick_enrollment.CREATE: 'Create quick enrollment'
            id360.quick_enrollment.UPDATE: 'Update quick enrollment'