openapi: 3.0.0
info:
  title: Logon Script Config
  description: 'This API provides endpoints to manage logon script configurations for quick enrollment in ID360.'
  version: 1.1.1
servers:
  - url: 'https://id360.manageengine.com/api/v1'
    description: 'API Endpoint'
tags:
  - name: qe-logon-script
    description: 'Logon Script Config API for Quick Enrollment'
paths:
  /protection/quick-enrollment/logon-script-config:
    get:
      tags:
        - qe-logon-script
      summary: Get Logon Script Config
      description: 'The Get Logon Script Config API can be used to get the default logon script configuration for quick enrollment.'
      parameters:
        - $ref: '#/components/parameters/acceptHeader'
      responses:
        '200':
          description: 'OK'
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/logonScriptConfigResource'
        '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
    put:
      tags:
        - qe-logon-script
      summary: Replace Logon Script Config
      description: >
        The Replace Logon Script Config API can be used to replace the default logon script configuration for quick enrollment.
        <br>
        <strong>Note:</strong> This API replaces the entire logon script configuration. If you want to partially update the configuration, use the Partial Update Logon Script Config API.
      parameters:
        - $ref: '#/components/parameters/acceptHeader'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/logonScriptConfigResource'
      responses:
        '200':
          description: 'OK'
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/logonScriptConfigResource'
        '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
    patch:
      tags:
        - qe-logon-script
      summary: Partial Update Logon Script Config
      description: The Partial Update Logon Script Config API can be used to partially update the default logon script configuration for quick enrollment.
      parameters:
        - $ref: '#/components/parameters/acceptHeader'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/logonScriptConfigResource'
      responses:
        '200':
          description: 'OK'
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/logonScriptConfigResource'
        '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/logon-script-config/download:
    get:
      tags:
        - qe-logon-script
      summary: Download Logon Script Config
      description: The Download Logon Script Config API can be used to download the default logon script configuration for quick enrollment.
      parameters:
        - $ref: '#/components/parameters/acceptHeader'
      responses:
        '200':
          description: 'OK'
          content:
            application/json:
              schema:
                type: string
                format: binary
                description: 'The logon script configuration file in JSON format.'
                example: 'logon_script_config.json'
        '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/logon-script-auto-schedule:
    get:
      tags:
        - qe-logon-script
      summary: Get Logon Script Auto Schedule
      description: 'The Get Logon Script Auto Schedule API can be used to get the default logon script auto schedule configuration for quick enrollment.'
      parameters:
        - $ref: '#/components/parameters/acceptHeader'
      responses:
        '200':
          description: 'OK'
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/logonScriptAutoScheduleResource'
        '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
    put:
      tags:
        - qe-logon-script
      summary: Replace Logon Script Auto Schedule
      description: >
        The Replace Logon Script Auto Schedule API can be used to replace the default logon script auto schedule configuration for quick enrollment.
        <br>
        <strong>Note:</strong> This API replaces the entire logon script auto schedule configuration. If you want to partially update the configuration, use the Partial Update Logon Script Auto Schedule API.
      parameters:
        - $ref: '#/components/parameters/acceptHeader'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/logonScriptAutoScheduleResource'
      responses:
        '200':
          description: 'OK'
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/logonScriptAutoScheduleResource'
        '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
    patch:
      tags:
        - qe-logon-script
      summary: Partial Update Logon Script Auto Schedule
      description: The Partial Update Logon Script Auto Schedule API can be used to partially update the default logon script auto schedule configuration for quick enrollment.
      parameters:
        - $ref: '#/components/parameters/acceptHeader'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/logonScriptAutoScheduleResource'
      responses:
        '200':
          description: 'OK'
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/logonScriptAutoScheduleResource'
        '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/logon-script-auto-schedule/history:
    get:
      tags:
        - qe-logon-script
      summary: Get Logon Script Auto Schedule History
      description: 'The Get Logon Script Auto Schedule History API can be used to get all the history of logon script auto schedule runs for quick enrollment.'
      parameters:
        - $ref: '#/components/parameters/acceptHeader'
        - $ref: '#/components/parameters/from'
        - $ref: '#/components/parameters/limit'
      responses:
        '200':
          description: 'OK'
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/logonScriptAutoScheduleHistories'
                  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/logon-script-auto-schedule/script-copy-status:
    get:
      tags:
        - qe-logon-script
      summary: Get Logon Script Auto Schedule Script Copy Status
      description: 'The Get Logon Script Auto Schedule Script Copy Status API can be used to get the last script copy status on SYSVOL folder for quick enrollment.'
      parameters:
        - $ref: '#/components/parameters/acceptHeader'
      responses:
        '200':
          description: 'OK'
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/logonScriptAutoScheduleScriptCopyStatuses'
                  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

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'
    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/logonScriptConfigResource'
    #Resource representation of logon script configuration
    logonScriptConfigResource:
      type: object
      properties:
        window_title:
          type: string
          example: 'Identity360 Enrollment reminder'
          description: 'Title of the logon script window'
        window_content:
          type: string
          example: 'You are yet enroll for MFA. Please enroll now to access protected resources and reset passwords on your own.'
          description: 'Content of the logon script window'
        enrollment_button:
          type: string
          example: 'Enroll now'
          description: 'Text for the enrollment button in the logon script window'
        force_enrollment:
          type: string
          example: 'true'
          description: 'Indicates if enrollment is mandatory'
        cancellation_button:
          type: string
          example: 'Remind me later'
          description: 'Text for the cancellation button in the logon script window'

    #Resource representation of logon script auto schedule
    logonScriptAutoScheduleResource:
      type: object
      properties:
        is_enabled:
          type: boolean
          example: true
          description: 'Indicates if the logon script auto schedule is enabled'
        domains:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                example: '200090909090'
                description: 'ID of the domain to which the logon script will be applied'
              ous:
                type: object
                properties:
                  selected:
                    type: array
                    items:
                      type: integer
                      example: 20000909435000
                    description: 'List of selected OU IDs within the domain'
                    example:
                      - 20000909435000
                      - 20000909435030
                      - 20000909435004
                  unselected:
                    type: array
                    items:
                      type: array
                      items:
                        type: integer
                        example: 20000909435900
                    description: 'List of unselected OU IDs within the domain'
                    example:
                      - 20000909435900
                      - 20000082399090
                  exclude_child_ou:
                    type: boolean
                    example: false
                    description: 'Indicates if child OUs should be excluded from the schedule'
        #          example:
        #            - id: '200090909090'
        #              ous:
        #                selected:
        #                  - 20000909435000
        #                  - 20000909435030
        #                  - 20000909435004
        #                unselected:
        #                  - 20000909435900
        #                  - 20000082399090
        #                exclude_child_ou: false
        schedule_settings:
          type: object
          properties:
            scheduler_interval_type:
              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 logon script will run'
            minutes:
              type: string
              example: '0'
              description: 'The minute at which the logon script will run'
            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)'

    #Resource representation of logon script auto schedule history and list of histories
    logonScriptAutoScheduleHistory:
      type: object
      properties:
        id:
          type: string
          example: '2000000293042'
          description: 'ID of the logon script auto schedule history'
          readOnly: true
        start_time:
          type: string
          format: date-time
          example: '2023-10-27T03:30:12Z'
          description: 'Start time of the logon script auto schedule execution'
        end_time:
          type: string
          format: date-time
          example: '2023-10-27T03:35:12Z'
          description: 'End time of the logon script auto schedule execution'
        total_attempted_count:
          type: integer
          example: 100
          description: 'Total number of attempts made during the logon script auto schedule execution'
        success_count:
          type: integer
          example: 100
          description: 'Number of successful executions during the logon script auto schedule execution'

    logonScriptAutoScheduleHistories:
      type: array
      items:
        $ref: '#/components/schemas/logonScriptAutoScheduleHistory'
      example:
        - id: '2000000293042'
          start_time: '2023-10-27T03:30:12Z'
          end_time: '2023-10-27T03:35:12Z'
          total_attempted_count: 100
          success_count: 100
        - id: '2000000293043'
          start_time: '2023-10-27T04:00:00Z'
          end_time: '2023-10-27T04:05:00Z'
          total_attempted_count: 150
          success_count: 150
        - id: '2000000293044'
          start_time: '2023-10-27T04:30:00Z'
          end_time: '2023-10-27T04:35:00Z'
          total_attempted_count: 150
          success_count: 150

    #Resource representation of logon script auto schedule script copy status
    logonScriptAutoScheduleScriptCopyStatus:
      type: object
      properties:
        domain_name:
          type: string
          example: 'zohocorp.com'
          description: 'Name of the domain for which the logon script was copied'
        script_availability:
          type: string
          example: 'Yes'
          description: 'Indicates if the logon script is available in the SYSVOL folder'
        last_updated_time:
          type: string
          format: date-time
          example: '2023-10-27T03:30:12Z'
          description: 'Last updated time of the logon script copy status'
        last_updated_status_type:
          type: string
          example: 'success'
          description: 'Type of the last update status (e.g., success, failure)'
        last_updated_status_message:
          type: string
          example: 'Success'
          description: 'Message providing additional information about the last update status'

    logonScriptAutoScheduleScriptCopyStatuses:
      type: array
      items:
        $ref: '#/components/schemas/logonScriptAutoScheduleScriptCopyStatus'
      example:
        - domain_name: 'zohocorp.com'
          script_availability: 'Yes'
          last_updated_time: '2023-10-27T03:30:12Z'
          last_updated_status_type: 'success'
          last_updated_status_message: 'Success'
        - domain_name: 'example.com'
          script_availability: 'No'
          last_updated_time: '2023-10-27T04:00:00Z'
          last_updated_status_type: 'failure'
          last_updated_status_message: 'Permission denied'

    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'