openapi: 3.0.0
info:
  title: Summary
  description: This document provides a summary list of endpoints related to Conditional Access Policies in ID360.
  version: 1.0.0
servers:
  - url: 'https://id360.manageengine.com/api/v1'
    description: 'API Endpoint'
tags:
  - name: cap-summary
    description: Summary endpoints for Conditional Access Policies
paths:
  # Conditional Access Policy related summary endpoints
  /protection/conditional-access-policies/{id}/user-assignment-users:
    get:
      tags:
        - cap-summary
      summary: List Users Assigned to a Conditional Access Policy
      description: Retrieve a list of users assigned to a specific conditional access policy by ID.
      parameters:
        - $ref: '#/components/parameters/acceptHeader'
        - $ref: '#/components/parameters/policyId'
        - $ref: '#/components/parameters/from'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/filter'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/users'
                  meta:
                    $ref: '#/components/schemas/meta'
        '404':
          description: 'Not Found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/policyNotFound'
        '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.conditional_access_policy.read
            - id360.conditional_access_policy.all'

  /protection/conditional-access-policies/{id}/user-assignment-groups:
    get:
      tags:
        - cap-summary
      summary: List Groups Assigned to a Conditional Access Policy
      description: Retrieve a list of groups assigned to a specific conditional access policy by ID.
      parameters:
        - $ref: '#/components/parameters/acceptHeader'
        - $ref: '#/components/parameters/policyId'
        - $ref: '#/components/parameters/from'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/filter'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/groups'
                  meta:
                    $ref: '#/components/schemas/meta'
        '404':
          description: 'Not Found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/policyNotFound'
        '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.conditional_access_policy.read
            - id360.conditional_access_policy.all'

  /protection/conditional-access-policies/{id}/protected-devices:
    get:
      tags:
        - cap-summary
      summary: List Device Assignment Devices for a Conditional Access Policy
      description: Retrieve a list of devices assigned to a specific conditional access policy device assignment by ID.
      parameters:
        - $ref: '#/components/parameters/acceptHeader'
        - $ref: '#/components/parameters/policyId'
        - $ref: '#/components/parameters/from'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/filter'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/devices'
                  meta:
                    $ref: '#/components/schemas/meta'
        '404':
          description: 'Not Found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/policyNotFound'
        '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.conditional_access_policy.read
            - id360.conditional_access_policy.all'

  /protection/conditional-access-policies/{id}/protected-device-groups:
    get:
      tags:
        - cap-summary
      summary: List Device Assignment Groups for a Conditional Access Policy
      description: Retrieve a list of groups assigned to a specific conditional access policy device assignment by ID.
      parameters:
        - $ref: '#/components/parameters/acceptHeader'
        - $ref: '#/components/parameters/policyId'
        - $ref: '#/components/parameters/from'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/filter'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/groups'
                  meta:
                    $ref: '#/components/schemas/meta'
        '404':
          description: 'Not Found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/policyNotFound'
        '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.conditional_access_policy.read
            - id360.conditional_access_policy.all'

  /protection/conditional-access-policies/{id}/protected-apps:
    get:
      tags:
        - cap-summary
      summary: List Apps Assignment for a Conditional Access Policy
      description: Retrieve a list of applications assigned to a specific conditional access policy by ID.
      parameters:
        - $ref: '#/components/parameters/acceptHeader'
        - $ref: '#/components/parameters/policyId'
        - $ref: '#/components/parameters/from'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/filter'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/apps'
                  meta:
                    $ref: '#/components/schemas/meta'
        '404':
          description: 'Not Found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/policyNotFound'
        '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.conditional_access_policy.read
            - id360.conditional_access_policy.all'
