openapi: 3.0.0
info:
  title: Roles
  description: |
    You can set up roles for a group of users and configure distinct access permissions for various features in Zoho Cliq. However, you must be an admin to access these APIs.
  contact: {}
  version: 1.0.0
externalDocs:
  description: Find out more about Zoho Cliq APIs V2
  url: https://www.zoho.com/cliq/help/restapi/v2/
servers:
  - url: https://cliq.zoho.com/api/v2
    description: Zoho Cliq US DC
tags:
  - name: roles
    description: Roles Module
paths:
  /profiles:
    get:
      summary: Get Roles
      operationId: Get Roles
      description: |
        Use this API to fetch all available roles in your organization
          <br><br> 
        <p>
          <b>Threshold limit</b>: 20 requests per min per user<br>
          Number of API calls allowed within a minute.<br><br>
          <b>Lock period</b>: 10 minutes<br>Wait time before consecutive API requests.<br>
        </p>
      responses:
        '200':
          description: The request was successfully completed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserProfilesResponse'
        '400':
          description: Bad Request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: The request cannot be performed. Usually because of malformed parameter or missing parameter.
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Request was rejected because of invalid AuthToken.
        '403':
          description: Forbidden.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: The user does not have enough permission or possibly not an user of the respective organization to access the resource.
        '404':
          description: Invalid URL.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: The URL you've sent is wrong. It's possible that the resource you've requested has been moved to another URL.
        '405':
          description: Method Not Allowed.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: The requested resource does not support the HTTP method used. For example, requesting List of all customers API with PUT as the HTTP method.
        '406':
          description: Not Acceptable.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: The response has been received but the requested response type is not supported by the browser.
        '429':
          description: Too many requests.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Too many requests within a certain time frame.
        '500':
          description: Internal Server Error.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Cliq server encountered an error which prevents it from fulfilling the request.
      security:
        - Cliq_Auth:
            - ZohoCliq.Organisation.READ
      tags:
        - roles
    post:
      summary: Create a Role
      operationId: Create a Role
      description: |
        Use this API to create a custom role in your organization.
          <br><br> 
        <p>
          <b>Threshold limit</b>: 20 requests per min per user<br>
          Number of API calls allowed within a minute.<br><br>
          <b>Lock period</b>: 10 minutes<br>Wait time before consecutive API requests.<br>
        </p>
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RoleCreationRequest'
      responses:
        '200':
          description: The request was successfully completed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RoleCreationResponse'
        '400':
          description: Bad Request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: The request cannot be performed. Usually because of malformed parameter or missing parameter.
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Request was rejected because of invalid AuthToken.
        '403':
          description: Forbidden.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: The user does not have enough permission or possibly not an user of the respective organization to access the resource.
        '404':
          description: Invalid URL.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: The URL you've sent is wrong. It's possible that the resource you've requested has been moved to another URL.
        '405':
          description: Method Not Allowed.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: The requested resource does not support the HTTP method used. For example, requesting List of all customers API with PUT as the HTTP method.
        '406':
          description: Not Acceptable.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: The response has been received but the requested response type is not supported by the browser.
        '429':
          description: Too many requests.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Too many requests within a certain time frame.
        '500':
          description: Internal Server Error.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Cliq server encountered an error which prevents it from fulfilling the request.
      security:
        - Cliq_Auth:
            - ZohoCliq.Organisation.CREATE
      tags:
        - roles
  /profiles/{PROFILE_ID}:
    get:
      summary: Retrieve role details
      operationId: Retrieve role details
      description: |
        Use this API to retrieve detailed information about a specific role.
          <br><br> 
        <p>
          <b>Threshold limit</b>: 20 requests per min per user<br>
          Number of API calls allowed within a minute.<br><br>
          <b>Lock period</b>: 10 minutes<br>Wait time before consecutive API requests.<br>
        </p>
      parameters:
        - name: PROFILE_ID
          in: path
          required: true
          description: Unique identifier of the role to be retrieved To learn how to retrieve this ID, see <a href="/cliq/help/restapi/v2/glossary/#PROFILE_ID">PROFILE_ID</a> in the Glossary page.
          schema:
            type: string
          example: PROFILE_ID
      responses:
        '200':
          description: The request was successfully completed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RoleDetailResponse'
        '400':
          description: Bad Request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: The request cannot be performed. Usually because of malformed parameter or missing parameter.
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Request was rejected because of invalid AuthToken.
        '403':
          description: Forbidden.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: The user does not have enough permission or possibly not an user of the respective organization to access the resource.
        '404':
          description: Invalid URL.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: The URL you've sent is wrong. It's possible that the resource you've requested has been moved to another URL.
        '405':
          description: Method Not Allowed.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: The requested resource does not support the HTTP method used. For example, requesting List of all customers API with PUT as the HTTP method.
        '406':
          description: Not Acceptable.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: The response has been received but the requested response type is not supported by the browser.
        '429':
          description: Too many requests.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Too many requests within a certain time frame.
        '500':
          description: Internal Server Error.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Cliq server encountered an error which prevents it from fulfilling the request.
      security:
        - Cliq_Auth:
            - ZohoCliq.Organisation.READ
      tags:
        - roles
    put:
      summary: Edit a Role
      operationId: Edit a Role
      description: |
        Use this API to update a role in your organization.
          <br><br> 
        <p>
          <b>Threshold limit</b>: 20 requests per min per user<br>
          Number of API calls allowed within a minute.<br><br>
          <b>Lock period</b>: 10 minutes<br>Wait time before consecutive API requests.<br>
        </p>
      parameters:
        - name: PROFILE_ID
          in: path
          required: true
          description: Unique identifier of the role to be modified To learn how to retrieve this ID, see <a href="/cliq/help/restapi/v2/glossary/#PROFILE_ID">PROFILE_ID</a> in the Glossary page.
          schema:
            type: string
          example: PROFILE_ID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateRoleRequest'
      responses:
        '200':
          description: The request was successfully completed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/no-response'
        '400':
          description: Bad Request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: The request cannot be performed. Usually because of malformed parameter or missing parameter.
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Request was rejected because of invalid AuthToken.
        '403':
          description: Forbidden.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: The user does not have enough permission or possibly not an user of the respective organization to access the resource.
        '404':
          description: Invalid URL.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: The URL you've sent is wrong. It's possible that the resource you've requested has been moved to another URL.
        '405':
          description: Method Not Allowed.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: The requested resource does not support the HTTP method used. For example, requesting List of all customers API with PUT as the HTTP method.
        '406':
          description: Not Acceptable.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: The response has been received but the requested response type is not supported by the browser.
        '429':
          description: Too many requests.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Too many requests within a certain time frame.
        '500':
          description: Internal Server Error.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Cliq server encountered an error which prevents it from fulfilling the request.
      security:
        - Cliq_Auth:
            - ZohoCliq.Organisation.UPDATE
      tags:
        - roles
    delete:
      summary: Delete a Role
      operationId: Delete a Role
      description: |
        Use this API to delete a role in your organization.
          <br><br> 
        <p>
          <b>Threshold limit</b>: 20 requests per min per user<br>
          Number of API calls allowed within a minute.<br><br>
          <b>Lock period</b>: 10 minutes<br>Wait time before consecutive API requests.<br>
        </p>
      parameters:
        - name: PROFILE_ID
          in: path
          required: true
          description: Unique identifier of the role to be deleted To learn how to retrieve this ID, see <a href="/cliq/help/restapi/v2/glossary/#PROFILE_ID">PROFILE_ID</a> in the Glossary page.
          schema:
            type: string
          example: PROFILE_ID
      responses:
        '200':
          description: The request was successfully completed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/no-response'
        '400':
          description: Bad Request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: The request cannot be performed. Usually because of malformed parameter or missing parameter.
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Request was rejected because of invalid AuthToken.
        '403':
          description: Forbidden.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: The user does not have enough permission or possibly not an user of the respective organization to access the resource.
        '404':
          description: Invalid URL.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: The URL you've sent is wrong. It's possible that the resource you've requested has been moved to another URL.
        '405':
          description: Method Not Allowed.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: The requested resource does not support the HTTP method used. For example, requesting List of all customers API with PUT as the HTTP method.
        '406':
          description: Not Acceptable.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: The response has been received but the requested response type is not supported by the browser.
        '429':
          description: Too many requests.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Too many requests within a certain time frame.
        '500':
          description: Internal Server Error.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Cliq server encountered an error which prevents it from fulfilling the request.
      security:
        - Cliq_Auth:
            - ZohoCliq.Organisation.DELETE
      tags:
        - roles
  /profiles/{PROFILE_ID}/permissions:
    get:
      summary: Get permissions of a role
      operationId: Get permissions of a role
      description: |
        Use this API to get the permissions of a role in your organization.
          <br><br> 
        <p>
          <b>Threshold limit</b>: 20 requests per min per user<br>
          Number of API calls allowed within a minute.<br><br>
          <b>Lock period</b>: 10 minutes<br>Wait time before consecutive API requests.<br>
        </p>
      parameters:
        - name: PROFILE_ID
          in: path
          required: true
          description: Unique identifier of the role for which permission details need to be retrieved To learn how to retrieve this ID, see <a href="/cliq/help/restapi/v2/glossary/#PROFILE_ID">PROFILE_ID</a> in the Glossary page.
          schema:
            type: string
          example: PROFILE_ID
      responses:
        '200':
          description: The request was successfully completed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RolePermissionResponse'
        '400':
          description: Bad Request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: The request cannot be performed. Usually because of malformed parameter or missing parameter.
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Request was rejected because of invalid AuthToken.
        '403':
          description: Forbidden.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: The user does not have enough permission or possibly not an user of the respective organization to access the resource.
        '404':
          description: Invalid URL.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: The URL you've sent is wrong. It's possible that the resource you've requested has been moved to another URL.
        '405':
          description: Method Not Allowed.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: The requested resource does not support the HTTP method used. For example, requesting List of all customers API with PUT as the HTTP method.
        '406':
          description: Not Acceptable.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: The response has been received but the requested response type is not supported by the browser.
        '429':
          description: Too many requests.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Too many requests within a certain time frame.
        '500':
          description: Internal Server Error.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Cliq server encountered an error which prevents it from fulfilling the request.
      security:
        - Cliq_Auth:
            - ZohoCliq.Organisation.READ
      tags:
        - roles
    put:
      summary: Update permissions of a role
      operationId: Update permissions of a role
      description: |
        Use this API to update a role in your organization.
          <br><br> 
        <p>
          <b>Threshold limit</b>: 20 requests per min per user<br>
          Number of API calls allowed within a minute.<br><br>
          <b>Lock period</b>: 10 minutes<br>Wait time before consecutive API requests.<br>
        </p>
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateRoleRequest'
      responses:
        '200':
          description: The request was successfully completed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdatePermissionRequest'
        '400':
          description: Bad Request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: The request cannot be performed. Usually because of malformed parameter or missing parameter.
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Request was rejected because of invalid AuthToken.
        '403':
          description: Forbidden.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: The user does not have enough permission or possibly not an user of the respective organization to access the resource.
        '404':
          description: Invalid URL.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: The URL you've sent is wrong. It's possible that the resource you've requested has been moved to another URL.
        '405':
          description: Method Not Allowed.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: The requested resource does not support the HTTP method used. For example, requesting List of all customers API with PUT as the HTTP method.
        '406':
          description: Not Acceptable.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: The response has been received but the requested response type is not supported by the browser.
        '429':
          description: Too many requests.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Too many requests within a certain time frame.
        '500':
          description: Internal Server Error.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Cliq server encountered an error which prevents it from fulfilling the request.
      security:
        - Cliq_Auth:
            - ZohoCliq.Organisation.UPDATE
      tags:
        - roles
  /profiles/{PROFILE_ID}/users:
    get:
      summary: Get users in a role
      operationId: Get users in a role
      description: |
        Use this API to get all the users in a specific role.
          <br><br> 
        <p>
          <b>Threshold limit</b>: 20 requests per min per user<br>
          Number of API calls allowed within a minute.<br><br>
          <b>Lock period</b>: 10 minutes<br>Wait time before consecutive API requests.<br>
        </p>
      parameters:
        - name: PROFILE_ID
          in: path
          required: true
          description: Unique identifier of the role of which matched users need to be retrieved To learn how to retrieve this ID, see <a href="/cliq/help/restapi/v2/glossary/#PROFILE_ID">PROFILE_ID</a> in the Glossary page.
          schema:
            type: string
          example: PROFILE_ID
      responses:
        '200':
          description: The request was successfully completed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserIdsResponse'
        '400':
          description: Bad Request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: The request cannot be performed. Usually because of malformed parameter or missing parameter.
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Request was rejected because of invalid AuthToken.
        '403':
          description: Forbidden.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: The user does not have enough permission or possibly not an user of the respective organization to access the resource.
        '404':
          description: Invalid URL.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: The URL you've sent is wrong. It's possible that the resource you've requested has been moved to another URL.
        '405':
          description: Method Not Allowed.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: The requested resource does not support the HTTP method used. For example, requesting List of all customers API with PUT as the HTTP method.
        '406':
          description: Not Acceptable.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: The response has been received but the requested response type is not supported by the browser.
        '429':
          description: Too many requests.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Too many requests within a certain time frame.
        '500':
          description: Internal Server Error.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Cliq server encountered an error which prevents it from fulfilling the request.
      security:
        - Cliq_Auth:
            - ZohoCliq.Organisation.READ
      tags:
        - roles
    post:
      summary: Add users to a role
      operationId: Add users to a role
      description: |
        Use this API to add users to a specific role.
          <br><br> 
        <p>
          <b>Threshold limit</b>: 20 requests per min per user<br>
          Number of API calls allowed within a minute.<br><br>
          <b>Lock period</b>: 10 minutes<br>Wait time before consecutive API requests.<br>
        </p>
      parameters:
        - name: PROFILE_ID
          in: path
          required: true
          description: Unique identifier of the role for which users need to be added To learn how to retrieve this ID, see <a href="/cliq/help/restapi/v2/glossary/#PROFILE_ID">PROFILE_ID</a> in the Glossary page.
          schema:
            type: string
          example: PROFILE_ID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/addUsers'
      responses:
        '200':
          description: The request was successfully completed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/no-response'
        '400':
          description: Bad Request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: The request cannot be performed. Usually because of malformed parameter or missing parameter.
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Request was rejected because of invalid AuthToken.
        '403':
          description: Forbidden.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: The user does not have enough permission or possibly not an user of the respective organization to access the resource.
        '404':
          description: Invalid URL.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: The URL you've sent is wrong. It's possible that the resource you've requested has been moved to another URL.
        '405':
          description: Method Not Allowed.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: The requested resource does not support the HTTP method used. For example, requesting List of all customers API with PUT as the HTTP method.
        '406':
          description: Not Acceptable.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: The response has been received but the requested response type is not supported by the browser.
        '429':
          description: Too many requests.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Too many requests within a certain time frame.
        '500':
          description: Internal Server Error.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Cliq server encountered an error which prevents it from fulfilling the request.
      security:
        - Cliq_Auth:
            - ZohoCliq.Organisation.UPDATE
      tags:
        - roles
    delete:
      summary: Delete users from a role
      operationId: Delete users from a role
      description: |
        Use this API to delete users from a specific role.
          <br><br> 
        <p>
          <b>Threshold limit</b>: 20 requests per min per user<br>
          Number of API calls allowed within a minute.<br><br>
          <b>Lock period</b>: 10 minutes<br>Wait time before consecutive API requests.<br>
        </p>
      parameters:
        - name: PROFILE_ID
          in: path
          required: true
          description: Unique identifier of the role for which users need to be removed To learn how to retrieve this ID, see <a href="/cliq/help/restapi/v2/glossary/#PROFILE_ID">PROFILE_ID</a> in the Glossary page.
          schema:
            type: string
          example: PROFILE_ID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/addUsers'
      responses:
        '200':
          description: The request was successfully completed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/no-response'
        '400':
          description: Bad Request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: The request cannot be performed. Usually because of malformed parameter or missing parameter.
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Request was rejected because of invalid AuthToken.
        '403':
          description: Forbidden.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: The user does not have enough permission or possibly not an user of the respective organization to access the resource.
        '404':
          description: Invalid URL.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: The URL you've sent is wrong. It's possible that the resource you've requested has been moved to another URL.
        '405':
          description: Method Not Allowed.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: The requested resource does not support the HTTP method used. For example, requesting List of all customers API with PUT as the HTTP method.
        '406':
          description: Not Acceptable.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: The response has been received but the requested response type is not supported by the browser.
        '429':
          description: Too many requests.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Too many requests within a certain time frame.
        '500':
          description: Internal Server Error.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Cliq server encountered an error which prevents it from fulfilling the request.
      security:
        - Cliq_Auth:
            - ZohoCliq.Organisation.DELETE
      tags:
        - roles
