openapi: 3.0.0
info:
  title: Security Questions
  description: 'Security Question APIs for ID360'
  version: 1.0.0
servers:
  - url: 'https://id360.manageengine.com/api/v1'
    description: 'API Endpoint'
tags:
  - name: security-question
    description: 'Security Question Endpoint'
paths:
  /protection/security-questions:
    get:
      tags:
        - security-question
      summary: 'Get Security Questions'
      description: 'The Get Security Questions API can be used to get all the security questions available.'
      parameters:
        - $ref: '#/components/parameters/acceptHeader'
      responses:
        '200':
          description: 'OK'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/securityQuestionsGetAll'
        '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.auth.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'
  schemas:
    # Resource representing Security Questions for AuthnFactor
    securityQuestionsResource:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the security question.
          example: "2000000283042"
          readOnly: true
        question:
          type: string
          description: The actual text of the security question.
          example: "What is your favorite cartoon?"
        deletable:
          type: boolean
          description: Indicates whether this security question can be deleted.
          example: false
    securityQuestionsGetAll:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/securityQuestionsResource'
          example:
            - id: "2000000283042"
              question: "What is your fav cartoon ?"
              deletable: false
            - id: "2000000283043"
              question: "The country you always dreamed of vacationing in ?"
              deletable: true
            - id: "2000000283044"
              question: "What is your fav color ?"
              deletable: true
            - id: "2000000283045"
              question: "Who is your fav childhood hero?"
              deletable: false
    invalidParam:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: '00000107'
            title:
              type: string
              example: 'Invalid Parameter'
            detail:
              type: string
              example: 'The parameter select is invalid.'
    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:
            idmpod.auth.read: 'Read AuthnFactor from the account'