openapi: 3.0.0
info:
  title: Datastores
  version: '3.0'
  description: |
    Cliq Database serves as an ideal storage interface for building integrations on the Cliq Platform. It allows you to create, modify, store, and synchronize easily accessible data items. <br><br> You can access the Cliq Record APIs using the following OAuth scope: <ul>
      <li>OAuth Scope for Record APIs: ZohoCliq.Datastores.ALL , ZohoCliq.DatastoreRecords.ALL</li>
      <li>This scope provides basic CRUD (Create, Read, Update, Delete) access to the Record APIs.</li>
    </ul>
servers:
  - url: https://cliq.zoho.com/api/v3
    description: Zoho Cliq US DC
tags:
  - name: datastores
    description: Datastores
  - name: Platform_storage
    description: Manage Cliq Datastores - structured, schema-defined storage tables scoped to an organisation or extension. Datastores allow platform components to persist and query structured data across executions. Each datastore has typed fields and supports CRUD operations, field schema management, bulk record exports, and criteria-based queries.
paths:
  /datastores:
    post:
      summary: Create a datastore
      operationId: creating_datastores_for_an_org
      description: |
        Create a new Datastore for the organisation.<br><br>
        A Datastore is a structured storage table scoped to the organisation (or an extension) that allows platform components to persist and query data across executions.
        <br><br>
        <p>
          <b>Threshold limit</b>: 10 requests per min per user<br>
          Number of API calls allowed within a minute.<br><br>
          <b>Lock period</b>: 5 minutes<br>Wait time before consecutive API requests.<br>
        </p>
        <br><b>Possible Error Codes</b><br><br>
        <table style="border-collapse: collapse; width: 100%; font-family: inherit;">
          <tr>
            <th style="padding: 8px; text-align: center; border: 1px solid #ddd; font-family: inherit; min-width: 220px; word-break: break-word;">Error Code</th>
            <th style="padding: 8px; text-align: center; border: 1px solid #ddd; font-family: inherit;">Description</th>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_creation_limit_exceeded</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">The maximum number of datastores allowed for the organisation has been reached.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_name_already_exists</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">A datastore with the same name already exists in the organisation.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_invalid_creation_data</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">The request body contains invalid or malformed data for datastore creation.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_fields_required</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">At least one field definition must be provided to create a datastore.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_fields_invalid_value</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">One or more field definitions contain an invalid value.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_fields_limit_exceeded</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">The number of fields exceeds the maximum limit of 19 (plus the default record ID field).</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_fields_duplicate_column</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">Two or more fields share the same column name. Field names must be unique within a datastore.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_access_denied</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">The authenticated user does not have permission to create a datastore.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_unique_key_column_not_found</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">A field referenced in a unique key constraint does not exist in the datastore's field definitions.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_field_name_reserved</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">One or more field names use a reserved keyword that cannot be used as a field name.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_field_unique_key_not_supported</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">A field of type <code>encrypted-text</code> or <code>large-text</code> was included in a unique key constraint, which is not supported.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_field_mask_not_supported</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">Masking was specified for a field type that does not support it. Only <code>limited-text</code> and <code>number</code> fields support masking.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_invalid</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">The datastore data is invalid or in an unexpected state.</td>
          </tr>
        </table>
        <br><b>Error Response Format</b><br>
        <p style="font-family:inherit;">When an error occurs, the API returns a JSON response in this format:<br><br>
        <code>{"message": "A human-readable description of the error.", "code": "error_code"}</code><br><br>
        where <code>code</code> is the error identifier (as listed in the table above) and <code>message</code> is a human-readable explanation of what went wrong.</p>
      parameters: []
      requestBody:
        description: Creates a datastore. Provide `unique_name`, `name`, `description`, and at least one field definition.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/createplatformdatabase_v2'
        required: true
      responses:
        '200':
          description: Datastore created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DatastoreResponse'
              example:
                url: /api/v3/datastores
                type: datastore
                data:
                  unique_name: empdir
                  name: Employee Directory
                  id: '227828000000132001'
                  creator:
                    name: NP NTC
                    id: '119440882'
                  status: enabled
                  fields:
                    - default_value: ''
                      masked: false
                      name: Notes
                      unique_name: notes
                      type: large-text
                      mandatory: false
                      id: '17202020414617773604009000'
                    - default_value: '0'
                      masked: false
                      name: Employee ID
                      unique_name: empid
                      type: number
                      mandatory: true
                      id: '17202020414617773604009001'
                    - default_value: ''
                      masked: false
                      name: Employee Name
                      unique_name: empname
                      type: limited-text
                      mandatory: true
                      id: '17202020414617773604009002'
                    - default_value: 'true'
                      masked: false
                      name: Active Status
                      unique_name: isactive
                      type: boolean
                      mandatory: false
                      id: '17202020414617773604009003'
                  type: custom
                  description: V3 API test datastore
                  unique_keys:
                    - - empid
                  scope: personal
        '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:
            - Datastores.CREATE
      tags:
        - Platform_storage
    get:
      summary: List all datastores
      operationId: get_list_of_datastores
      description: |
        Retrieve a paginated list of all datastores defined for the organisation.
        <br><br>
        <p>
          <b>Threshold limit</b>: 30 requests per min per user<br>
          Number of API calls allowed within a minute.<br><br>
          <b>Lock period</b>: 5 minutes<br>Wait time before consecutive API requests.<br>
        </p>
        <br><b>Possible Error Codes</b><br><br>
        <table style="border-collapse: collapse; width: 100%; font-family: inherit;">
          <tr>
            <th style="padding: 8px; text-align: center; border: 1px solid #ddd; font-family: inherit; min-width: 220px; word-break: break-word;">Error Code</th>
            <th style="padding: 8px; text-align: center; border: 1px solid #ddd; font-family: inherit;">Description</th>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>bulk_record_update_failed</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">Failed to update one or more records.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>invalid_record_criteria</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">Criteria expression is invalid.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_not_found</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">Datastore with the given identifier does not exist.</td>
          </tr>
        </table>
        <br><b>Error Response Format</b><br>
        <p style="font-family:inherit;">When an error occurs, the API returns a JSON response in this format:<br><br>
        <code>{"message": "A human-readable description of the error.", "code": "error_code"}</code><br><br>
        where <code>code</code> is the error identifier (as listed in the table above) and <code>message</code> is a human-readable explanation of what went wrong.</p>
      parameters:
        - schema:
            description: ''
            $ref: '#/components/schemas/base64_regex'
          in: query
          name: sync_token
          description: |
            Return datastores modified after the given sync token. The sync token is returned in the response when fetching the list of datastores, and can be used to retrieve only datastores that were created or updated after that request.
          required: false
        - schema:
            description: ''
            type: integer
          in: query
          name: limit
          description: |
            Maximum number of datastores to return in the response. Default is 20, maximum allowed value is 100.
          required: false
        - schema:
            description: ''
            $ref: '#/components/schemas/base64_regex'
          in: query
          name: next_token
          description: |
            Token to retrieve the next page of results. This is returned in the response when the number of datastores exceeds the specified limit. To fetch the next page, include this token in the request.
          required: false
      responses:
        '200':
          description: List of datastores returned successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DatastoreResponse'
              example:
                url: /api/v3/datastores
                type: datastore
                sync_token: MTB8MTc3NzM2MDM5OTc0OXw=
                data:
                  - unique_name: empdir
                    name: Employee Directory
                    id: '227828000000132001'
                    creator:
                      name: NP NTC
                      id: '119440882'
                    status: enabled
                    fields:
                      - default_value: ''
                        masked: false
                        name: Notes
                        unique_name: notes
                        type: large-text
                        mandatory: false
                        id: '17202020414617773604009000'
                      - default_value: '0'
                        masked: false
                        name: Employee ID
                        unique_name: empid
                        type: number
                        mandatory: true
                        id: '17202020414617773604009001'
                      - default_value: ''
                        masked: false
                        name: Employee Name
                        unique_name: empname
                        type: limited-text
                        mandatory: true
                        id: '17202020414617773604009002'
                      - default_value: 'true'
                        masked: false
                        name: Active Status
                        unique_name: isactive
                        type: boolean
                        mandatory: false
                        id: '17202020414617773604009003'
                    type: custom
                    description: V3 API test datastore
                    unique_keys:
                      - - empid
                    scope: personal
        '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:
            - Datastores.READ
      tags:
        - Platform_storage
  /datastores/{DATASTORE_ID}:
    patch:
      summary: Edit a datastore
      operationId: edit_datastores
      description: |
        Update the metadata (name, description) of an existing datastore.
        <br><br>
        <p>
          <b>Threshold limit</b>: 10 requests per min per user<br>
          Number of API calls allowed within a minute.<br><br>
          <b>Lock period</b>: 5 minutes<br>Wait time before consecutive API requests.<br>
        </p>
        <br><b>Possible Error Codes</b><br><br>
        <table style="border-collapse: collapse; width: 100%; font-family: inherit;">
          <tr>
            <th style="padding: 8px; text-align: center; border: 1px solid #ddd; font-family: inherit; min-width: 220px; word-break: break-word;">Error Code</th>
            <th style="padding: 8px; text-align: center; border: 1px solid #ddd; font-family: inherit;">Description</th>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_not_found</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">Datastore with the given identifier does not exist.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_name_already_exists</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">A datastore with the same name already exists in the organisation.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_access_denied</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">The authenticated user does not have permission to edit this datastore.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_unique_key_column_not_found</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">A field referenced in a unique key constraint does not exist in the datastore's field definitions.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_field_unique_key_not_supported</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">A field of type <code>encrypted-text</code> or <code>large-text</code> was included in a unique key constraint, which is not supported.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_invalid</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">The datastore data is invalid or in an unexpected state.</td>
          </tr>
        </table>
        <br><b>Error Response Format</b><br>
        <p style="font-family:inherit;">When an error occurs, the API returns a JSON response in this format:<br><br>
        <code>{"message": "A human-readable description of the error.", "code": "error_code"}</code><br><br>
        where <code>code</code> is the error identifier (as listed in the table above) and <code>message</code> is a human-readable explanation of what went wrong.</p>
      parameters:
        - name: DATASTORE_ID
          in: path
          required: true
          description: Unique numeric identifier of the datastore. To learn how to retrieve this ID, see <a href="/cliq/help/restapi/v3/glossary/#LONG_ID">LONG_ID</a> in the Glossary page.
          schema:
            $ref: '#/components/schemas/longid_regex'
      requestBody:
        description: Updates datastore metadata. Send only fields to change, such as `name`, `description`, or `unique_keys`.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/editplatformdatabase_v2'
            example:
              unique_name: empdir
              name: Employee Directory
              description: Tracks employee records and department data
              unique_keys:
                - - empid
                  - empname
        required: true
      responses:
        '200':
          description: Datastore updated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DatastoreResponse'
              example:
                url: /api/v3/datastores/227828000000132001
                type: datastore
                data:
                  unique_name: empdir
                  name: Employee Directory
                  id: '227828000000132001'
                  creator:
                    name: NP NTC
                    id: '119440882'
                  status: enabled
                  fields:
                    - default_value: ''
                      masked: false
                      name: Department
                      unique_name: department
                      type: limited-text
                      mandatory: false
                      id: '17202020414617773604018030'
                    - default_value: ''
                      masked: false
                      name: Notes
                      unique_name: notes
                      type: large-text
                      mandatory: false
                      id: '17202020414617773604009000'
                    - default_value: '0'
                      masked: false
                      name: Salary
                      unique_name: salary
                      type: number
                      mandatory: false
                      id: '17202020414617773604018070'
                    - default_value: ''
                      masked: false
                      name: Employee Name
                      unique_name: empname
                      type: limited-text
                      mandatory: true
                      id: '17202020414617773604009002'
                    - default_value: '0'
                      masked: false
                      name: Employee ID
                      unique_name: empid
                      type: number
                      mandatory: true
                      id: '17202020414617773604009001'
                    - default_value: 'true'
                      masked: false
                      name: Active Status
                      unique_name: isactive
                      type: boolean
                      mandatory: false
                      id: '17202020414617773604009003'
                  type: custom
                  description: Tracks employee records and department data
                  unique_keys:
                    - - empid
                      - empname
                  scope: personal
        '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:
            - Datastores.UPDATE
      tags:
        - Platform_storage
    get:
      summary: Get a datastore
      operationId: get_a_datastores
      description: |
        Retrieve the metadata and field schema of a single datastore identified by its numeric ID. The response includes the datastore name, description, and the list of typed fields (columns) defined in the schema.
        <br><br>
        <p>
          <b>Threshold limit</b>: 30 requests per min per user<br>
          Number of API calls allowed within a minute.<br><br>
          <b>Lock period</b>: 5 minutes<br>Wait time before consecutive API requests.<br>
        </p>
        <br><b>Possible Error Codes</b><br><br>
        <table style="border-collapse: collapse; width: 100%; font-family: inherit;">
          <tr>
            <th style="padding: 8px; text-align: center; border: 1px solid #ddd; font-family: inherit; min-width: 220px; word-break: break-word;">Error Code</th>
            <th style="padding: 8px; text-align: center; border: 1px solid #ddd; font-family: inherit;">Description</th>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>record_not_found</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">Record with the given ID does not exist.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_not_found</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">Datastore with the given identifier does not exist.</td>
          </tr>
        </table>
        <br><b>Error Response Format</b><br>
        <p style="font-family:inherit;">When an error occurs, the API returns a JSON response in this format:<br><br>
        <code>{"message": "A human-readable description of the error.", "code": "error_code"}</code><br><br>
        where <code>code</code> is the error identifier (as listed in the table above) and <code>message</code> is a human-readable explanation of what went wrong.</p>
      parameters:
        - name: DATASTORE_ID
          in: path
          required: true
          description: Unique numeric identifier of the datastore. To learn how to retrieve this ID, see <a href="/cliq/help/restapi/v3/glossary/#LONG_ID">LONG_ID</a> in the Glossary page.
          schema:
            $ref: '#/components/schemas/longid_regex'
      responses:
        '200':
          description: Datastore details returned successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DatastoreResponse'
              example:
                url: /api/v3/datastores/227828000000132001
                type: datastore
                data:
                  unique_name: empdir
                  name: Employee Directory
                  id: '227828000000132001'
                  creator:
                    name: NP NTC
                    id: '119440882'
                  status: enabled
                  fields:
                    - default_value: ''
                      masked: false
                      name: Notes
                      unique_name: notes
                      type: large-text
                      mandatory: false
                      id: '17202020414617773604009000'
                    - default_value: '0'
                      masked: false
                      name: Employee ID
                      unique_name: empid
                      type: number
                      mandatory: true
                      id: '17202020414617773604009001'
                    - default_value: ''
                      masked: false
                      name: Employee Name
                      unique_name: empname
                      type: limited-text
                      mandatory: true
                      id: '17202020414617773604009002'
                    - default_value: 'true'
                      masked: false
                      name: Active Status
                      unique_name: isactive
                      type: boolean
                      mandatory: false
                      id: '17202020414617773604009003'
                  type: custom
                  description: V3 API test datastore
                  unique_keys:
                    - - empid
                  scope: personal
        '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:
            - Datastores.READ
      tags:
        - Platform_storage
    delete:
      summary: Delete a datastore
      operationId: delete_a_datastore
      description: |
        Permanently delete a datastore and all its stored records. This operation is irreversible, and all data in the datastore will be lost. Hence, ensure no active platform components depend on this datastore before deleting it.
        <br><br>
        <p>
          <b>Threshold limit</b>: 10 requests per min per user<br>
          Number of API calls allowed within a minute.<br><br>
          <b>Lock period</b>: 5 minutes<br>Wait time before consecutive API requests.<br>
        </p>
        <br><b>Possible Error Codes</b><br><br>
        <table style="border-collapse: collapse; width: 100%; font-family: inherit;">
          <tr>
            <th style="padding: 8px; text-align: center; border: 1px solid #ddd; font-family: inherit; min-width: 220px; word-break: break-word;">Error Code</th>
            <th style="padding: 8px; text-align: center; border: 1px solid #ddd; font-family: inherit;">Description</th>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_not_found</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">Datastore with the given identifier does not exist.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_access_denied</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">The authenticated user does not have permission to delete this datastore.</td>
          </tr>
        </table>
        <br><b>Error Response Format</b><br>
        <p style="font-family:inherit;">When an error occurs, the API returns a JSON response in this format:<br><br>
        <code>{"message": "A human-readable description of the error.", "code": "error_code"}</code><br><br>
        where <code>code</code> is the error identifier (as listed in the table above) and <code>message</code> is a human-readable explanation of what went wrong.</p>
      parameters:
        - name: DATASTORE_ID
          in: path
          required: true
          description: Unique numeric identifier of the datastore. To learn how to retrieve this ID, see <a href="/cliq/help/restapi/v3/glossary/#LONG_ID">LONG_ID</a> in the Glossary page.
          schema:
            $ref: '#/components/schemas/longid_regex'
      responses:
        '204':
          description: No Content. Datastore deleted successfully.
        '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:
            - Datastores.DELETE
      tags:
        - Platform_storage
  /datastores/{DATASTORE_ID}/fields:
    patch:
      summary: Edit datastore fields
      operationId: edit_datastore_fields
      description: |
        Update the existing fields (columns) in a datastore. The modifiable attributes include the field display name, type, and required field flag. The names of fields cannot be changed after they are created.
        <br><br>
        <p>
          <b>Threshold limit</b>: 10 requests per min per user<br>
          Number of API calls allowed within a minute.<br><br>
          <b>Lock period</b>: 5 minutes<br>Wait time before consecutive API requests.<br>
        </p>
        <br><b>Possible Error Codes</b><br><br>
        <table style="border-collapse: collapse; width: 100%; font-family: inherit;">
          <tr>
            <th style="padding: 8px; text-align: center; border: 1px solid #ddd; font-family: inherit; min-width: 220px; word-break: break-word;">Error Code</th>
            <th style="padding: 8px; text-align: center; border: 1px solid #ddd; font-family: inherit;">Description</th>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_not_found</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">Datastore with the given identifier does not exist.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_access_denied</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">The authenticated user does not have permission to modify this datastore.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_field_update_failed</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">Failed to update one or more datastore fields.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_field_not_found</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">A field with the given ID does not exist in this datastore.</td>
          </tr>
        </table>
        <br><b>Error Response Format</b><br>
        <p style="font-family:inherit;">When an error occurs, the API returns a JSON response in this format:<br><br>
        <code>{"message": "A human-readable description of the error.", "code": "error_code"}</code><br><br>
        where <code>code</code> is the error identifier (as listed in the table above) and <code>message</code> is a human-readable explanation of what went wrong.</p>
      parameters:
        - name: DATASTORE_ID
          in: path
          required: true
          description: |
            Unique numeric identifier of the datastore.<br>
            To learn how to retrieve this ID, see <a href="/cliq/help/restapi/v3/glossary/#DATASTORE_ID">DATASTORE_ID</a> in the Glossary page.
          schema:
            $ref: '#/components/schemas/longid_regex'
      requestBody:
        description: Updates existing datastore fields. Provide `fields` with each field `id` and the attributes to modify.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/edit_platform_db_fields'
            example:
              fields:
                - id: '17202020414617773604009000'
                  name: Employee Notes
                  mandatory: false
                - id: '17202020414617773604009003'
                  name: Is Active
                  mandatory: true
        required: true
      responses:
        '200':
          description: Datastore fields updated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DatastoreResponse'
              example:
                url: /api/v3/datastores/227828000000132001/fields
                type: datastore
                data:
                  unique_name: empdir
                  name: Employee Directory
                  id: '227828000000132001'
                  creator:
                    name: NP NTC
                    id: '119440882'
                  status: enabled
                  fields:
                    - default_value: ''
                      masked: false
                      name: Employee Notes
                      unique_name: notes
                      type: large-text
                      mandatory: false
                      id: '17202020414617773604009000'
                    - default_value: '0'
                      masked: false
                      name: Employee ID
                      unique_name: empid
                      type: number
                      mandatory: true
                      id: '17202020414617773604009001'
                    - default_value: ''
                      masked: false
                      name: Employee Name
                      unique_name: empname
                      type: limited-text
                      mandatory: true
                      id: '17202020414617773604009002'
                    - default_value: 'true'
                      masked: false
                      name: Is Active
                      unique_name: isactive
                      type: boolean
                      mandatory: true
                      id: '17202020414617773604009003'
                  type: custom
                  description: Tracks employee records and department data
                  unique_keys:
                    - - empid
                  scope: personal
        '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:
            - Datastores.UPDATE
      tags:
        - Platform_storage
    post:
      summary: Add fields to a datastore
      operationId: add_datastore_fields
      description: |
        Add one or more new fields (columns) to an existing datastore. Existing records will have null for newly added fields unless a default value is specified.
        <br><br>
        <p>
          <b>Threshold limit</b>: 10 requests per min per user<br>
          Number of API calls allowed within a minute.<br><br>
          <b>Lock period</b>: 5 minutes<br>Wait time before consecutive API requests.<br>
        </p>
        <br><b>Possible Error Codes</b><br><br>
        <table style="border-collapse: collapse; width: 100%; font-family: inherit;">
          <tr>
            <th style="padding: 8px; text-align: center; border: 1px solid #ddd; font-family: inherit; min-width: 220px; word-break: break-word;">Error Code</th>
            <th style="padding: 8px; text-align: center; border: 1px solid #ddd; font-family: inherit;">Description</th>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_not_found</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">Datastore with the given identifier does not exist.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_fields_invalid_value</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">One or more field definitions contain an invalid value.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_fields_limit_exceeded</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">The number of fields exceeds the maximum limit of 19 (plus the default record ID field).</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_fields_duplicate_column</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">Two or more fields in the request share the same column name.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_access_denied</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">The authenticated user does not have permission to modify this datastore.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_field_name_already_exists</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">A field with this unique name already exists in the datastore.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_field_name_reserved</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">One or more field names use a reserved keyword that cannot be used as a field name.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_field_mask_not_supported</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">Masking was specified for a field type that does not support it. Only <code>limited-text</code> and <code>number</code> fields support masking.</td>
          </tr>
        </table>
        <br><b>Error Response Format</b><br>
        <p style="font-family:inherit;">When an error occurs, the API returns a JSON response in this format:<br><br>
        <code>{"message": "A human-readable description of the error.", "code": "error_code"}</code><br><br>
        where <code>code</code> is the error identifier (as listed in the table above) and <code>message</code> is a human-readable explanation of what went wrong.</p>
      parameters:
        - name: DATASTORE_ID
          in: path
          required: true
          description: |
            Unique numeric identifier of the datastore.<br>
            To learn how to retrieve this ID, see <a href="/cliq/help/restapi/v3/glossary/#DATASTORE_ID">DATASTORE_ID</a> in the Glossary page.
          schema:
            $ref: '#/components/schemas/longid_regex'
      requestBody:
        description: Adds new datastore fields. Provide one or more field definitions in `fields`.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/add_platform_db_fields'
            example:
              fields:
                - unique_name: join_date
                  name: Join Date
                  type: limited-text
                  mandatory: false
                  default_value: ''
                - unique_name: location
                  name: Location
                  type: limited-text
                  mandatory: false
                  default_value: ''
        required: true
      responses:
        '200':
          description: Datastore fields added successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DatastoreResponse'
              example:
                url: /api/v3/datastores/227828000000132001/fields
                type: datastore
                data:
                  unique_name: empdir
                  name: Employee Directory
                  id: '227828000000132001'
                  creator:
                    name: NP NTC
                    id: '119440882'
                  status: enabled
                  fields:
                    - default_value: ''
                      masked: false
                      name: Notes
                      unique_name: notes
                      type: large-text
                      mandatory: false
                      id: '17202020414617773604009000'
                    - default_value: '0'
                      masked: false
                      name: Employee ID
                      unique_name: empid
                      type: number
                      mandatory: true
                      id: '17202020414617773604009001'
                    - default_value: ''
                      masked: false
                      name: Employee Name
                      unique_name: empname
                      type: limited-text
                      mandatory: true
                      id: '17202020414617773604009002'
                    - default_value: 'true'
                      masked: false
                      name: Active Status
                      unique_name: isactive
                      type: boolean
                      mandatory: false
                      id: '17202020414617773604009003'
                    - default_value: ''
                      masked: false
                      name: Join Date
                      unique_name: join_date
                      type: limited-text
                      mandatory: false
                      id: '17202020414617773604018031'
                    - default_value: ''
                      masked: false
                      name: Location
                      unique_name: location
                      type: limited-text
                      mandatory: false
                      id: '17202020414617773604018032'
                  type: custom
                  description: Tracks employee records and department data
                  unique_keys:
                    - - empid
                  scope: personal
        '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:
            - Datastores.UPDATE
      tags:
        - Platform_storage
    delete:
      summary: Delete fields of a datastore
      operationId: delete_datastore_fields
      description: |
        Remove one or more fields (columns) from a Datastore schema by providing the field IDs in the <code>ids</code> query parameter. All data stored in those fields will be permanently deleted. This action is irreversible.
        <br><br>
        <p>
          <b>Threshold limit</b>: 10 requests per min per user<br>
          Number of API calls allowed within a minute.<br><br>
          <b>Lock period</b>: 5 minutes<br>Wait time before consecutive API requests.<br>
        </p>
        <br><b>Possible Error Codes</b><br><br>
        <table style="border-collapse: collapse; width: 100%; font-family: inherit;">
          <tr>
            <th style="padding: 8px; text-align: center; border: 1px solid #ddd; font-family: inherit; min-width: 220px; word-break: break-word;">Error Code</th>
            <th style="padding: 8px; text-align: center; border: 1px solid #ddd; font-family: inherit;">Description</th>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_not_found</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">Datastore with the given identifier does not exist.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_column_not_found</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">A field with the given ID does not exist in this datastore.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_access_denied</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">The authenticated user does not have permission to modify this datastore.</td>
          </tr>
        </table>
        <br><b>Error Response Format</b><br>
        <p style="font-family:inherit;">When an error occurs, the API returns a JSON response in this format:<br><br>
        <code>{"message": "A human-readable description of the error.", "code": "error_code"}</code><br><br>
        where <code>code</code> is the error identifier (as listed in the table above) and <code>message</code> is a human-readable explanation of what went wrong.</p>
      parameters:
        - name: DATASTORE_ID
          in: path
          required: true
          description: |
            Unique numeric identifier of the datastore.<br>
            To learn how to retrieve this ID, see <a href="/cliq/help/restapi/v3/glossary/#DATASTORE_ID">DATASTORE_ID</a> in the Glossary page.
          schema:
            $ref: '#/components/schemas/longid_regex'
          example: '227828000000132001'
        - name: ids
          in: query
          required: true
          description: |
            Comma-separated list of field IDs to delete.
            To retrieve field IDs, use the Get Datastore Details API and refer to the <code>id</code> attribute of each field in the response.
            <br><b>Maximum number of fields that can be deleted in a single request is 10</b>
          schema:
            type: string
          example: '1720202009000'
      responses:
        '204':
          description: No Content. Datastore fields deleted successfully.
        '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:
            - Datastores.UPDATE
      tags:
        - Platform_storage
  /datastores/{DATASTORE_UNIQUE_NAME}/records:
    patch:
      summary: Bulk update records in a datastore
      operationId: update_records_in_storage
      description: |
        Update multiple records in a datastore with a single request. Identify target records by specifying record IDs or a criteria expression in the request body.
        <br><br>
        <blockquote><b>Note</b>: To manage records of a datastore bundled with an extension, use the extension-scoped endpoint instead:<br><code>v3/extensions/{EXTENSION_ID}/datastores/{DATASTORE_UNIQUE_NAME}/records</code><br>and pass the <code>EXTENSION_KEY</code> as a query parameter.</blockquote>
        <br><br>
        <p>
          <b>Threshold limit</b>: 30 requests per min per user<br>
          Number of API calls allowed within a minute.<br><br>
          <b>Lock period</b>: 5 minutes<br>Wait time before consecutive API requests.<br>
        </p>
        <br><b>Possible Error Codes</b><br><br>
        <table style="border-collapse: collapse; width: 100%; font-family: inherit;">
          <tr>
            <th style="padding: 8px; text-align: center; border: 1px solid #ddd; font-family: inherit; min-width: 220px; word-break: break-word;">Error Code</th>
            <th style="padding: 8px; text-align: center; border: 1px solid #ddd; font-family: inherit;">Description</th>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_not_found</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">Datastore with the given identifier does not exist.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_invalid_criteria</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">The criteria expression provided is invalid or malformed.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_criteria_invalid_operator</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">The criteria expression uses an invalid or unsupported operator.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_criteria_limit_exceeded</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">The number of conditions in the criteria expression exceeds the allowed limit.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_column_not_found</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">A field key in <code>values</code> or <code>criteria</code> does not match any field <code>unique_name</code> in this datastore.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_update_violates_unique_key</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">The update would violate a unique key constraint defined on the datastore.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_access_denied</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">The authenticated user does not have permission to update records in this datastore.</td>
          </tr>
        </table>
        <br><b>Error Response Format</b><br>
        <p style="font-family:inherit;">When an error occurs, the API returns a JSON response in this format:<br><br>
        <code>{"message": "A human-readable description of the error.", "code": "error_code"}</code><br><br>
        where <code>code</code> is the error identifier (as listed in the table above) and <code>message</code> is a human-readable explanation of what went wrong.</p>
      parameters:
        - name: DATASTORE_UNIQUE_NAME
          in: path
          required: true
          description: |
            Unique name of the datastore.<br>
            To learn how to retrieve this, see <a href="/cliq/help/restapi/v3/glossary/#DATABASE_UNIQUE_NAME">DATABASE_UNIQUE_NAME</a> in the Glossary page.'
          schema:
            type: string
            example: employee_data
        - name: EXTENSION_KEY
          in: query
          required: false
          description: |
            Unique key of the extension that the datastore belongs to. Required if the datastore is owned by an extension. To learn how to retrieve this, see <a href="/cliq/help/restapi/v3/glossary/#EXTENSION_KEY">EXTENSION_KEY</a> in the Glossary
          schema:
            type: string
      requestBody:
        description: |
          Bulk-updates matching records. Provide a `criteria` expression to select records and `values` with the field updates to apply.
        content:
          application/json:
            schema:
              type: object
              required:
                - criteria
                - values
              properties:
                values:
                  type: object
                  description: |
                    Key-value pairs of field unique_name and the new value to update.
                  additionalProperties: true
                  example:
                    isactive: false
                    empname: John Doe
                    notes: Moved to inactive status
                criteria:
                  type: string
                  description: |
                    Expression to select records for bulk update. Use field <code>unique_name</code>s as keys. Supported comparison operators: <code>=</code>, <code>==</code>, <code>!=</code>, <code>&gt;</code>, <code>&gt;=</code>, <code>&lt;</code>, <code>&lt;=</code>, <code>like</code>, <code>not like</code>, <code>in</code> (max 10 values), <code>not in</code> (max 10 values). Combine conditions with <code>&&</code> (AND) or <code>||</code> (OR), and use parentheses for grouping. Max 10 clauses.<br>
                  example: (department==Engineering) && (isactive==true)
      responses:
        '204':
          description: No Content. Records updated successfully.
        '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:
            - DatastoreRecords.UPDATE
      tags:
        - Platform_storage
    post:
      summary: Add records to a datastore
      operationId: insert_record_in_storage
      description: |
        Insert a record into a datastore.
        <br><br>
        <blockquote><b>Note</b>: To manage records of a datastore bundled with an extension, use the extension-scoped endpoint instead:<br><code>v3/extensions/{EXTENSION_ID}/datastores/{DATASTORE_UNIQUE_NAME}/records</code><br>and pass the <code>EXTENSION_KEY</code> as a query parameter.</blockquote>
        <br><br>
        <p>
          <b>Threshold limit</b>: 30 requests per min per user<br>
          Number of API calls allowed within a minute.<br><br>
          <b>Lock period</b>: 5 minutes<br>Wait time before consecutive API requests.<br>
        </p>
        <br><b>Possible Error Codes</b><br><br>
        <table style="border-collapse: collapse; width: 100%; font-family: inherit;">
          <tr>
            <th style="padding: 8px; text-align: center; border: 1px solid #ddd; font-family: inherit; min-width: 220px; word-break: break-word;">Error Code</th>
            <th style="padding: 8px; text-align: center; border: 1px solid #ddd; font-family: inherit;">Description</th>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_not_found</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">Datastore with the given identifier does not exist.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_data_limit_exceeded</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">The record data exceeds the maximum allowed size (max 20 fields, each value up to 1000 characters, total max 2500 bytes).</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_column_not_found</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">A field key in <code>values</code> does not match any field unique_name in this datastore.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_invalid_number_value</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">A value provided for a number-type field is not a valid number.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_access_denied</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">The authenticated user does not have permission to insert records into this datastore.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_unique_key_violation</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">The record violates a unique key constraint defined on the datastore.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_required_field_missing</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">A mandatory field was not provided in the request.</td>
          </tr>
        </table>
        <br><b>Error Response Format</b><br>
        <p style="font-family:inherit;">When an error occurs, the API returns a JSON response in this format:<br><br>
        <code>{"message": "A human-readable description of the error.", "code": "error_code"}</code><br><br>
        where <code>code</code> is the error identifier (as listed in the table above) and <code>message</code> is a human-readable explanation of what went wrong.</p>
      parameters:
        - name: DATASTORE_UNIQUE_NAME
          in: path
          required: true
          description: Unique name of the datastore. To learn how to retrieve this, see <a href="/cliq/help/restapi/v3/glossary/#DATABASE_UNIQUE_NAME">DATABASE_UNIQUE_NAME</a> in the Glossary page.
          schema:
            type: string
            example: employee_data
        - name: EXTENSION_KEY
          in: query
          required: false
          description: Encrypted app ID. Required if the target datastore is owned by an extension.
          schema:
            $ref: '#/components/schemas/encryptedappkey_regex'
      requestBody:
        description: |
          Inserts a single record into the datastore. Provide field values as key-value pairs in the `values` object, where each key is a field `unique_name` from the datastore schema.
          <br><br>
          <table style="border-collapse: collapse; width: 100%; font-family: inherit;">
            <tr>
              <th style="padding: 8px; text-align: center; border: 1px solid #ddd;">Field</th>
              <th style="padding: 8px; text-align: center; border: 1px solid #ddd;">Type</th>
              <th style="padding: 8px; text-align: center; border: 1px solid #ddd;">Required</th>
              <th style="padding: 8px; text-align: center; border: 1px solid #ddd;">Constraints</th>
              <th style="padding: 8px; text-align: center; border: 1px solid #ddd;">Description</th>
            </tr>
            <tr>
              <td style="padding: 8px; border: 1px solid #ddd;"><code>values</code></td>
              <td style="padding: 8px; border: 1px solid #ddd;">JSONObject</td>
              <td style="padding: 8px; border: 1px solid #ddd;">Yes</td>
              <td style="padding: 8px; border: 1px solid #ddd;">Max 20 keys; each value max 1000 chars; total max 2500 bytes</td>
              <td style="padding: 8px; border: 1px solid #ddd;">Key-value pairs where keys are field <code>unique_name</code>s defined in the datastore schema.</td>
            </tr>
          </table>
        content:
          application/json:
            schema:
              type: object
              required:
                - values
              properties:
                values:
                  type: object
                  description: |
                    Key-value pairs representing field data for the new record.<br>
                    Keys must match the <code>unique_name</code> of fields defined in the datastore schema. Values must conform to the field type (e.g. string, number, boolean) and respect the datastore's constraints.<br>
                    <br>
                    <b>Datastore constraints:</b><br>
                    <ul>
                      <li>Maximum 20 fields per record</li>
                      <li>Each value can be up to 1000 characters</li>
                      
                    </ul>
                  additionalProperties: true
                  example:
                    empname: John Doe
                    empid: 1001
                    isactive: true
                    notes: Senior Engineer in Platform Team
        required: true
      responses:
        '200':
          description: Record inserted successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  url:
                    type: string
                    example: /api/v3/datastores/empdir/records
                  type:
                    type: string
                    example: datastore_record
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        example: '227828000000128010'
                      empname:
                        type: string
                        example: John Doe
                      empid:
                        type: string
                        example: '1001'
                      isactive:
                        type: boolean
                        example: true
                      notes:
                        type: string
                        example: Senior Engineer in Platform Team
                      added_time:
                        type: string
                        example: '1777360402254'
                      modified_time:
                        type: string
                        example: '1777360402254'
              example:
                url: /api/v3/datastores/empdir/records
                type: datastore_record
                data:
                  modified_time: '1777360402254'
                  empid: '1001'
                  isactive: true
                  id: '227828000000128010'
                  empname: John Doe
                  added_time: '1777360402254'
                  notes: Senior Engineer in Platform Team
        '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:
            - DatastoreRecords.CREATE
      tags:
        - Platform_storage
    get:
      summary: List records from a datastore
      operationId: get_records
      description: |
        Retrieve records from a datastore with optional filtering, sorting, and pagination.
        <ul>
          <li>Use the <code>criteria</code> query parameter to filter records based on field values (e.g. <code>(empname=John) && (isactive=true)</code>).</li>
          <li>Use the <code>sync_token</code> parameter to retrieve records modified before a certain point in time, or the <code>next_token</code> parameter for records modified after a certain point in time. This is useful for incremental synchronization.</li>
          <li>Use the <code>order_by</code> parameter to sort results by specific fields.</li>
          <li>Use the <code>limit</code> parameter to restrict the number of records returned.</li>
        </ul>
        <blockquote><b>Note</b>: To manage records of a datastore bundled with an extension, use the extension-scoped endpoint instead:<br><code>v3/extensions/{EXTENSION_ID}/datastores/{DATASTORE_UNIQUE_NAME}/records</code><br>and pass the <code>EXTENSION_KEY</code> as a query parameter.</blockquote>
        <br><br>
        <p>
          <b>Threshold limit</b>: 30 requests per min per user<br>
          Number of API calls allowed within a minute.<br><br>
          <b>Lock period</b>: 5 minutes<br>Wait time before consecutive API requests.<br>
        </p>
        <br><b>Possible Error Codes</b><br><br>
        <table style="border-collapse: collapse; width: 100%; font-family: inherit;">
          <tr>
            <th style="padding: 8px; text-align: center; border: 1px solid #ddd; font-family: inherit; min-width: 220px; word-break: break-word;">Error Code</th>
            <th style="padding: 8px; text-align: center; border: 1px solid #ddd; font-family: inherit;">Description</th>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_not_found</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">Datastore with the given identifier does not exist.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_invalid_criteria</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">The criteria expression provided is invalid or malformed.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_criteria_invalid_operator</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">The criteria expression uses an invalid or unsupported operator.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_criteria_limit_exceeded</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">The number of conditions in the criteria expression exceeds the allowed limit.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_column_not_found</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">A field used in the criteria does not exist in this datastore.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_invalid_next_token</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">The <code>next_token</code> value provided is invalid or expired.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_invalid_number_value</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">A value used in the criteria for a number-type field is not a valid number.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_in_query_limit_exceeded</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">The number of values in an <code>in</code> query exceeds the allowed limit.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_duplicate_sort_field</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">The same field was specified more than once in the <code>order_by</code> parameter.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_access_denied</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">The authenticated user does not have permission to read records from this datastore.</td>
          </tr>
        </table>
        <br><b>Error Response Format</b><br>
        <p style="font-family:inherit;">When an error occurs, the API returns a JSON response in this format:<br><br>
        <code>{"message": "A human-readable description of the error.", "code": "error_code"}</code><br><br>
        where <code>code</code> is the error identifier (as listed in the table above) and <code>message</code> is a human-readable explanation of what went wrong.</p>
      parameters:
        - name: DATASTORE_UNIQUE_NAME
          in: path
          required: true
          description: |
            Unique name of the datastore.<br>
            To learn how to retrieve this, see <a href="/cliq/help/restapi/v3/glossary/#DATABASE_UNIQUE_NAME">DATABASE_UNIQUE_NAME</a> in the Glossary page.
          schema:
            type: string
            example: employee_data
        - name: criteria
          in: query
          required: false
          description: |
            Expression to filter records. Use field <code>unique_name</code>s as keys. Wrap each condition in parentheses and combine with <code>&&</code> / <code>||</code>.<br>
            Example: <code>(empname=John) && (isactive=true)</code>
            <br>
            <br><b>Supported Comparison Operators</b><br><br>
            <table style="border-collapse: collapse; width: 100%; font-family: inherit;">
              <tr>
                <th style="padding: 8px; text-align: center; border: 1px solid #ddd; font-family: inherit;">Operator</th>
                <th style="padding: 8px; text-align: center; border: 1px solid #ddd; font-family: inherit;">Meaning</th>
                <th style="padding: 8px; text-align: center; border: 1px solid #ddd; font-family: inherit;">Notes</th>
              </tr>
              <tr>
                <td style="padding: 8px; border: 1px solid #ddd;"><code>=</code></td>
                <td style="padding: 8px; border: 1px solid #ddd;">Equal</td>
                <td style="padding: 8px; border: 1px solid #ddd;"></td>
              </tr>
              <tr>
                <td style="padding: 8px; border: 1px solid #ddd;"><code>==</code></td>
                <td style="padding: 8px; border: 1px solid #ddd;">Equal</td>
                <td style="padding: 8px; border: 1px solid #ddd;">Alias for <code>=</code></td>
              </tr>
              <tr>
                <td style="padding: 8px; border: 1px solid #ddd;"><code>!=</code></td>
                <td style="padding: 8px; border: 1px solid #ddd;">Not Equal</td>
                <td style="padding: 8px; border: 1px solid #ddd;"></td>
              </tr>
              <tr>
                <td style="padding: 8px; border: 1px solid #ddd;"><code>&gt;</code></td>
                <td style="padding: 8px; border: 1px solid #ddd;">Greater Than</td>
                <td style="padding: 8px; border: 1px solid #ddd;"></td>
              </tr>
              <tr>
                <td style="padding: 8px; border: 1px solid #ddd;"><code>&gt;=</code></td>
                <td style="padding: 8px; border: 1px solid #ddd;">Greater Than or Equal</td>
                <td style="padding: 8px; border: 1px solid #ddd;"></td>
              </tr>
              <tr>
                <td style="padding: 8px; border: 1px solid #ddd;"><code>&lt;</code></td>
                <td style="padding: 8px; border: 1px solid #ddd;">Less Than</td>
                <td style="padding: 8px; border: 1px solid #ddd;"></td>
              </tr>
              <tr>
                <td style="padding: 8px; border: 1px solid #ddd;"><code>&lt;=</code></td>
                <td style="padding: 8px; border: 1px solid #ddd;">Less Than or Equal</td>
                <td style="padding: 8px; border: 1px solid #ddd;"></td>
              </tr>
              <tr>
                <td style="padding: 8px; border: 1px solid #ddd;"><code>like</code></td>
                <td style="padding: 8px; border: 1px solid #ddd;">Like (pattern match)</td>
                <td style="padding: 8px; border: 1px solid #ddd;">Case-insensitive, only for CHAR fields</td>
              </tr>
              <tr>
                <td style="padding: 8px; border: 1px solid #ddd;"><code>not like</code></td>
                <td style="padding: 8px; border: 1px solid #ddd;">Not Like</td>
                <td style="padding: 8px; border: 1px solid #ddd;">Case-insensitive, only for CHAR fields</td>
              </tr>
              <tr>
                <td style="padding: 8px; border: 1px solid #ddd;"><code>in</code></td>
                <td style="padding: 8px; border: 1px solid #ddd;">In (multi-value)</td>
                <td style="padding: 8px; border: 1px solid #ddd;">Comma-separated values, max <b>10</b> values</td>
              </tr>
              <tr>
                <td style="padding: 8px; border: 1px solid #ddd;"><code>not in</code></td>
                <td style="padding: 8px; border: 1px solid #ddd;">Not In</td>
                <td style="padding: 8px; border: 1px solid #ddd;">Comma-separated values, max <b>10</b> values</td>
              </tr>
            </table>
            <br><b>Logical Operators (for combining criteria)</b><br><br>
            <table style="border-collapse: collapse; width: 100%; font-family: inherit;">
              <tr>
                <th style="padding: 8px; text-align: center; border: 1px solid #ddd; font-family: inherit;">Operator</th>
                <th style="padding: 8px; text-align: center; border: 1px solid #ddd; font-family: inherit;">Meaning</th>
              </tr>
              <tr>
                <td style="padding: 8px; border: 1px solid #ddd;"><code>&&</code></td>
                <td style="padding: 8px; border: 1px solid #ddd;">AND</td>
              </tr>
              <tr>
                <td style="padding: 8px; border: 1px solid #ddd;"><code>||</code></td>
                <td style="padding: 8px; border: 1px solid #ddd;">OR</td>
              </tr>
              <tr>
                <td style="padding: 8px; border: 1px solid #ddd;"><code>( )</code></td>
                <td style="padding: 8px; border: 1px solid #ddd;">Grouping / parentheses for precedence</td>
              </tr>
            </table>
            <br><b>AND</b> has higher priority than <b>OR</b> (standard precedence).<br>
            <br><b>Limits</b>
            <ul>
              <li><b>Max criteria clauses</b>: 10 (combined with <code>&&</code> / <code>||</code>)</li>
              <li><b>Max values in <code>in</code> / <code>not in</code></b>: 10</li>
            </ul>
          schema:
            type: string
        - name: limit
          in: query
          required: false
          description: |
            Maximum number of records to return.<br>
            <b>Default</b>: 50<br>
            <b>Maximum</b>: 100<br>
          schema:
            type: integer
            minimum: 1
            maximum: 1000
            default: 100
        - name: order_by
          in: query
          required: false
          description: |
            Comma-separated list of fields to sort by, with optional sort direction (asc or desc).<br>
            If sort direction is not specified, ascending order is used by default.<br>
            Example: <code>empname desc, empid asc</code><br>
            <b>Example syntax</b>: +timestamp (e.g. <code>+1777360402254</code>) to get records modified before the specified timestamp, or -age (e.g. <code>-3600000</code>) to get records modified within the last hour.
          schema:
            type: string
        - name: sync_token
          in: query
          required: false
          description: |
            Token to retrieve records modified before a certain point in time. This is useful for incremental synchronization. The token value should be the <code>sync_token</code> returned in a previous response, which encodes a timestamp. Records modified before that timestamp will be returned.<br>
          schema:
            type: string
        - name: next_token
          in: query
          required: false
          description: |
            Token to retrieve records modified after a certain point in time. This is useful for incremental synchronization. The token value should be the <code>sync_token</code> returned in a previous response, which encodes a timestamp. Records modified after that timestamp will be returned.
          schema:
            type: string
        - name: EXTENSION_KEY
          in: query
          required: false
          description: |
            Unique key of the extension that the datastore belongs to. Required if the datastore is owned by an extension. To learn how to retrieve this, see <a href="/cliq/help/restapi/v3/glossary/#EXTENSION_KEY">EXTENSION_KEY</a> in the Glossary page.
          schema:
            type: string
      responses:
        '200':
          description: Records returned successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/listrecords_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:
            - DatastoreRecords.READ
      tags:
        - Platform_storage
    delete:
      summary: Delete records from a datastore
      operationId: delete_records_of_given_ids_in
      description: |
        Delete one or more records from a datastore. Specify the records to delete by providing comma-separated record <code>ids</code> in the query string, or by providing a <code>criteria</code> expression to match records. Deletions are irreversible.
        <br><br>
        <blockquote><b>Note</b>: To manage records of a datastore bundled with an extension, use the extension-scoped endpoint instead:<br><code>v3/extensions/{EXTENSION_ID}/datastores/{DATASTORE_UNIQUE_NAME}/records</code><br>and pass the <code>EXTENSION_KEY</code> as a query parameter.</blockquote>
        <br><br>
        <p>
          <b>Threshold limit</b>: 30 requests per min per user<br>
          Number of API calls allowed within a minute.<br><br>
          <b>Lock period</b>: 5 minutes<br>Wait time before consecutive API requests.<br>
        </p>
      parameters:
        - name: DATASTORE_UNIQUE_NAME
          in: path
          required: true
          description: Unique name of the datastore. To learn how to retrieve this, see <a href="/cliq/help/restapi/v3/glossary/#DATABASE_UNIQUE_NAME">DATABASE_UNIQUE_NAME</a> in the Glossary page.
          schema:
            type: string
            example: employee_data
        - schema:
            description: ''
            type: string
          in: query
          name: criteria
          description: |
            Expression to select records for bulk deletion. Use field <code>unique_name</code>s as keys. Supported comparison operators: <code>=</code>, <code>==</code>, <code>!=</code>, <code>&gt;</code>, <code>&gt;=</code>, <code>&lt;</code>, <code>&lt;=</code>, <code>like</code>, <code>not like</code>, <code>in</code> (max 10 values), <code>not in</code> (max 10 values). Combine conditions with <code>&&</code> (AND) or <code>||</code> (OR), and use parentheses for grouping. Max 10 clauses.
          required: false
        - schema:
            description: ''
            $ref: '#/components/schemas/multiplelong_regex'
          in: query
          name: ids
          description: ids of the records to be deleted
          required: false
        - schema:
            description: ''
            $ref: '#/components/schemas/encryptedappkey_regex'
          in: query
          name: EXTENSION_KEY
          description: Encrypted app id
          required: false
      responses:
        '204':
          description: No Content. Records deleted successfully.
        '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:
            - DatastoreRecords.DELETE
      tags:
        - Platform_storage
  /datastores/{DATASTORE_UNIQUE_NAME}/records/{RECORD_ID}:
    patch:
      summary: Update a record in a datastore
      operationId: update_a_record_in_storage
      description: |
        Update a single record in a datastore.
        <br><br>
        <blockquote><b>Note</b>: To manage records of a datastore bundled with an extension, use the extension-scoped endpoint instead:<br><code>v3/extensions/{EXTENSION_ID}/datastores/{DATASTORE_UNIQUE_NAME}/records/{RECORD_ID}</code><br>and pass the <code>EXTENSION_KEY</code> as a query parameter.</blockquote>
        <p>
          <b>Threshold limit</b>: 30 requests per min per user<br>
          Number of API calls allowed within a minute.<br><br>
          <b>Lock period</b>: 5 minutes<br>Wait time before consecutive API requests.<br>
        </p>
        <br><b>Possible Error Codes</b><br><br>
        <table style="border-collapse: collapse; width: 100%; font-family: inherit;">
          <tr>
            <th style="padding: 8px; text-align: center; border: 1px solid #ddd; font-family: inherit; min-width: 220px; word-break: break-word;">Error Code</th>
            <th style="padding: 8px; text-align: center; border: 1px solid #ddd; font-family: inherit;">Description</th>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_record_not_found</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">The record with the given ID does not exist in this datastore.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_not_found</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">Datastore with the given identifier does not exist.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_column_not_found</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">A field key in <code>values</code> does not match any field <code>unique_name</code> in this datastore.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_update_violates_unique_key</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">The update would violate a unique key constraint defined on the datastore.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_invalid_number_value</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">A value provided for a number-type field is not a valid number.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_access_denied</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">The authenticated user does not have permission to update records in this datastore.</td>
          </tr>
        </table>
        <br><b>Error Response Format</b><br>
        <p style="font-family:inherit;">When an error occurs, the API returns a JSON response in this format:<br><br>
        <code>{"message": "A human-readable description of the error.", "code": "error_code"}</code><br><br>
        where <code>code</code> is the error identifier (as listed in the table above) and <code>message</code> is a human-readable explanation of what went wrong.</p>
      parameters:
        - name: DATASTORE_UNIQUE_NAME
          in: path
          required: true
          description: Unique name of the datastore. To learn how to retrieve this, see <a href="/cliq/help/restapi/v3/glossary/#DATABASE_UNIQUE_NAME">DATABASE_UNIQUE_NAME</a> in the Glossary page.
          schema:
            type: string
            example: employee_data
        - name: RECORD_ID
          in: path
          required: true
          description: |
            Unique numeric identifier of the record to update.<br>
            To learn how to retrieve this, see <a href="/cliq/help/restapi/v3/glossary/#RECORD_ID">RECORD_ID</a> in the Glossary page.
          schema:
            $ref: '#/components/schemas/longid_regex'
          example: RECORD_ID
        - name: EXTENSION_KEY
          in: query
          required: false
          description: |
            Unique key of the extension that the datastore belongs to. Required if the datastore is owned by an extension.<br>
            To learn how to retrieve this, see <a href="/cliq/help/restapi/v3/glossary/#EXTENSION_KEY">EXTENSION_KEY</a> in the Glossary page.
          schema:
            type: string
      requestBody:
        description: Updates a single record by ID. Provide only the field values to modify in `values`.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/datastores_records_add'
        required: true
      responses:
        '200':
          description: Record updated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/updaterecord_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:
            - DatastoreRecords.UPDATE
      tags:
        - Platform_storage
    get:
      summary: Get a record from a datastore
      operationId: get_a_record
      description: |
        Retrieve a single record from a datastore.
        <br><br>
        <blockquote><b>Note</b>: To manage records of a datastore bundled with an extension, use the extension-scoped endpoint instead:<br><code>v3/extensions/{EXTENSION_ID}/datastores/{DATASTORE_UNIQUE_NAME}/records/{RECORD_ID}</code><br>and pass the <code>EXTENSION_KEY</code> as a query parameter.</blockquote>
        <br><br>
        <p>
          <b>Threshold limit</b>: 30 requests per min per user<br>
          Number of API calls allowed within a minute.<br><br>
          <b>Lock period</b>: 5 minutes<br>Wait time before consecutive API requests.<br>
        </p>
        <br><b>Possible Error Codes</b><br><br>
        <table style="border-collapse: collapse; width: 100%; font-family: inherit;">
          <tr>
            <th style="padding: 8px; text-align: center; border: 1px solid #ddd; font-family: inherit; min-width: 220px; word-break: break-word;">Error Code</th>
            <th style="padding: 8px; text-align: center; border: 1px solid #ddd; font-family: inherit;">Description</th>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_record_not_found</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">The record with the given ID does not exist in this datastore.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_not_found</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">Datastore with the given identifier does not exist.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_access_denied</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">The authenticated user does not have permission to read records from this datastore.</td>
          </tr>
        </table>
        <br><b>Error Response Format</b><br>
        <p style="font-family:inherit;">When an error occurs, the API returns a JSON response in this format:<br><br>
        <code>{"message": "A human-readable description of the error.", "code": "error_code"}</code><br><br>
        where <code>code</code> is the error identifier (as listed in the table above) and <code>message</code> is a human-readable explanation of what went wrong.</p>
      parameters:
        - name: DATASTORE_UNIQUE_NAME
          in: path
          required: true
          description: Unique name of the datastore. To learn how to retrieve this, see <a href="/cliq/help/restapi/v3/glossary/#DATABASE_UNIQUE_NAME">DATABASE_UNIQUE_NAME</a> in the Glossary page.
          schema:
            type: string
            example: employee_data
        - name: RECORD_ID
          in: path
          required: true
          description: |
            Unique numeric identifier of the record to retrieve.<br>
            To learn how to retrieve this, see <a href="/cliq/help/restapi/v3/glossary/#RECORD_ID">RECORD_ID</a> in the Glossary page.
          schema:
            $ref: '#/components/schemas/longid_regex'
          example: RECORD_ID
        - name: EXTENSION_KEY
          in: query
          required: false
          description: |
            Unique key of the extension that the datastore belongs to. Required if the datastore is owned by  an extension.<br>
            To learn how to retrieve this, see <a href="/cliq/help/restapi/v3/glossary/#EXTENSION_KEY">EXTENSION_KEY</a> in the Glossary page.
          schema:
            type: string
      responses:
        '200':
          description: Record returned successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/updaterecord_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:
            - DatastoreRecords.READ
      tags:
        - Platform_storage
    delete:
      summary: Delete a record from a datastore
      operationId: delete_a_record_in_storage
      description: |
        Permanently delete a single record from a datastore.
        <br><br>
        <blockquote><b>Note</b>: To manage records of a datastore bundled with an extension, use the extension-scoped endpoint instead:<br><code>v3/extensions/{EXTENSION_ID}/datastores/{DATASTORE_UNIQUE_NAME}/records/{RECORD_ID}</code><br>and pass the <code>EXTENSION_KEY</code> as a query parameter.</blockquote>
        <br><br>
        <p>
          <b>Threshold limit</b>: 30 requests per min per user<br>
          Number of API calls allowed within a minute.<br><br>
          <b>Lock period</b>: 5 minutes<br>Wait time before consecutive API requests.<br>
        </p>
        <br><b>Possible Error Codes</b><br><br>
        <table style="border-collapse: collapse; width: 100%; font-family: inherit;">
          <tr>
            <th style="padding: 8px; text-align: center; border: 1px solid #ddd; font-family: inherit; min-width: 220px; word-break: break-word;">Error Code</th>
            <th style="padding: 8px; text-align: center; border: 1px solid #ddd; font-family: inherit;">Description</th>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_record_not_found</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">The record with the given ID does not exist in this datastore.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_not_found</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">Datastore with the given identifier does not exist.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_access_denied</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">The authenticated user does not have permission to delete records from this datastore.</td>
          </tr>
        </table>
        <br><b>Error Response Format</b><br>
        <p style="font-family:inherit;">When an error occurs, the API returns a JSON response in this format:<br><br>
        <code>{"message": "A human-readable description of the error.", "code": "error_code"}</code><br><br>
        where <code>code</code> is the error identifier (as listed in the table above) and <code>message</code> is a human-readable explanation of what went wrong.</p>
      parameters:
        - name: DATASTORE_UNIQUE_NAME
          in: path
          required: true
          description: Unique name of the datastore. To learn how to retrieve this, see <a href="/cliq/help/restapi/v3/glossary/#DATABASE_UNIQUE_NAME">DATABASE_UNIQUE_NAME</a> in the Glossary page.
          schema:
            type: string
            example: employee_data
        - name: RECORD_ID
          in: path
          required: true
          description: |
            Unique numeric identifier of the record to delete.<br>
            To learn how to retrieve this, see <a href="/cliq/help/restapi/v3/glossary/#RECORD_ID">RECORD_ID</a> in the Glossary page.
          schema:
            $ref: '#/components/schemas/longid_regex'
          example: RECORD_ID
        - name: EXTENSION_KEY
          in: query
          required: false
          description: |
            Unique key of the extension that the datastore belongs to. Required if the datastore is owned by an extension.<br>
            To learn how to retrieve this, see <a href="/cliq/help/restapi/v3/glossary/#EXTENSION_KEY">EXTENSION_KEY</a> in the Glossary page.
          schema:
            type: string
      responses:
        '204':
          description: No Content. Record deleted successfully.
        '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:
            - DatastoreRecords.DELETE
      tags:
        - Platform_storage
  /datastores/{DATASTORE_ID}/export:
    post:
      summary: Export datastore records
      operationId: export_datastore_records
      description: |
        Initiate a bulk export of all records from a datastore, identified by its numeric ID. This export is useful for data migration, backups, or analyzing platform storage data.
        <br><br>
        <p>
          <b>Threshold limit</b>: 5 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>
        <br><b>Possible Error Codes</b><br><br>
        <table style="border-collapse: collapse; width: 100%; font-family: inherit;">
          <tr>
            <th style="padding: 8px; text-align: center; border: 1px solid #ddd; font-family: inherit; min-width: 220px; word-break: break-word;">Error Code</th>
            <th style="padding: 8px; text-align: center; border: 1px solid #ddd; font-family: inherit;">Description</th>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_not_found</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">Datastore with the given identifier does not exist.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_access_denied</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">The authenticated user does not have permission to export this datastore.</td>
          </tr>
          <tr>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;"><code>datastore_export_password_missing</code></td>
            <td style="padding: 8px; border: 1px solid #ddd; word-break: break-word; white-space: normal;">A password is required when <code>password_protected</code> is set to <code>true</code>.</td>
          </tr>
        </table>
        <br><b>Error Response Format</b><br>
        <p style="font-family:inherit;">When an error occurs, the API returns a JSON response in this format:<br><br>
        <code>{"message": "A human-readable description of the error.", "code": "error_code"}</code><br><br>
        where <code>code</code> is the error identifier (as listed in the table above) and <code>message</code> is a human-readable explanation of what went wrong.</p>
      parameters:
        - name: DATASTORE_ID
          in: path
          required: true
          description: Unique numeric identifier of the datastore. To learn how to retrieve this ID, see <a href="/cliq/help/restapi/v3/glossary/#LONG_ID">LONG_ID</a> in the Glossary page.
          schema:
            $ref: '#/components/schemas/longid_regex'
      requestBody:
        description: Starts a datastore export. Specify the output file type and optional password protection.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/platformstorage_records_export'
            examples:
              without_password:
                summary: Export without password
                value:
                  file_type: csv
                  password_protected: false
              with_password:
                summary: Export with password
                value:
                  file_type: xlsx
                  password_protected: true
                  password: MyS3cureP@ss
        required: true
      responses:
        '204':
          description: No Content. Datastore export initiated successfully.
        '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:
            - Datastores.READ
      tags:
        - Platform_storage
