openapi: 3.0.0
info:
  title: Templates
  description: 'This is a template for APIs Documentation'
  version: 1.0.0
servers:
  - url: 'https://id360.manageengine.com/api/v1'
    description: 'API Endpoint'
tags:
  - name: template
    description: 'Template Endpoint'
paths:
  /templates/users/creation :
    get:
      tags:
        - template
      summary: 'Get User Creation Template'
      description: 'The Get User Creation Template API can be used to get the template for creating a new user in your account.'
      parameters:
        - $ref: '#/components/parameters/from'
        - $ref: '#/components/parameters/limit'
      responses:
        '200':
          description: 'OK'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/getUserCreationTemplateResponse'
        '400':
          description: 'Bad Request'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/invalidParam'
        '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.template.user.read

components:
  parameters:
    limit:
      in: query
      name: limit
      schema:
        type: integer
        maximum: 200
        minimum: 1
        default: 200
      description: 'Number of user creation templates to be returned in the response'
      required: false
      example: 50
    from:
      in: query
      name: from
      schema:
        type: integer
      description: 'Start range of the response'
      required: false
      example: '1'
  schemas:
    gendoc-attributes-schema:
      type: object
      $ref: '#/components/schemas/templateItem'
    getUserCreationTemplateResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/templatesArray'
        meta:
          $ref: '#/components/schemas/meta'
    templatesArray:
      type: array
      example:
        - id: "2000000066609"
          name: "User Creation System Template"
          description: "User creation template"
          category: "General"
          isDefault: true
          isUserDefined: false
          isMultiDirTemplate: true
          createdTime: "-"
          lastModifiedTime: "-"
          directories:
            - name: "PrimeTech Solutions"
              id: "2000000174051"
              isMandatory: false
            - name: "primetechsolution.onmicrosoft.com"
              id: "2000000082077"
              isMandatory: false
            - name: "primetechcloud.onmicrosoft.com"
              id: "2000000156075"
              isMandatory: false
            - name: "PrimeTech"
              id: "2000000076385"
              isMandatory: false
        - id: "2000000077228"
          name: "PrimeTech Zoho primary user creation template"
          description: "Zoho directory primary User creation template"
          category: "General"
          isDefault: false
          isUserDefined: true
          isMultiDirTemplate: true
          createdTime: "2024-05-10T21:16:41+05:30"
          lastModifiedTime: "2024-05-14T19:19:41+05:30"
          directories:
            - name: "primetechsolution.onmicrosoft.com"
              id: "2000000082077"
              isMandatory: false
            - name: "PrimeTech Solutions"
              id: "2000000174051"
              isMandatory: false
            - isPrimary: true
              name: "PrimeTec"
              id: "2000000076385"
              isMandatory: true
        - id: "2000000401001"
          name: "PrimeTech cloud(AAD) and multiple directory User Creation Template"
          description: "User creation template with AAD(primetechcloud) as Primnary directory Template and multiple mandate directory"
          category: "General"
          isDefault: false
          isUserDefined: true
          isMultiDirTemplate: true
          createdTime: "2024-05-14T19:32:38+05:30"
          lastModifiedTime: "2024-05-14T19:33:06+05:30"
          directories:
            - isPrimary: true
              name: "primetechcloud.onmicrosoft.com"
              id: "2000000156075"
              isMandatory: true
            - name: "PrimeTech Solutions"
              id: "2000000174051"
              isMandatory: true
            - name: "PrimeTech"
              id: "2000000076385"
              isMandatory: true
        - id: "2000000402001"
          name: "PrimeTech Solution AAD User creation Template "
          description: "User creation template with AAD(PrimeTechSolution) as Primnary directory for creation"
          category: "General"
          isDefault: false
          isUserDefined: true
          isMultiDirTemplate: true
          createdTime: "2024-05-14T19:40:21+05:30"
          lastModifiedTime: "-"
          directories:
            - isPrimary: true
              name: "primetechsolution.onmicrosoft.com"
              id: "2000000156077"
              isMandatory: true
            - name: "PrimeTech Solutions"
              id: "2000000174051"
              isMandatory: false
            - name: "PrimeTech"
              id: "2000000076385"
              isMandatory: false
        - id: "2000000402997"
          name: "SF PrimeTech Solution Template"
          description: "SalesForce User creation template"
          category: "General"
          isDefault: false
          isUserDefined: true
          isMultiDirTemplate: false
          createdTime: "2024-05-14T19:40:54+05:30"
          lastModifiedTime: "-"
          directories:
            - isPrimary: true
              name: "PrimeTech Solutions"
              id: "2000000174051"
              isMandatory: true
        - id: "2000000074609"
          name: "Google User Creation Template"
          description: "User creation template"
          category: null
          isDefault: true
          isUserDefined: false
          isMultiDirTemplate: false
          createdTime: "-"
          lastModifiedTime: "-"
          directories: []
        - id: "2000000074771"
          name: "Velpic User Creation Template"
          description: "User creation template"
          category: null
          isDefault: true
          isUserDefined: false
          isMultiDirTemplate: false
          createdTime: "-"
          lastModifiedTime: "-"
          directories: []
    templateItem:
      type: object
      properties:
        id:
          type: string
          description: 'Unique identifier for the user creation template'
          example: '2000000066609'
        name:
          type: string
          description: 'Name of the user creation template'
          example: 'User Creation System Template'
        description:
          type: string
          description: 'Description of the user creation template'
          example: 'User creation template'
        category:
          type: string
          description: 'Category of the user creation template'
          example: 'General'
        isDefault:
          type: boolean
          description: 'Indicates if the template is a default template'
          example: true
        isUserDefined:
          type: boolean
          description: 'Indicates if the template is user-defined'
          example: false
        isMultiDirTemplate:
          type: boolean
          description: 'Indicates if the template is a multi-directory template'
          example: false
        createdTime:
          type: string
          description: 'Time when the template was created'
          example: '2024-05-10T21:16:41+05:30'
        lastModifiedTime:
          type: string
          description: 'Time when the template was last modified'
          example: '2024-05-14T19:19:41+05:30'
        directories:
          type: array
          description: 'List of directories associated with the template'
          items:
            $ref: '#/components/schemas/directory'
    directory:
      type: object
      description: 'Directory associated with the user creation template'
      properties:
        id:
          type: string
          description: 'Unique identifier for the directory'
          example: '2000000174051'
        name:
          type: string
          description: 'Name of the directory'
          example: 'PrimeTech Solutions'
        isMandatory:
          type: boolean
          description: 'Indicates if the directory is mandatory for the template'
          example: false
        isPrimary:
          type: boolean
          description: 'Indicates if the directory is the primary directory for the template'
          example: true
    meta:
      type: object
      properties:
        start_index:
          type: integer
          example: '1'
          description: 'Start index of the response'
        limit:
          type: integer
          example: 200
          description: 'Number of user creation templates requested to be returned in the response'
        total_no_of_objects:
          type: integer
          example: 7
          description: 'Total number of user creation templates available'
    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.template.user.read: 'Read User Creation Template Data'