openapi: 3.0.0
info:
  title: Certificate Authority Configs
  description: This API allows you to manage Certificate Authority configurations for Authnfactor Configs in Identity Protection.
  version: 1.1.2
servers:
  - url: 'https://id360.manageengine.com/api/v1'
    description: 'API Endpoint'
tags:
  - name: ca-config
    description: 'Certificate Authority Config Endpoints'
paths:
  # Certificate Authority Configs
  /protection/authnfactor-configs/{authnfactor_config_id}/ca-configs:
    post:
      tags:
        - ca-config
      summary: 'Create a Certificate Authority Config'
      description: 'The Create Certificate Authority Config to Authnfactor Config API can be used to create a new certificate authority config for a specific authnfactor config.'
      parameters:
        - $ref: '#/components/parameters/acceptHeader'
        - $ref: '#/components/parameters/authnfactorConfigId'
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/caConfigResource'
      responses:
        '201':
          description: 'Created'
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/caConfigResource'
        '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.CREATE
            - id360.auth.WRITE
            - id360.auth.ALL
  /protection/authnfactor-configs/{authnfactor_config_id}/ca-configs/{ca_config_id}:
    patch:
      tags:
        - ca-config
      summary: 'Update Certificate Authority Config'
      description: 'The Update Certificate Authority Config API can be used to update the details of a specific certificate authority config in a specific authnfactor config.'
      parameters:
        - $ref: '#/components/parameters/acceptHeader'
        - $ref: '#/components/parameters/authnfactorConfigId'
        - $ref: '#/components/parameters/caConfigId'
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/caConfigResource'
      responses:
        '200':
          description: 'OK'
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/caConfigResource'
        '401':
          description: 'Unauthorized'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/unauthorized'
        '404':
          description: 'Not Found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/caConfigNotFound'
        '500':
          description: 'Internal Server Error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/serverError'
      security:
        - Zoho_Auth:
            - id360.auth.UPDATE
            - id360.auth.WRITE
            - id360.auth.ALL
    delete:
      tags:
        - ca-config
      summary: 'Delete Certificate Authority Config'
      description: 'Delete Certificate Authority Config API can be used to delete a specific certificate authority config in a specific authnfactor config.'
      parameters:
        - $ref: '#/components/parameters/acceptHeader'
        - $ref: '#/components/parameters/authnfactorConfigId'
        - $ref: '#/components/parameters/caConfigId'
      responses:
        '204':
          description: No Content
        '401':
          description: 'Unauthorized'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/unauthorized'
        '404':
          description: 'Not Found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/caConfigNotFound'
        '500':
          description: 'Internal Server Error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/serverError'
      security:
        - Zoho_Auth:
            - id360.auth.DELETE
            - id360.auth.WRITE
            - id360.auth.ALL

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'
    authnfactorConfigId:
      name: authnfactor_config_id
      in: path
      required: true
      description: 'The ID of the authnfactor config'
      example: 1525000000165354
      schema:
        type: integer
        example: 1525000000165354
    caConfigId:
      name: ca_config_id
      in: path
      required: true
      description: 'The ID of the certificate authority config'
      example: 1525000000178381
      schema:
        type: integer
        example: 1525000000178381
  schemas:
    gendoc-attributes-schema:
      type: object
      $ref: '#/components/schemas/caConfigResource'

    # Resource representing Certificate Authority (CA) configuration
    caConfigResource:
      type: object
      properties:
        id:
          type: string
          description: 'Unique identifier for the certificate authority configuration.'
          example: "1525000000178381"
          readOnly: true
        is_enabled:
          type: boolean
          description: To enable or disable the configured CA
          example: true
        ca_file:
          type: string
          format: binary
          description: >
            CER encoded CA certificate file
            <br>
            Note: The file should be in .cer format;
          example: "-----BEGIN CERTIFICATE-----\r\nMIIDWjCCAk.....\r\n-----END CERTIFICATE-----\r\n"
          writeOnly: true
        subject_name:
          type: string
          description: Distinguished Name (DN) of the CA, used for identification
          example: "CN=idprotection,CN=Users,DC=Com"
          readOnly: true
        thumbprint:
          type: string
          description: Thumbprint of the CA certificate, used for identification
          example: "deuejnjenje2endd32ejdjebjfer"
          readOnly: true
        certificate_mapping_attribute:
          type: string
          description: Mapping attribute for smartcard enrollment and verification
          example: "emailAddress"
        expires_on:
          type: string
          description: Expiration date of the CA certificate
          example: "2025-09-08T20:14:45.000Z"
          readOnly: true
        added_time:
          type: string
          description: Timestamp when the CA configuration was added
          example: "2025-09-08T20:14:45.000Z"
          readOnly: true

    caConfigNotFound:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: '---'
            title:
              type: string
              example: 'CA Configuration Not Found'
            detail:
              type: string
              example: 'This CA Configuration ID 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:
            idmpod.auth.read: 'Read Authnfactor Configs from the account'
            idmpod.auth.write: 'Create/Update/Delete Authnfactor Configs in the account'
            idmpod.auth.create: 'Create Authnfactor Config in the account'
            idmpod.auth.delete: 'Delete Authnfactor Config from the account'
            idmpod.auth.update: 'Update Authnfactor Config in the account'
            idmpod.auth.all: 'Perform all actions on Authnfactor Configs'