openapi: 3.0.0
info:
  title: Admin Settings API                                    # TITLE OF THE DOCUMENT (REQUIRED)
  description: 'This Admin Settings API provides endpoints to programmatically manage environment variables and organizational attributes such as titles, departments, offices, and companies. These values are commonly referenced in templates, provisioning rules, and attribute mappings, and can be modified without accessing the ADManager Plus UI.'  # DESCRIPTION OF THE DOCUMENT
  contact: {}
  version: 2.0.0
servers:
  -
    url: 'http://admanagerplus:8080/api/v2'                       # PRODUCT URL
    description: 'API Endpoint'                            # URL DESCRIPTION
tags:
  -
    name: admin-settings                                     # TAG NAME SHOULD BE SAME AS DEFINED IN APP.YML TAGS & SAME AS YML FILE NAME (REQUIRED)
    description: 'Admin Settings'                      # DESCRIPTION ABOUT THE TAG NAME
security:
  - authToken: []
paths:
  /admin_settings/environment_variables   :
    get:
      tags:
        - admin-settings  
      summary: List environment variables
      description: |
        This endpoint retrieves environment variables configured in ADManager Plus. Results can be refined using filters, sorting, and pagination.
      parameters:
        - $ref: '#/components/parameters/acceptHeader'
        - $ref: '#/components/parameters/xModule'
        - $ref: '#/components/parameters/from'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/fields'
        - $ref: '#/components/parameters/filter'
        - $ref: '#/components/parameters/sort'
      responses:
        "200":
          description: Successful response with list of environment variables.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/list_environment_variables_response'
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bad_request_response'
        "401":
          description: UnAuthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/unauthorized_response'
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/internal_server_error_response'
      security: 
        - authToken: 
          - Read environment variables action, All admin settings actions
          - delegated-roles
          - Server Settings > Environment Variable
    post:
      tags:
        - admin-settings  
      summary: Add environment variable
      description: This endpoint adds a new environment variable to ADManager Plus. Environment variables store reusable values that can be referenced in multiple configurations and workflows.
      parameters:
        - $ref: '#/components/parameters/acceptHeader'
        - $ref: '#/components/parameters/xModule'
      requestBody:
        description: Request body to add environment variable.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/add_environment_variable_body'
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/add_environment_variable_response'
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bad_request_response'
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/unauthorized_response'
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/internal_server_error_response'
      deprecated: false
      security: 
        - authToken: 
          - Add environment variables action, All admin settings actions
          - delegated-roles
          - Server Settings > Environment Variable
  /admin_settings/environment_variables/{variable_id}:
    patch:
      tags:
        - admin-settings  
      summary: Update environment variable
      description: This endpoint updates the value, security status, or description of an environment variable.
      parameters:
        - $ref: '#/components/parameters/acceptHeader'
        - $ref: '#/components/parameters/xModule'
        - name: variable_id
          in: path
          description: 'The unique identifier of the environment variable to be updated.'
          required: true
          schema:
            type: integer
          example: 1
      requestBody:
        description: Request body to update environment variable.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/update_environment_variable_body'
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/update_environment_variable_response'
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bad_request_response'
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/unauthorized_response'
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/internal_server_error_response'
      deprecated: false
      security: 
        - authToken: 
          - Update environment variables action, All admin settings actions
          - delegated-roles
          - Server Settings > Environment Variable
  /admin_settings/organization_attributes/titles:
    get:
      tags:
        - admin-settings  
      summary: List organization titles
      description: |
        This endpoint retrieves organization titles available in ADManager Plus.
      parameters:
        - $ref: '#/components/parameters/acceptHeader'
        - $ref: '#/components/parameters/xModule'
        - $ref: '#/components/parameters/from'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/fields'
        - $ref: '#/components/parameters/filter'
        - $ref: '#/components/parameters/sort'
      responses:
        "200":
          description: Successful response with list of organization titles.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/list_org_titles_response'
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bad_request_response'
        "401":
          description: UnAuthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/unauthorized_response'
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/internal_server_error_response'
      security: 
        - authToken: 
          - Read organization attributes action, All admin settings actions
          - delegated-roles
          - Custom Settings > Organization Attributes > Titles
    post:
      tags:
        - admin-settings  
      summary: Add organization title
      description: This endpoint adds one or more new organization titles. Titles help classify and standardize roles across the organization.
      parameters:
        - $ref: '#/components/parameters/acceptHeader'
        - $ref: '#/components/parameters/xModule'
      requestBody:
        description: Request body to add organization title.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/add_org_titles_body'
      responses:
        "201":
          description: Organization title created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/add_org_titles_response'
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bad_request_response'
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/unauthorized_response'
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/internal_server_error_response'
      security: 
        - authToken: 
          - Add organization attributes action, All admin settings actions
          - delegated-roles
          - Custom Settings > Organization Attributes > Titles
    delete:
      tags:
        - admin-settings  
      summary: Delete organization title
      description: This endpoint deletes an organization title from ADManager Plus.
      parameters:
        - $ref: '#/components/parameters/acceptHeader'
        - $ref: '#/components/parameters/xModule'
        - $ref: '#/components/parameters/from'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/filter'
        - $ref: '#/components/parameters/sort'
      responses:
        "200":
          description: Organization title deleted successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/delete_org_attribute_response'
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bad_request_response'
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/unauthorized_response'
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/internal_server_error_response'
      security: 
        - authToken: 
          - Delete organization attributes action, All admin settings actions
          - delegated-roles
          - Custom Settings > Organization Attributes > Titles
  /admin_settings/organization_attributes/departments:
    get:
      tags:
        - admin-settings  
      summary: List organization departments
      description: |
        This endpoint retrieves organization departments available in ADManager Plus.
      parameters:
        - $ref: '#/components/parameters/acceptHeader'
        - $ref: '#/components/parameters/xModule'
        - $ref: '#/components/parameters/from'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/fields'
        - $ref: '#/components/parameters/filter'
        - $ref: '#/components/parameters/sort'
      responses:
        "200":
          description: Successful response with list of organization departments.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/list_org_departments_response'
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bad_request_response'
        "401":
          description: UnAuthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/unauthorized_response'
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/internal_server_error_response'
      security: 
        - authToken:
          - Read organization attributes action, All admin settings actions
          - delegated-roles
          - Custom Settings > Organization Attributes > Departments
    post:
      tags:
        - admin-settings  
      summary: Add organization departments
      description: This endpoint adds one or more new organization departments.
      parameters:
        - $ref: '#/components/parameters/acceptHeader'
        - $ref: '#/components/parameters/xModule'
      requestBody:
        description: Request body to add organization departments.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/add_org_departments_body'
      responses:
        "201":
          description: Organization departments created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/add_org_departments_response'
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bad_request_response'
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/unauthorized_response'
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/internal_server_error_response'
      security: 
        - authToken: 
          - Add organization attributes action, All admin settings actions
          - delegated-roles
          - Custom Settings > Organization Attributes > Departments
    delete:
      tags:
        - admin-settings  
      summary: Delete organization department
      description: This endpoint deletes an organization department from ADManager Plus.
      parameters:
        - $ref: '#/components/parameters/acceptHeader'
        - $ref: '#/components/parameters/xModule'
        - $ref: '#/components/parameters/from'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/filter'
        - $ref: '#/components/parameters/sort'
      responses:
        "200":
          description: Organization departments deleted successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/delete_org_attribute_response'
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bad_request_response'
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/unauthorized_response'
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/internal_server_error_response'
      security: 
        - authToken: 
          - Delete organization attributes action, All admin settings actions
          - delegated-roles
          - Custom Settings > Organization Attributes > Departments
  /admin_settings/organization_attributes/offices:
    get:
      tags:
        - admin-settings  
      summary: List organization offices
      description: |
        This endpoint retrieves organization offices available in ADManager Plus.
      parameters:
        - $ref: '#/components/parameters/acceptHeader'
        - $ref: '#/components/parameters/xModule'
        - $ref: '#/components/parameters/from'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/fields'
        - $ref: '#/components/parameters/filter'
        - $ref: '#/components/parameters/sort'
      responses:
        "200":
          description: Successful response with list of organization offices.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/list_org_offices_response'
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bad_request_response'
        "401":
          description: UnAuthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/unauthorized_response'
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/internal_server_error_response'
      security: 
        - authToken: 
          - Read organization attributes action, All admin settings actions
          - delegated-roles
          - Custom Settings > Organization Attributes > Offices
    post:
      tags:
        - admin-settings  
      summary: Add organization office
      description: This endpoint adds one or more new organization offices.
      parameters:
        - $ref: '#/components/parameters/acceptHeader'
        - $ref: '#/components/parameters/xModule'
      requestBody:
        description: Request body to add organization office.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/add_org_offices_body'
      responses:
        "201":
          description: Organization office created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/add_org_offices_response'
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bad_request_response'
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/unauthorized_response'
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/internal_server_error_response'
      security: 
        - authToken: 
          - Add organization attributes action, All admin settings actions
          - delegated-roles
          - Custom Settings > Organization Attributes > Offices
    delete:
      tags:
        - admin-settings  
      summary: Delete organization offices
      description: This endpoint deletes an organization office from ADManager Plus.
      parameters:
        - $ref: '#/components/parameters/acceptHeader'
        - $ref: '#/components/parameters/xModule'
        - $ref: '#/components/parameters/from'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/filter'
        - $ref: '#/components/parameters/sort'
      responses:
        "200":
          description: Organization offices deleted successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/delete_org_attribute_response'
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bad_request_response'
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/unauthorized_response'
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/internal_server_error_response'
      security: 
        - authToken: 
          - Delete organization attributes action, All admin settings actions
          - delegated-roles
          - Custom Settings > Organization Attributes > Offices
  /admin_settings/organization_attributes/companies:
    get:
      tags:
        - admin-settings  
      summary: List organization companies
      description: |
        This endpoint retrieves organization companies available in ADManager Plus.
      parameters:
        - $ref: '#/components/parameters/acceptHeader'
        - $ref: '#/components/parameters/xModule'
        - $ref: '#/components/parameters/from'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/fields'
        - $ref: '#/components/parameters/filter'
        - $ref: '#/components/parameters/sort'
      responses:
        "200":
          description: Successful response with list of organization companies.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/list_org_companies_response'
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bad_request_response'
        "401":
          description: UnAuthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/unauthorized_response'
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/internal_server_error_response'
      security: 
        - authToken: 
          - Read organization attributes action, All admin settings actions
          - delegated-roles
          - Custom Settings > Organization Attributes > Companies
    post:
      tags:
        - admin-settings  
      summary: Add organization companies
      description: This endpoint adds one or more new organization companies.
      parameters:
        - $ref: '#/components/parameters/acceptHeader'
        - $ref: '#/components/parameters/xModule'
      requestBody:
        description: Request body to add organization title.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/add_org_companies_body'
      responses:
        "201":
          description: Organization companies created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/add_org_companies_response'
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bad_request_response'
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/unauthorized_response'
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/internal_server_error_response'
      security: 
        - authToken: 
          - Add organization attributes action, All admin settings actions
          - delegated-roles
          - Custom Settings > Organization Attributes > Companies
    delete:
      tags:
        - admin-settings  
      summary: Delete organization companies
      description: This endpoint deletes an organization company from ADManager Plus.
      parameters:
        - $ref: '#/components/parameters/acceptHeader'
        - $ref: '#/components/parameters/xModule'
        - $ref: '#/components/parameters/from'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/filter'
        - $ref: '#/components/parameters/sort'
      responses:
        "200":
          description: Organization companies deleted successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/delete_org_attribute_response'
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bad_request_response'
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/unauthorized_response'
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/internal_server_error_response'
      security: 
        - authToken: 
          - Delete organization attributes action, All admin settings actions
          - delegated-roles
          - Custom Settings > Organization Attributes > Companies