components:
  schemas:
    no-response:
      type: object
      properties:
        Response Code:
          type: string
          description: HTTP response code indicating no response from the server.
          example: 204 No response
    addUsers:
      type: object
      description: Request body schema for adding or deleting users from a role.
      required:
        - user_ids
      properties:
        user_ids:
          type: array
          description: Array of user IDs to be added.
          items:
            type: string
            description: A unique identifier of a user to be added to the role.
          example:
            - '62913657'
            - '63569660'
            - '67580202'
    UserIdsResponse:
      type: object
      description: Response schema containing user IDs in a role.
      properties:
        data:
          type: array
          description: Array containing objects with user IDs.
          items:
            type: object
            properties:
              user_id:
                type: string
                description: Unique identifier of a user.
                example: '62913657'
      example:
        data:
          - user_id: '62913657'
          - user_id: '63569660'
          - user_id: '67580202'
    UpdatePermissionRequest:
      type: object
      description: Request body schema for updating role permissions.
      properties:
        list:
          type: array
          description: List of module permission updates to be applied.
          items:
            type: object
            properties:
              module:
                type: string
                description: Name of the module for which permissions are being updated.
                example: organisation_member
              action:
                type: string
                description: Specific action within the module to update.
                example: attachments
              status:
                type: string
                description: Status of the module action, e.g., enabled or disabled.
                example: disabled
              configs:
                type: array
                description: Optional array of configuration updates related to the module.
                items:
                  type: object
                  properties:
                    name:
                      type: string
                      description: Name of the configuration setting.
                      example: profile_based_restricted_reply_time_frame
                    value:
                      type: integer
                      description: Value for the configuration setting.
                      example: 345600000
      example:
        list:
          - module: organisation_member
            action: attachments
            status: disabled
          - module: direct_message
            configs:
              - name: profile_based_restricted_reply_time_frame
                value: 345600000
    UpdateRoleRequest:
      type: object
      description: Request body schema for updating role details.
      properties:
        name:
          type: string
          description: Updated name of the role.
          example: Product Marketing Manager
        description:
          type: string
          description: Updated description of the role.
          example: Role for users managing product marketing campaigns and strategies.
      required:
        - name
        - description
    RolePermissionResponse:
      type: object
      description: Response schema containing permissions of a role.
      properties:
        group_audio_call:
          type: object
          description: Permissions and status related to group audio calls.
          properties:
            is_admin_module:
              type: boolean
              description: Indicates if this module is admin-restricted.
              example: false
            status:
              type: string
              description: Current status of the module.
              example: enabled
            actions:
              type: object
              description: Actions available for the module with their status.
              properties:
                start:
                  type: string
                  description: Status of the 'start' action for the module.
                  example: enabled
      example:
        group_audio_call:
          is_admin_module: false
          status: enabled
          actions:
            start: enabled
    UserProfilesResponse:
      type: object
      description: Response schema containing user profiles (roles) in the organization.
      properties:
        data:
          type: array
          description: Array of user profiles.
          items:
            type: object
            properties:
              is_custom_admin:
                type: boolean
                description: Indicates whether the profile has custom admin privileges.
                example: false
              name:
                type: string
                description: Name of the profile.
                example: Admin
              creation_time:
                type: string
                format: date-time
                description: Timestamp when the profile was created.
                example: '2020-08-10T12:27:35+05:30'
              last_modified_time:
                type: string
                format: date-time
                description: Timestamp when the profile was last modified.
                example: '2020-08-10T12:27:35+05:30'
              organization_id:
                type: string
                description: ID of the organization to which the profile belongs.
                example: '62914174'
              is_default:
                type: boolean
                description: Indicates if this profile is a default profile.
                example: true
              profile_type:
                type: string
                description: Type of profile (e.g., Admin, Members).
                example: Admin
              id:
                type: string
                description: Unique ID of the profile.
                example: '42405000000004047'
              description:
                type: string
                description: Optional description of the profile.
                example: '123'
      example:
        data:
          - is_custom_admin: false
            name: Admin
            creation_time: '2020-08-10T12:27:35+05:30'
            last_modified_time: '2020-08-10T12:27:35+05:30'
            organization_id: '62914174'
            is_default: true
            profile_type: Admin
            id: '42405000000004047'
          - is_custom_admin: false
            name: Members
            creation_time: '2020-08-10T12:27:35+05:30'
            last_modified_time: '2020-08-10T12:27:35+05:30'
            organization_id: '62914174'
            is_default: true
            profile_type: Members
            id: '42405000000004049'
          - is_custom_admin: false
            name: Test Member
            creation_time: '2022-02-17T15:37:39+05:30'
            last_modified_time: '2022-02-17T15:37:39+05:30'
            organization_id: '62914174'
            is_default: false
            profile_type: Members
            id: '42405000000189003'
            description: '123'
    RoleCreationRequest:
      type: object
      description: Request body schema for creating a new role.
      required:
        - name
        - profile_type
      properties:
        name:
          type: string
          maxLength: 100
          description: Name of the role to be created.
          example: Marketing
        profile_type:
          type: string
          description: |
            Type of the role. Allowed values: <ul>
              <li><b>Members</b> - No admin access</li>
              <li><b>Cliq Admin</b> - Admin access without organization resource access</li>
              <li><b>Admin</b> - Full admin access</li>
            </ul>
          example: Cliq Admin
        user_ids:
          type: array
          description: Array of user IDs to be added to the created role.
          items:
            type: string
            description: A unique identifier of a user to add to the role.
          example:
            - '67579763'
        description:
          type: string
          description: Description of the role.
          example: Role for Marketing members
        clone_id:
          type: string
          description: Role ID from which permissions should be copied.
          example: '42405000000223003'
    RoleCreationResponse:
      type: object
      description: Response schema containing details of the created role.
      properties:
        data:
          type: object
          description: Details of the created role.
          properties:
            name:
              type: string
              description: Name of the created role.
              example: Marketing
            id:
              type: string
              description: Unique ID of the created role.
              example: 42405000000224000
            profile_type:
              type: string
              description: Type of the created role.
              example: Cliq Admin
            creation_time:
              type: string
              format: date-time
              description: Timestamp when the role was created.
              example: 2022-05-16T12:33:51.000Z
            last_modified_time:
              type: string
              format: date-time
              description: Timestamp when the role was last modified.
              example: 2022-05-16T12:33:51.000Z
            organization_id:
              type: string
              description: ID of the organization the role belongs to.
              example: 62914174
            is_default:
              type: boolean
              description: Indicates if the role is a default role.
              example: false
            description:
              type: string
              description: Description of the role.
              example: Role for Marketing members
            is_custom_admin:
              type: boolean
              description: Indicates if the role has custom admin privileges.
              example: true
    RoleDetailResponse:
      type: object
      description: Response schema containing detailed information about a specific role.
      properties:
        data:
          type: object
          description: Details of a specific role.
          properties:
            name:
              type: string
              description: Name of the role.
              example: Marketing
            id:
              type: string
              description: Unique ID of the role.
              example: '42405000000224001'
            profile_type:
              type: string
              description: Type of the role.
              example: Cliq Admin
            creation_time:
              type: string
              format: date-time
              description: Timestamp when the role was created.
              example: '2022-05-16T18:03:51+05:30'
            last_modified_time:
              type: string
              format: date-time
              description: Timestamp when the role was last modified.
              example: '2022-05-16T18:03:51+05:30'
            organization_id:
              type: string
              description: ID of the organization the role belongs to.
              example: '62914174'
            is_default:
              type: boolean
              description: Indicates if this role is a default role.
              example: false
            description:
              type: string
              description: Description of the role.
              example: Role for Marketing members
            is_custom_admin:
              type: boolean
              description: Indicates if this role has custom admin privileges.
              example: true
  securitySchemes:
    Cliq_Auth:
      type: oauth2
      x-authorization-example: Bearer 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f
      flows:
        implicit:
          authorizationUrl: https://accounts.zoho.com/oauth/v2/auth
          scopes:
            ZohoCliq.Organisation.CREATE: Add Roles in an Organization
            ZohoCliq.Organisation.UPDATE: Update Roles in an Organization
            ZohoCliq.Organisation.DELETE: Delete Roles in an Organization
            ZohoCliq.Organisation.READ: Read Roles in an Organization