components:
  parameters:
    acceptHeader:
      name: Accept
      in: header
      schema:
        type: string
      description: 'Accept header for the API'
      required: false
      example: 'application/json'
    fields:
      in: query
      name: fields
      schema:
        type: string
      description: >
        Comma-separated list of fields to include in the response.
        <br>
        <strong>eg:</strong> id,name,description,is_enabled,assignment,access_type,endpoint_settings,advanced_settings
      required: false
      example: id,name,description,is_enabled,assignment,access_type,endpoint_settings,advanced_settings
    from:
      in: query
      name: from
      schema:
        type: integer
        default: 1
      description: >
        Start index for pagination.
      required: false
      example:  1
    limit:
      in: query
      name: limit
      schema:
        type: integer
        maximum: 100
        minimum: 1
        default: 25
      description: >
        Maximum number of records to return in the response.
        <br>
        <strong>eg:</strong> 50
      required: false
      example: 50
    filter:
      in: query
      name: filter
      schema:
        type: string
      description: >
        Filter users based on a the provided SCIM filter query. Refer to filter section for more details
        <br>
        <strong>eg:</strong> name eq "Policy 01"
      required: false
      example: name eq "Policy 01"
    policyId:
      in: path
      name: id
      required: true
      description: The ID of the conditional access policy.
      example: 2000000000001
      schema:
        type: integer
  schemas:
    users:
      type: array
      items:
        $ref: '#/components/schemas/userResource'
      example:
        - id: '2000000092642'
          name: 'John Doe'
          email: 'john@mydomain.com'
          primary_source:
            id: '2000000072637'
            name: 'Berge-Corp'
            application_service:
              id: '2000000018007'
              display_name: 'Universal Directory'
              name: 'ZOHO_DIRECTORY'
              logo: 'universal-directory'
        - id: '2000000092643'
          name: 'Jane Smith'
          email: 'jane@mydomain.com'
          primary_source:
            id: '2000000072637'
            name: 'Berge-Corp'
            application_service:
              id: '2000000018007'
              display_name: 'Universal Directory'
              name: 'ZOHO_DIRECTORY'
              logo: 'universal-directory'
    userResource:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the user.
          example: '2000000092642'
        name:
          type: string
          description: Name of the user.
          example: 'John Doe'
        email:
          type: string
          description: Email address of the user.
          example: 'john@mydomain.com'
        primary_source:
          $ref: '#/components/schemas/primarySource'
    groups:
      type: array
      items:
        $ref: '#/components/schemas/groupResource'
      example:
        - id: '2000000092616'
          name: 'Admins'
          type: 'static'
          primary_source:
            id: '2000000072637'
            name: 'Berge-Corp'
            application_service:
              id: '2000000018007'
              display_name: 'Universal Directory'
              name: 'ZOHO_DIRECTORY'
              logo: 'universal-directory'
        - id: '2000000092617'
          name: 'Users'
          type: 'dynamic'
          primary_source:
            id: '2000000072637'
            name: 'Berge-Corp'
            application_service:
              id: '2000000018007'
              display_name: 'Universal Directory'
              name: 'ZOHO_DIRECTORY'
              logo: 'universal-directory'
    groupResource:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the group.
          example: '2000000092616'
        name:
          type: string
          description: Name of the group.
          example: 'Admins'
        type:
          type: string
          description: Type of the group.
          enum:
            - static
            - dynamic
          example: static
        primary_source:
          $ref: '#/components/schemas/primarySource'
    devices:
      type: array
      items:
        $ref: '#/components/schemas/deviceResource'
      example:
        - id: '2000000092642'
          name: 'Device 01'
          join_type: 'Id360 Joined'
          primary_source:
            id: '2000000072637'
            name: 'Berge-Corp'
            application_service:
              id: '2000000018007'
              display_name: 'Universal Directory'
              name: 'ZOHO_DIRECTORY'
              logo: 'universal-directory'
          agent_status: 'Active'
        - id: '2000000092643'
          name: 'Device 02'
          join_type: 'Entra Joined'
          primary_source:
            id: '2000000072637'
            name: 'Berge-Corp'
            application_service:
              id: '2000000018007'
              display_name: 'Universal Directory'
              name: 'ZOHO_DIRECTORY'
              logo: 'universal-directory'
          agent_status: 'Inactive'
    deviceResource:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the device.
          example: '2000000092642'
        name:
          type: string
          description: Name of the device.
          example: 'Device 01'
        join_type:
          type: string
          description: Type of device join.
          enum:
            - Id360 Joined
            - Entra Joined
          example: Id360 Joined
        primary_source:
          $ref: '#/components/schemas/primarySource'
        agent_status:
          type: string
          description: Status of the agent on the device.
          enum:
            - Active
            - Inactive
          example: Active
    apps:
      type: array
      items:
        $ref: '#/components/schemas/appResource'
      example:
        - id: '2000000092642'
          name: 'Universal Directory'
          application_service:
            id: '2000000018007'
            display_name: 'AD Directory'
            name: 'AD_DIRECTORY'
            logo: 'ad-directory'
        - id: '2000000092643'
          name: 'Salesforce'
          application_service:
            id: '2000000018007'
            display_name: 'Azure Directory'
            name: 'AZURE_DIRECTORY'
            logo: 'azure-directory'
    appResource:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the application.
          example: '2000000092642'
        name:
          type: string
          description: Name of the application.
          example: 'Universal Directory'
        service:
          type: string
          description: Service to which the application belongs.
          example: 'ZOHO_DIRECTORY'
        logo:
          type: string
          description: URL of the application logo.
          example: 'universal-directory'

    primarySource:
      type: object
      description: Primary source of the resource.
      properties:
        id:
          type: string
          description: Unique identifier of the primary source.
          example: '2000000002642'
        name:
          type: string
          description: Name of the primary source.
          example: 'admp.com'
        application_service:
          type: object
          description: Service to which the primary source belongs.
          properties:
            id:
              type: string
              description: Unique identifier of the service.
              example: '2000000002642'
            display_name:
              type: string
              description: Display name of the service.
              example: 'Universal Directory'
            name:
              type: string
              description: Name of the service.
              example: 'ZOHO_DIRECTORY'
            logo:
              type: string
              description: URL of the service logo.
              example: 'https://example.com/logo.png'
    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: 1

    policyNotFound:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: '****'
            title:
              type: string
              example: 'Policy Not Found'
            detail:
              type: string
              example: 'The specified conditional access policy does not exist.'
    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.conditional_access_policy.read: 'Read access for management actions'
            id360.conditional_access_policy.write: 'Write access for management actions'
            id360.conditional_access_policy.create: 'Create access for management actions'
            id360.conditional_access_policy.delete: 'Delete access for management actions'
            id360.conditional_access_policy.update: 'Update access for management actions'
            id360.conditional_access_policy.all: 'All access for management actions'