components:
  parameters:
    authorization:
      name: Authorization
      in: header
      schema:
        type: string
      description: 'Authtoken for the API'
      required: true
      example: '41d**************125f'
    acceptHeader:
      name: Accept
      in: header
      schema:
        type: string
      description: 'The response format that the client accepts.'
      required: false
      example: 'application/json'
    contentType:
      name: Content-Type
      in: header
      schema:
        type: string
      description: 'The format of data sent to the server. This value is passed in the Content-Type header of the API request.'
      required: false
      example: 'application/json'
    xModule:
      name: X-Module
      in: header
      schema:
        type: string
      description: 'The module name to be recorded in the audit logs. If not provided, the default module is recorded as Rest API.'
      required: false
      example: 'External API'
    from:
      in: query
      name: from
      schema:
        type: integer
        minimum: 1
      description: 'The starting index for pagination. Enables pagination through large result sets.'
      required: false
      example: 1
    limit:
      in: query
      name: limit
      schema:
        type: integer
        maximum: 100
        minimum: 1
      description: 'The maximum number of records to return per request.'
      required: false
      example: 50
    fields:
      in: query
      name: fields
      schema:
        type: string
      description: 'The attributes to be returned in the response.'
      required: false
    filter:
      in: query
      name: filter
      schema:
        type: string
      description: >
        A SCIM filter query to refine which resources are returned. See <a href="https://www.manageengine.com/za/products/ad-manager/active-directory-api/v2/filters/#overview">Filter section</a> for details.
        <br>
        <strong>eg:</strong> (ORG_ATTRIB_NAME eq Value1)
      required: false
      example: (ORG_ATTRIB_NAME eq Value1)
    sort:
      in: query
      name: sort
      schema:
        type: string
      description: >
        This field is used to sort results. The default sort order is ascending. To sort in descending order, prefix the field with a hyphen (-).
        <br>
        <strong>eg:</strong> ORG_ATTRIB_NAME
      required: false
      example: '-ORG_ATTRIB_NAME'
  schemas:
    list_environment_variables_response: 
      type: object
      properties:
        data:
          type: array
          example:
          - VAR_NAME: "test"
            VAR_VALUE: "**********"
            UNIQUE_ID: 1
          - VAR_NAME: "test2"
            VAR_VALUE: "TesterValue"
            UNIQUE_ID: 2
        meta:
          $ref: '#/components/schemas/meta'
          example:
            start_index: 1
            limit: 10
            total_no_of_objects: 2

    env_var_array:
      type: array
      items:
        example:
          - VAR_NAME: "test"
            VAR_VALUE: "**********"
            UNIQUE_ID: 1
          - VAR_NAME: "test2"
            VAR_VALUE: "TesterValue"
            UNIQUE_ID: 2
    
    meta:
      type: object
      properties:
        start_index:
          type: integer
        limit:
          type: integer
        total_no_of_objects:
          type: integer

    add_environment_variable_body:
      type: object
      properties:
        data:
          type: object
          description: Details of the environment variable to update.
          properties:
            variable_name:
              type: string
              description: "The name of the environment variable."
            variable_value:
              type: string
              description: "The value of the environment variable."
            is_secure:
              type: boolean
              description: "Indicates if the environment variable should be secured."
            description:
              type: string
              description: "Description of the environment variable"
          example:
            variable_name: "TEST_VAR"
            variable_value: "TesterValue"
            is_secure: true
            description: "Tester"
    
    add_environment_variable_response:
      type: object
      properties:
        data:
          type: object
          $ref: '#/components/schemas/add_environment_variable_data_response'
    
    add_environment_variable_data_response:
      type: object
      properties:
        environment_variable:
          type: object
          $ref: '#/components/schemas/env_variable'
          example:
            variable_name: "TEST_VAR"
            variable_value: "TesterValue"
            is_secure: true
            description: "Tester"
        status:
          $ref: '#/components/schemas/status'
          example:
            status_code: 1
            status_message: "Environment Variable added successfully!"


    update_environment_variable_body:
      type: object
      properties:
        data:
          type: object
          description: Details of the environment variable to update.
          properties:
            variable_value:
              type: string
              description: "The new value of the environment variable."
            is_secure:
              type: boolean
              description: "Indicates if the environment variable should be secured."
            description:
              type: string
              description: "Description of the environment variable to be updated."
          example:
            variable_value: "TesterValue"
            is_secure: true
            description: "Tester"

    update_environment_variable_response:
      type: object
      properties:
        data:
          type: object
          $ref: '#/components/schemas/update_environment_variable_data_response'
        

    update_environment_variable_data_response:
      type: object
      properties:
        environment_variable:
          type: object
          $ref: '#/components/schemas/env_variable'
          example:
            variable_value: "TesterValue"
            is_secure: true,
            description: "Tester"
        status:
          $ref: '#/components/schemas/status'
          example:
            status_code: 1
            status_message: "Environment Variable updated successfully!"

    env_variable:
      type: object
      properties:
        variable_name:
          type: string
        variable_value:
          type: string
        is_secure:
          type: string
        description:
          type: string
    
    status:
      type: object
      properties:
        status_code:
          type: integer
        status_message:
          type: string
        execution_id:
          type: string
      
    list_org_titles_response:
      type: object
      properties:
        data:
          type: array
          items:
            type: object
            properties:
              ORG_ATTRIB_ID:
                type: integer
                description: "Unique identifier for the organization title"
              ORG_ATTRIB_NAME:
                type: string
                description: "Name of the organization title"
          example:
            - ORG_ATTRIB_ID: 1 
              ORG_ATTRIB_NAME: "Manager"
            - ORG_ATTRIB_ID: 2 
              ORG_ATTRIB_NAME: "Help Desk Technician"
        meta:
          $ref: '#/components/schemas/meta'
          example:
            start_index: 1
            limit: 10
            total_no_of_objects: 2

    list_org_departments_response:
      type: object
      properties:
        data:
          type: array
          items:
            type: object
            properties:
              ORG_ATTRIB_ID:
                type: integer
                description: "Unique identifier for the organization department"
              ORG_ATTRIB_NAME:
                type: string
                description: "Name of the organization department"
          example:
            - ORG_ATTRIB_ID: 1 
              ORG_ATTRIB_NAME: "Sales"
            - ORG_ATTRIB_ID: 2 
              ORG_ATTRIB_NAME: "Support"
        meta:
          $ref: '#/components/schemas/meta'
          example:
            start_index: 1
            limit: 10
            total_no_of_objects: 2
    
    list_org_offices_response:
      type: object
      properties:
        data:
          type: array
          items:
            type: object
            properties:
              ORG_ATTRIB_ID:
                type: integer
                description: "Unique identifier for the organization title"
              ORG_ATTRIB_NAME:
                type: string
                description: "Name of the organization title"
          example:
            - ORG_ATTRIB_ID: 1 
              ORG_ATTRIB_NAME: "New York"
            - ORG_ATTRIB_ID: 2 
              ORG_ATTRIB_NAME: "San Francisco"
        meta:
          $ref: '#/components/schemas/meta'
          example:
            start_index: 1
            limit: 10
            total_no_of_objects: 2
    
    list_org_companies_response: 
      type: object
      properties:
        data:
          type: array
          items:
            type: object
            properties:
              ORG_ATTRIB_ID:
                type: integer
                description: "Unique identifier for the organization company"
              ORG_ATTRIB_NAME:
                type: string
                description: "Name of the organization company"
          example:
            - ORG_ATTRIB_ID: 1 
              ORG_ATTRIB_NAME: "TechCorp"
            - ORG_ATTRIB_ID: 2 
              ORG_ATTRIB_NAME: "Innovate Inc."
        meta:
          $ref: '#/components/schemas/meta'
          example:
            start_index: 1
            limit: 10
            total_no_of_objects: 2

    add_org_titles_body:
      type: object
      properties:
        data:
          type: object
          description: Details of the organization title(s) to add.
          $ref: '#/components/schemas/add_org_attributes_body'
          example:
              attribute_values: "Manager;Help Desk Technician"

    add_org_departments_body:
      type: object
      properties:
        data:
          type: object
          description: Details of the organization department(s) to add.
          $ref: '#/components/schemas/add_org_attributes_body'
          example:
              attribute_values: "Sales;Support"
    
    add_org_offices_body:
      type: object
      properties:
        data:
          type: object
          description: Details of the organization office(s) to add.
          $ref: '#/components/schemas/add_org_attributes_body'
          example:
              attribute_values: "New York;San Francisco"
      
    add_org_companies_body:
      type: object
      properties:
        data:
          type: object
          description: Details of the organization company(ies) to add.
          $ref: '#/components/schemas/add_org_attributes_body'
          example:
              attribute_values: "TechCorp;Innovate Inc."

    add_org_attributes_body:
      type: object
      properties:
        attribute_values:
          type: string
          description: Semicolon-separated names of the organization attribute values to be added.
      
    add_org_titles_response:
      type: object
      properties:
        data:
          type: object
          properties:
            titles:
              type: object
              properties:
                attribute_values:
                  type: string
              example:
                attribute_values: "Manager;Help Desk Technician"
            status:
              type: object
              $ref: '#/components/schemas/status'
              example:
                status_code: 1
                status_message: "All the specified Titles have been successfully added."
    
    add_org_departments_response:
      type: object
      properties:
        data:
          type: object
          properties:
            departments:
              type: object
              properties:
                attribute_values:
                  type: string
              example:
                attribute_values: "Sales;Support"
            status:
              type: object
              $ref: '#/components/schemas/status'
              example:
                status_code: 1
                status_message: "All the specified Departments have been successfully added."
          
    add_org_offices_response:
      type: object
      properties:
        data:
          type: object
          properties:
            offices:
              type: object
              properties:
                attribute_values:
                  type: string
              example:
                attribute_values: "New York;San Francisco"
            status:
              type: object
              $ref: '#/components/schemas/status'
              example:
                status_code: 1
                status_message: "All the specified Offices have been successfully added."

    add_org_companies_response:
      type: object 
      properties:
        data:
          type: object
          properties:
            companies:
              type: object
              properties:
                attribute_values:
                  type: string
              example:
                attribute_values: "TechCorp;Innovate Inc."
            status:
              type: object
              $ref: '#/components/schemas/status'
              example:
                status_code: 1
                status_message: "All the specified Companies have been successfully added."

    delete_org_attribute_response:
      type: object
      properties:
        data:
          type: object
          properties:
            object:
              type: object
              properties:
                ORG_ATTRIB_ID:
                  type: string
                  description: "Unique identifier for the organization attribute"
                ORG_ATTRIB_NAME:
                  type: string
                  description: "Name of the organization attribute"
              example:
                ORG_ATTRIB_ID: 1
                ORG_ATTRIB_NAME: "Org Attribute 1"
            status:
              type: object
              $ref: '#/components/schemas/status'
              example:
                status_code: 1
                status_message: "Successfully removed the entries."

                
    bad_request_response:
      type: object
      properties:
        code:
          type: string
          description: Error code
          example: "00000100"
        detail:
          type: string
          description: Detailed error message
          example: "Some columns given in fields parameter are invalid"
        title:
          type: string
          description: Short error message
          example: "Bad Request."

    unauthorized_response:
      type: object
      properties:
        code:
          type: string
          description: Error code
          example: "00000101"
        detail:
          type: string
          description: Detailed error message
          example: "The given Authtoken is invalid."
        title:
          type: string
          description: Short error message
          example: "Unauthorized."

    internal_server_error_response:
      type: object
      properties:
        code:
          type: string
          description: Error code
          example: "00000000"
        detail:
          type: string
          description: Detailed error message
          example: "An internal server error occurred."
        title:
          type: string
          description: Short error message
          example: "Internal Server Error."
        
  securitySchemes:
    authToken:
      type: apiKey
      in: header
      name: Authorization