components:
  schemas:
    updaterecord_response:
      type: object
      description: Response envelope returned when a datastore record is retrieved or updated.
      properties:
        url:
          type: string
          description: API endpoint URL for the record resource.
          example: /api/v3/datastores/shejbwfz/records/227828000000128010
        type:
          type: string
          description: Resource type identifier.
          example: datastore_record
        data:
          type: object
          description: The record's field values along with system-managed metadata fields.
          properties:
            modified_time:
              type: string
              description: Unix epoch timestamp (ms) when the record was last modified.
              example: '1777360403455'
            added_time:
              type: string
              description: Unix epoch timestamp (ms) when the record was first created.
              example: '1777360402254'
            id:
              type: string
              description: Unique numeric identifier of the record.
              example: '227828000000128010'
          additionalProperties: true
      example:
        url: /api/v3/datastores/shejbwfz/records/227828000000128010
        type: datastore_record
        data:
          modified_time: '1777360403455'
          empid: '1001'
          isactive: false
          salary: '0'
          department: ''
          id: '227828000000128010'
          empname: John Doe Jr.
          added_time: '1777360402254'
          notes: Senior Engineer in Platform Team
    DatastoreResponse:
      type: object
      description: Datastores API response envelope.
      properties:
        url:
          type: string
          example: /api/v3/datastores
        type:
          type: string
          example: datastore
        data:
          type: object
          additionalProperties: true
      example:
        url: /api/v3/datastores
        type: datastore
        data:
          unique_name: empdir
          name: Employee Directory
          id: '227828000000132001'
          creator:
            name: NP NTC
            id: '119440882'
          status: enabled
          fields:
            - default_value: ''
              masked: false
              name: Notes
              unique_name: notes
              type: large-text
              mandatory: false
              id: '17202020414617773604009000'
            - default_value: '0'
              masked: false
              name: Employee ID
              unique_name: empid
              type: number
              mandatory: true
              id: '17202020414617773604009001'
            - default_value: ''
              masked: false
              name: Employee Name
              unique_name: empname
              type: limited-text
              mandatory: true
              id: '17202020414617773604009002'
            - default_value: 'true'
              masked: false
              name: Active Status
              unique_name: isactive
              type: boolean
              mandatory: false
              id: '17202020414617773604009003'
          type: custom
          description: V3 API test datastore
          unique_keys:
            - - empid
          scope: personal
    no-response:
      type: object
      description: Represents an empty server response where no content is returned.
      properties:
        Response Code:
          type: string
          description: HTTP response code indicating no content is returned.
          example: 204 No response
    AddRecordRequest:
      type: object
      description: Request body schema to add a new record to the products database.
      required:
        - values
      properties:
        values:
          type: object
          description: Key-value pairs representing the product attributes to be added as a new record.
          additionalProperties: true
      example:
        values:
          productid: '1001'
          productcategory: zylker
          instock: true
          productsecretcode: secretkey123
          productdescription: zylker description
    UpdateRecordRequest:
      type: object
      description: Request body schema to update an existing record in the products database.
      required:
        - values
      properties:
        values:
          type: object
          description: Key-value pairs representing the fields to be updated in the record.
          additionalProperties: true
      example:
        values:
          instock: false
          productdescription: zylker products
    Products-DatabaseResponse:
      type: object
      description: Response schema representing a single product record in the database.
      properties:
        productcateogry:
          type: string
          description: Category of the product.
          example: zylker
        id:
          type: string
          description: Unique identifier of the product record in the database.
          example: '14756000888008001'
        productid:
          type: string
          description: Product identifier code.
          example: '1001'
        instock:
          type: boolean
          description: Indicates whether the product is in stock.
          example: true
        productsecretcode:
          type: string
          description: Secret code assigned to the product.
          example: secretkey123
        productdescription:
          type: string
          description: Detailed description of the product.
          example: zylker description
      additionalProperties: true
    product-database-list-records:
      type: object
      description: Response schema containing a list of product records from the database.
      properties:
        list:
          type: array
          description: Array of product record objects.
          items:
            type: object
            description: A single product record object.
            properties:
              productcateogry:
                type: string
                description: Category of the product.
              id:
                type: string
                description: Unique identifier of the product record.
              productid:
                type: string
                description: Product identifier code.
              instock:
                type: boolean
                description: Indicates whether the product is in stock.
              productsecretcode:
                type: string
                description: Secret code assigned to the product.
              productdescription:
                type: string
                description: Detailed description of the product.
          example:
            - productcateogry: zylker
              id: '14756000000008008'
              productid: '1004'
              instock: true
              productsecretcode: secretkey234
              productdescription: zylker description
            - productcateogry: zylcal
              id: '14756000000008003'
              productid: '1003'
              instock: false
              productsecretcode: secretkey123
              productdescription: zylcal description
            - productcateogry: zylker
              id: '14756000000008004'
              productid: '1002'
              instock: true
              productsecretcode: secretkey123
              productdescription: zylker description
            - productcateogry: zylker
              id: '14756000000008005'
              productid: '1001'
              instock: true
              productsecretcode: secretkey897
              productdescription: zylker description
    base64_regex:
      type: string
      description: Base64-encoded pagination or sync token used for cursor-based pagination and incremental data sync.
    editplatformdatabase_v2:
      type: object
      description: Payload for updating datastore metadata.
      properties:
        unique_name:
          type: string
          maxLength: 20
          description: |
            Updated datastore unique name.<br>
            Accepts lowercase letters, numbers, and underscores only, and must start with a letter. This is used in API endpoints and should be unique across datastores.<br>
            <b>Maximum length</b>: 20 characters.
        name:
          type: string
          maxLength: 20
          description: |
            Updated datastore display name.<br>
            Can contain letters, numbers, and spaces. This is used for display purposes in the UI and can be non-unique.<br>
            <b>Maximum length</b>: 20 characters.
        description:
          type: string
          maxLength: 250
          description: |
            Updated datastore description.<br>
            A brief description about the datastore's purpose or contents.<br>
            <b>Maximum length</b>: 250 characters.
        unique_keys:
          type: array
          maxItems: 4
          description: |
            Updated unique key constraints for the datastore. Replaces the existing set of constraints entirely.<br>
            <ul>
              <li>A maximum of <b>4</b> unique key constraints can be defined per datastore.</li>
              <li>Each constraint is an array of one or more field <code>unique_name</code> values that must be collectively unique across all records.</li>
              <li>Fields of type <b>encrypted-text</b> or <b>large-text</b> cannot be included in a unique key constraint.</li>
            </ul>
          items:
            type: array
            description: |
              An array of field unique_names that form a single unique key constraint. Each unique key constraint ensures that the combination of values in the specified fields is unique across all records in the datastore.
            items:
              type: string
      example:
        unique_name: empdir
        name: Employee Directory
        description: Tracks employee records and department data
        unique_keys:
          - - empid
            - empname
    createplatformdatabase_v2:
      type: object
      description: Payload for creating a new datastore.
      required:
        - unique_name
        - name
        - description
        - fields
      properties:
        unique_name:
          type: string
          maxLength: 20
          description: |
            Datastore unique name.<br>
            Accepts lowercase letters, numbers, and underscores only, and must start with a letter. This is used in API endpoints and should be unique across datastores.<br>
            <b>Maximum length</b>: 20 characters.
        name:
          type: string
          maxLength: 20
          description: |
            Datastore display name.<br>
            Can contain letters, numbers, and spaces. This is used for display purposes in the UI and can be non-unique.<br>
            <b>Maximum length</b>: 20 characters.
        description:
          type: string
          maxLength: 250
          description: |
            Datastore description.<br>
            A brief description about the datastore's purpose or contents.<br>
            <b>Maximum length</b>: 250 characters.
        fields:
          type: array
          minItems: 1
          maxItems: 19
          description: |
            List of field definitions for the datastore schema.<br>
            Each field defines a column in the datastore with specific attributes and constraints.<br>
            A datastore can have a maximum of 20 fields including the default record ID field.
          items:
            type: object
            required:
              - unique_name
              - name
              - type
            properties:
              unique_name:
                type: string
                maxLength: 20
                description: |
                  Unique name of the field.<br>
                  Accepts lowercase letters, numbers, and underscores only, and must start with a letter. This is used in API endpoints to reference the field.<br>
                  <b>Maximum length</b>: 20 characters.
              name:
                type: string
                maxLength: 20
                description: |
                  Display name of the field.<br>
                  Can contain letters, numbers, and spaces. This is used for display purposes in the UI.<br>
                  <b>Maximum length</b>: 20 characters.
              type:
                type: string
                description: |
                  Data type of the field.<br>
                  Determines the kind of data that can be stored in this field and the operations that can be performed on it.<br>
                   Allowed values:
                   <ul>
                     <li><b>boolean</b>: Stores true/false values.</li>
                     <li><b>number</b>: Stores numeric values. Can be used for mathematical operations.</li>
                     <li><b>limited-text</b>: Stores short text up to 250 characters. Cannot be used for full-text search.</li>
                     <li><b>encrypted-text</b>: Stores sensitive text data in encrypted form. Cannot be included in unique key constraints and does not support masking. Maximum length: 1000 characters.</li>
                     <li><b>large-text</b>: Stores long text data up to 65,535 characters. Suitable for descriptions, comments, etc. Cannot be included in unique key constraints.</li>
                   </ul>
                   <b>Note</b>: The field type cannot be changed after the datastore is created
                enum:
                  - boolean
                  - number
                  - limited-text
                  - encrypted-text
                  - large-text
              mandatory:
                type: boolean
                description: |
                  Indicates whether this field is mandatory for each record. If true, a value must be provided for this field when creating or updating records.
              masked:
                type: boolean
                description: |
                  Indicates whether this field's value should be masked (e.g., for sensitive information).<br>
                  <b>Note</b>: Masking is not supported for <b>encrypted-text</b> fields. Encrypted fields are already stored in protected form and cannot be additionally masked.
              default_value:
                type: string
                maxLength: 100
                description: |
                  Default value for the field when creating new records. Must be a string representation of a value compatible with the field's data type. For example, "true" for boolean, "123" for number, etc.<br>
                  <b>Maximum length</b>: 100 characters.
        unique_keys:
          type: array
          maxItems: 4
          description: |
            Defines unique key constraints for the datastore. Each constraint is an array of field <code>unique_name</code> values that must be collectively unique across all records.<br>
            <ul>
              <li>A maximum of <b>4</b> unique key constraints can be defined per datastore.</li>
              <li>Each constraint is an array of one or more field <code>unique_name</code> values.</li>
              <li>Fields of type <b>encrypted-text</b> or <b>large-text</b> cannot be included in a unique key constraint.</li>
            </ul>
          items:
            type: array
            description: An array of field unique_names that form a single unique key constraint.
            items:
              type: string
      example:
        unique_name: empdir
        name: Employee Directory
        description: V3 API test datastore
        fields:
          - name: Notes
            unique_name: notes
            type: large-text
            mandatory: false
          - name: Employee ID
            unique_name: empid
            type: number
            mandatory: true
          - name: Employee Name
            unique_name: empname
            type: limited-text
            mandatory: true
          - name: Active Status
            unique_name: isactive
            type: boolean
            mandatory: false
        unique_keys:
          - - empid
    datastores_records_add:
      type: object
      description: Payload for inserting or updating a single datastore record.
      required:
        - values
      properties:
        values:
          type: object
          description: |
            Key-value pairs of field unique_name and the new value to update.
          additionalProperties: true
          example:
            empid: '1001'
            empname: John Doe
            isactive: true
            salary: '50000'
            department: Engineering
            notes: Senior Engineer in Platform Team
    encryptedappkey_regex:
      type: string
      description: Encrypted application key (appkey or EXTENSION_KEY) issued to a bot or extension, used as an alternative to OAuth for webhook-style authentication.
    platformstorage_records_export:
      type: object
      description: Configuration payload for a Datastore bulk export operation. Specifies the fields to include, filter criteria, and output format.
      required:
        - file_type
      properties:
        file_type:
          type: string
          description: |
            Format of the exported file.<br>
            <ul>
             <li><b>csv</b>: Comma-separated values format, suitable for spreadsheets and data analysis tools.</li>
             <li><b>xlsx</b>: Microsoft Excel format, supports multiple sheets, formatting, and larger data volumes.</li>
             <li><b>pdf</b>: Portable Document Format, ideal for sharing and printing.</li>
            </ul>
          enum:
            - csv
            - xlsx
            - pdf
        password_protected:
          type: boolean
          description: |
            Indicates whether the exported file should be protected with a password. If true, the <code>password</code> field must be provided to specify the password to use for protecting the file.
        password:
          type: string
          minLength: 8
          maxLength: 20
          description: |
            Password to protect the exported file. This field is required if <code>password_protected</code> is true.<br>
            Must be between 8 and 20 characters in length and should include a mix of letters, numbers, and special characters for better security.
            <br><b>Minimum length</b>: 8 characters<br>
            <b>Maximum length</b>: 20 characters
    datastores_records_update:
      type: object
      description: Payload for bulk updating datastore records by criteria.
      required:
        - values
        - criteria
      properties:
        values:
          type: object
          description: |
            Field name to new value map. All records matching the criteria will have the specified fields updated to these new values. Fields not included in this map will remain unchanged in the matching records.
          additionalProperties: true
        criteria:
          type: string
          maxLength: 500
          description: |
            Expression to identify which records to update. Use field <code>unique_name</code>s as keys. Supported comparison operators: <code>=</code>, <code>==</code>, <code>!=</code>, <code>&gt;</code>, <code>&gt;=</code>, <code>&lt;</code>, <code>&lt;=</code>, <code>like</code>, <code>not like</code>, <code>in</code> (max 10 values), <code>not in</code> (max 10 values). Combine conditions with <code>&&</code> (AND) or <code>||</code> (OR), and use parentheses for grouping. Max 10 clauses.<br>
            <b>Maximum length</b>: 500 characters.
    orderbyfield_regex:
      type: string
      description: Field name (optionally suffixed with " asc" or " desc") used to sort Datastore records in query results.
    multiplelong_regex:
      type: string
      description: Comma-separated list of numeric long integer IDs (e.g. record IDs or field IDs) used in bulk delete operations.
    edit_platform_db_fields:
      type: object
      description: Payload for editing existing datastore fields.
      required:
        - fields
      properties:
        fields:
          type: array
          minItems: 1
          maxItems: 10
          description: |
            <ul>
              <li>List of existing fields to edit in the datastore schema.</li>
              <li>Each field must be identified by its numeric ID and can have its name, mandatory status, masked status, and default value updated. The field type cannot be changed.</li>
              <li><b>Maximum of 10 fields</b> can be edited in a single request.</li>
            </ul>
          items:
            type: object
            required:
              - id
            properties:
              id:
                type: string
                description: |
                  Unique identifier of the field to be edited. This is assigned by the system when the field is created and cannot be changed.
              unique_name:
                type: string
                maxLength: 20
                description: |
                  Unique name of the field.<br>
                  Accepts lowercase letters, numbers, and underscores only, and must start with a letter. This is used in API endpoints to reference the field.<br>
                  <b>Maximum length</b>: 20 characters.
              name:
                type: string
                maxLength: 20
                description: |
                  Display name of the field.<br>
                  Can contain letters, numbers, and spaces. This is used for display purposes in the UI.<br>
                  <b>Maximum length</b>: 20 characters.
              mandatory:
                type: boolean
                description: |
                  Indicates whether this field is mandatory for each record. If true, a value must be provided for this field when creating or updating records.
              masked:
                type: boolean
                description: |
                  Indicates whether this field's value should be masked (e.g., for sensitive information).<br>
                  <b>Note</b>: Masking is not supported for <b>encrypted-text</b> fields. Encrypted fields are already stored in protected form and cannot be additionally masked.
              default_value:
                type: string
                maxLength: 100
                description: |
                  Default value for the field when creating new records. Must be a string representation of a value compatible with the field's data type. For example, "true" for boolean, "123" for number, etc.<br>
                  <b>Maximum length</b>: 100 characters.
      example:
        fields:
          - id: '17202020414617773604009000'
            name: Notes
            unique_name: notes
            mandatory: false
            default_value: ''
          - id: '17202020414617773604009001'
            name: Employee ID
            unique_name: empid
            mandatory: true
            default_value: '0'
    add_platform_db_fields:
      type: object
      description: Payload for adding new fields to a datastore schema.
      required:
        - fields
      properties:
        fields:
          type: array
          minItems: 1
          maxItems: 10
          description: |
            <ul>
              <li>List of new fields to add to the datastore.</li>
              <li>Each field must have a unique_name, name, and type. The new fields will be appended to the existing schema and can be used in subsequent record operations.</li>
              <li><b>Maximum of 10 fields</b> can be added in a single request.</li>
            </ul>
          items:
            type: object
            required:
              - unique_name
              - name
              - type
            properties:
              unique_name:
                type: string
                maxLength: 20
                description: |
                  Unique name of the field.<br>
                  Accepts lowercase letters, numbers, and underscores only, and must start with a letter. This is used in API endpoints to reference the field.<br>
                  <b>Maximum length</b>: 20 characters.
              name:
                type: string
                maxLength: 20
                description: |
                  Display name of the field.<br>
                  Can contain letters, numbers, and spaces. This is used for display purposes in the UI.<br>
                  <b>Maximum length</b>: 20 characters.
              type:
                type: string
                description: |
                  Data type of the field.<br>
                  Determines the kind of data that can be stored in this field and the operations that can be performed on it.<br>
                   Allowed values:
                   <ul>
                     <li><b>boolean</b>: Stores true/false values.</li>
                     <li><b>number</b>: Stores numeric values. Can be used for mathematical operations.</li>
                     <li><b>limited-text</b>: Stores short text up to 250 characters. Cannot be used for full-text search.</li>
                     <li><b>encrypted-text</b>: Stores sensitive text data in encrypted form. Cannot be included in unique key constraints and does not support masking. Maximum length: 1000 characters.</li>
                     <li><b>large-text</b>: Stores long text data up to 65,535 characters. Suitable for descriptions, comments, etc. Cannot be included in unique key constraints.</li>
                   </ul>
                   <b>Note</b>: The field type cannot be changed after the datastore is created
                enum:
                  - boolean
                  - number
                  - limited-text
                  - encrypted-text
                  - large-text
              mandatory:
                type: boolean
                description: |
                  Indicates whether this field is mandatory for each record. If true, a value must be provided for this field when creating or updating records.
              masked:
                type: boolean
                description: |
                  Indicates whether this field's value should be masked (e.g., for sensitive information).<br>
                  <b>Note</b>: Masking is not supported for <b>encrypted-text</b> fields. Encrypted fields are already stored in protected form and cannot be additionally masked.
              default_value:
                type: string
                maxLength: 100
                description: |
                  Default value for the field when creating new records. Must be a string representation of a value compatible with the field's data type. For example, "true" for boolean, "123" for number, etc.<br>
                  <b>Maximum length</b>: 100 characters.
      example:
        fields:
          - unique_name: join_date
            name: Join Date
            type: limited-text
            mandatory: false
            default_value: ''
          - unique_name: location
            name: Location
            type: limited-text
            mandatory: false
            default_value: ''
    longid_regex:
      type: string
      description: Numeric long integer identifier used to reference platform components such as Commands, Functions, Widgets, Message Actions, Schedulers, and Extensions.
    listrecords_response:
      type: object
      description: Response schema for listing records from a datastore, including pagination information and a list of records.
      properties:
        url:
          type: string
          description: API endpoint URL for the records resource.
        type:
          type: string
          description: Resource type identifier.
        sync_token:
          type: string
          description: Opaque token encoding the current sync position; pass as next_token in subsequent requests for incremental sync.
        list:
          type: array
          description: Array of record objects returned from the datastore.
          items:
            type: object
            additionalProperties: true
      example:
        url: /api/v3/datastores/empdir/records
        type: datastore_record
        sync_token: MTB8MTc3NzM2MDQwMzQ1NXw=
        list:
          - productcateogry: zylker
            id: '14756000000008008'
            productid: '1004'
            instock: true
            productsecretcode: secretkey234
            productdescription: zylker description
          - productcateogry: zylcal
            id: '14756000000008003'
            productid: '1003'
            instock: false
            productsecretcode: secretkey123
            productdescription: zylcal description
          - productcateogry: zylker
            id: '14756000000008004'
            productid: '1002'
            instock: true
            productsecretcode: secretkey123
            productdescription: zylker description
          - productcateogry: zylker
            id: '14756000000008005'
            productid: '1001'
            instock: true
            productsecretcode: secretkey897
            productdescription: zylker description
  securitySchemes:
    Cliq_Auth:
      type: oauth2
      x-authorization-example: Bearer 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f
      flows:
        implicit:
          authorizationUrl: https://accounts.zoho.com/oauth/v2/auth
          scopes:
            ZohoCliq.Datastores.ALL: Create, Read, Update and Delete Datastores
            ZohoCliq.Datastores.CREATE: Create new Datastores with schema definitions.
            ZohoCliq.Datastores.READ: Read Datastore metadata, field schemas, and execution logs.
            ZohoCliq.Datastores.UPDATE: Update Datastore metadata and field schema definitions.
            ZohoCliq.Datastores.DELETE: Permanently delete Datastores and all their records.
            ZohoCliq.DatastoreRecords.CREATE: Insert new records into Datastores.
            ZohoCliq.DatastoreRecords.READ: Read and query records from Datastores.
            ZohoCliq.DatastoreRecords.UPDATE: Update existing records in Datastores.
            ZohoCliq.DatastoreRecords.DELETE: Delete records from Datastores.
