openapi: 3.0.0
info:
  version: 1.0.0
  title: Couchbase Data API
  description: >-
    # Introduction

    The Capella Data API provides a RESTful interface for working with data.

    It enables users to perform operations such as creating, reading, updating,
    or deleting data directly against your cluster.

    It also provides passthrough access to the Couchbase Services REST APIs,
    which enable you to query your data with SQL+&NoBreak;+, use vector search
    for AI applications, and more.


    ## Base URL


    The base URL for the Data API is as follows:


    `https://{clusterId}.data.cloud.couchbase.com`


    where `{clusterId}` is unique to your Couchbase Capella cluster.

    For details, see [Get Started with the Data
    API](https://docs.couchbase.com/cloud/data-api-guide/data-api-start.html).
servers:
  - url: 'https://{clusterId}.data.cloud.couchbase.com'
    variables:
      clusterId:
        default: clusterId
tags:
  - name: Health Check
    description: General utilities for the Data API.
  - name: Basic Document Operations
    description: 'Create, read, update, and delete operations for single documents.'
  - name: Binary Operations
    description: 'Append, prepend, increment, and decrement operations for binary documents.'
  - name: Query
    x-displayName: Query with SQL++
    description: >-
      Use the following endpoints to run SQL++ queries and set request-level
      parameters.
  - name: Query Indexes
    x-traitTag: true
    description: >-
      Use the [Query with SQL++](#tag/Query) endpoints to manage primary and
      secondary indexes.

      Alternatively, you can use the [Query
      Indexes](https://docs.couchbase.com/cloud/management-api-reference/index.html#tag/Query-Indexes)
      endpoints in the Management API.
  - name: Search
    x-displayName: Query with Search
    description: Use the following endpoints to query the contents of a Search index.
  - name: Search Indexes
    description: >-
      Use the following APIs to retrieve Search index definitions, create new
      Search indexes, or delete an existing Search index.
externalDocs:
  description: Data API Overview
  url: 'https://docs.couchbase.com/cloud/data-api-guide/data-api-intro.html'
paths:
  /v1/callerIdentity:
    parameters:
      - $ref: '#/components/parameters/AuthorizationHeader'
    get:
      summary: Get Caller Identity
      operationId: getCallerIdentity
      tags:
        - Health Check
      description: Retrieves the identity of the user making the current request.
      responses:
        '200':
          description: Successfully fetched the current caller's identity.
          content:
            application/json:
              schema:
                type: object
                properties:
                  user:
                    type: string
                    description: The user that is making the request.
                    example: Administrator
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
  '/v1/buckets/{bucketName}/scopes/{scopeName}/collections/{collectionName}/documents/{documentKey}':
    parameters:
      - $ref: '#/components/parameters/AuthorizationHeader'
      - $ref: '#/components/parameters/BucketName'
      - $ref: '#/components/parameters/ScopeName'
      - $ref: '#/components/parameters/CollectionName'
      - $ref: '#/components/parameters/DocumentKey'
    get:
      summary: Get Document
      operationId: getDocument
      tags:
        - Basic Document Operations
      description: Retrieves the specified document.
      parameters:
        - $ref: '#/components/parameters/AcceptEncodingHeader'
        - in: query
          name: project
          description: Specific fields to project from the document.
          required: false
          style: form
          explode: false
          schema:
            type: array
            items:
              type: string
      responses:
        '200':
          description: Successful fetch of the document
          headers:
            Content-Encoding:
              $ref: '#/components/headers/ContentEncoding'
            ETag:
              $ref: '#/components/headers/ETag'
            Expires:
              $ref: '#/components/headers/Expires'
            X-CB-Flags:
              $ref: '#/components/headers/DocumentFlags'
          content:
            application/json:
              schema:
                type: object
                description: The contents of the document.
                example:
                  title: Brighton
                  name: Brighton Palace Pier
                  alt: null
                  address: 'Madeira Dr, Brighton BN2 1TW'
                  directions: null
                  phone: '01273609361'
                  tollfree: null
                  email: info@brightonpalacepier.co.uk
                  url: 'https://www.brightonpier.co.uk'
                  hours: 11am–6pm
                  image: null
                  price: £2
                  content: >-
                    The Brighton Palace Pier, commonly known as Brighton Pier or
                    the Palace Pier, is a Grade II listed pleasure pier in
                    Brighton, England, located in the city centre opposite the
                    Old Steine. Established in 1899, it was the third pier to be
                    constructed in Brighton after the Royal Suspension Chain
                    Pier and the West Pier, but is now the only one still in
                    operation.
                  geo:
                    lat: 50.815
                    lon: -0.136944
                    accuracy: RANGE_INTERPOLATED
                  activity: do
                  type: landmark
                  id: 10044
                  country: United Kingdom
                  city: Brighton
                  state: null
            text/plain:
              example: Here is the text that was contained in the specified document.
              schema:
                type: string
                description: The text contained within the document.
                example: Here is the contents of your document
            application/octet-stream:
              example: |-
                01001000011001010111001001100101001000000110100101110011 
                00100000011101000110100001100101001000000110001001101001 
                01101110011000010111001001111001001000000110001101101111 
                01101110011101000110010101101110011101000111001100100000 
                01101111011001100010000001110100011010000110010100100000 
                01110011011100000110010101100011011010010110011001101001 
                01100101011001000010000001100100011011110110001101110101 
                0110110101100101011011100111010000101110
              schema:
                type: string
                format: binary
                description: The binary contents of the document.
            '*':
              schema:
                type: string
                format: binary
                description: The contents of the document.
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
        '504':
          $ref: '#/components/responses/GatewayTimeout'
    post:
      summary: Create Document
      operationId: createDocument
      tags:
        - Basic Document Operations
      description: Creates a document with the given ID and contents.
      parameters:
        - $ref: '#/components/parameters/ContentEncodingHeader'
        - $ref: '#/components/parameters/ExpiresHeader'
        - $ref: '#/components/parameters/DocumentFlagsHeader'
        - $ref: '#/components/parameters/DurabilityLevelHeader'
      requestBody:
        required: true
        content:
          '*':
            schema:
              type: string
              format: binary
              description: The contents of the document.
      responses:
        '200':
          description: Successful creation of the document
          headers:
            ETag:
              $ref: '#/components/headers/ETag'
            X-CB-MutationToken:
              $ref: '#/components/headers/MutationToken'
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '413':
          $ref: '#/components/responses/ContentTooLarge'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
        '504':
          $ref: '#/components/responses/GatewayTimeout'
    put:
      summary: Update Document
      operationId: updateDocument
      tags:
        - Basic Document Operations
      description: Updates the specified document with the given contents.
      parameters:
        - $ref: '#/components/parameters/ContentEncodingHeader'
        - $ref: '#/components/parameters/IfMatchHeader'
        - $ref: '#/components/parameters/ExpiresHeader'
        - $ref: '#/components/parameters/DocumentFlagsHeader'
        - $ref: '#/components/parameters/DurabilityLevelHeader'
      requestBody:
        required: true
        content:
          '*':
            schema:
              type: string
              format: binary
              description: The contents of the document.
      responses:
        '200':
          description: Successful creation of the document
          headers:
            ETag:
              $ref: '#/components/headers/ETag'
            X-CB-MutationToken:
              $ref: '#/components/headers/MutationToken'
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '413':
          $ref: '#/components/responses/ContentTooLarge'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
        '504':
          $ref: '#/components/responses/GatewayTimeout'
    delete:
      summary: Delete Document
      operationId: deleteDocument
      tags:
        - Basic Document Operations
      description: Deletes the specified document.
      parameters:
        - $ref: '#/components/parameters/IfMatchHeader'
        - $ref: '#/components/parameters/DurabilityLevelHeader'
      responses:
        '200':
          description: Successful deletion of the document
          headers:
            ETag:
              $ref: '#/components/headers/ETag'
            X-CB-MutationToken:
              $ref: '#/components/headers/MutationToken'
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
        '504':
          $ref: '#/components/responses/GatewayTimeout'
  '/v1/buckets/{bucketName}/scopes/{scopeName}/collections/{collectionName}/documents/{documentKey}/append':
    parameters:
      - $ref: '#/components/parameters/AuthorizationHeader'
      - $ref: '#/components/parameters/BucketName'
      - $ref: '#/components/parameters/ScopeName'
      - $ref: '#/components/parameters/CollectionName'
      - $ref: '#/components/parameters/DocumentKey'
    post:
      summary: Append to Document
      operationId: appendToDocument
      tags:
        - Binary Operations
      description: Appends the specified contents to the end of the document.
      parameters:
        - $ref: '#/components/parameters/IfMatchHeader'
        - $ref: '#/components/parameters/DurabilityLevelHeader'
      requestBody:
        required: true
        content:
          '*':
            schema: {}
      responses:
        '200':
          description: Successfully appended contents to the document.
          headers:
            ETag:
              $ref: '#/components/headers/ETag'
            X-CB-MutationToken:
              $ref: '#/components/headers/MutationToken'
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
        '504':
          $ref: '#/components/responses/GatewayTimeout'
  '/v1/buckets/{bucketName}/scopes/{scopeName}/collections/{collectionName}/documents/{documentKey}/prepend':
    parameters:
      - $ref: '#/components/parameters/AuthorizationHeader'
      - $ref: '#/components/parameters/BucketName'
      - $ref: '#/components/parameters/ScopeName'
      - $ref: '#/components/parameters/CollectionName'
      - $ref: '#/components/parameters/DocumentKey'
    post:
      summary: Prepend to Document
      operationId: prependToDocument
      tags:
        - Binary Operations
      description: Prepends the specified contents to the start of the document.
      parameters:
        - $ref: '#/components/parameters/IfMatchHeader'
        - $ref: '#/components/parameters/DurabilityLevelHeader'
      requestBody:
        required: true
        content:
          '*':
            schema: {}
      responses:
        '200':
          description: Successfully prepended contents to the document.
          headers:
            ETag:
              $ref: '#/components/headers/ETag'
            X-CB-MutationToken:
              $ref: '#/components/headers/MutationToken'
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
        '504':
          $ref: '#/components/responses/GatewayTimeout'
  '/v1/buckets/{bucketName}/scopes/{scopeName}/collections/{collectionName}/documents/{documentKey}/increment':
    parameters:
      - $ref: '#/components/parameters/AuthorizationHeader'
      - $ref: '#/components/parameters/BucketName'
      - $ref: '#/components/parameters/ScopeName'
      - $ref: '#/components/parameters/CollectionName'
      - $ref: '#/components/parameters/DocumentKey'
    post:
      summary: Increment Document
      operationId: incrementDocument
      tags:
        - Binary Operations
      description: >-
        Increments the value of the document.

        The document must contain a parsable integer as its content.

        For details, see
        [Counters](https://docs.couchbase.com/java-sdk/current/concept-docs/documents.html#counters).


        If the document does not exist, sets the initial value of the document.
      parameters:
        - $ref: '#/components/parameters/ExpiresHeader'
        - $ref: '#/components/parameters/DurabilityLevelHeader'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                initial:
                  description: >-
                    The value to set the document to if the document does not
                    exist.
                  type: integer
                  format: uint64
                  example: 10
                delta:
                  description: The value to increment the document by if it exists.
                  type: integer
                  format: uint64
                  example: 1
          '':
            schema: {}
      responses:
        '200':
          description: Successfully incremented the document.
          headers:
            ETag:
              $ref: '#/components/headers/ETag'
            X-CB-MutationToken:
              $ref: '#/components/headers/MutationToken'
          content:
            application/json:
              schema:
                type: integer
                format: uint64
                example: 10
                description: >-
                  The number stored in the document after
                  incrementing/initializing.
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
        '504':
          $ref: '#/components/responses/GatewayTimeout'
  '/v1/buckets/{bucketName}/scopes/{scopeName}/collections/{collectionName}/documents/{documentKey}/decrement':
    parameters:
      - $ref: '#/components/parameters/AuthorizationHeader'
      - $ref: '#/components/parameters/BucketName'
      - $ref: '#/components/parameters/ScopeName'
      - $ref: '#/components/parameters/CollectionName'
      - $ref: '#/components/parameters/DocumentKey'
    post:
      summary: Decrement Document
      operationId: decrementDocument
      tags:
        - Binary Operations
      description: >-
        Decrements the value of the document.

        The document must contain a parsable integer as its content.

        For details, see
        [Counters](https://docs.couchbase.com/java-sdk/current/concept-docs/documents.html#counters).


        If the document does not exist, sets the initial value of the document.
      parameters:
        - $ref: '#/components/parameters/ExpiresHeader'
        - $ref: '#/components/parameters/DurabilityLevelHeader'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                initial:
                  type: integer
                  format: uint64
                  description: >-
                    The value to set the document to if the document does not
                    exist.
                  example: 10
                delta:
                  type: integer
                  format: uint64
                  description: The value to decrement the document by if it exists.
                  example: 1
          '':
            schema: {}
      responses:
        '200':
          description: Successfully incremented the document.
          headers:
            ETag:
              $ref: '#/components/headers/ETag'
            X-CB-MutationToken:
              $ref: '#/components/headers/MutationToken'
          content:
            application/json:
              schema:
                type: integer
                format: uint64
                example: 11
                description: >-
                  The number stored in the document after
                  decrementing/initializing.
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
        '504':
          $ref: '#/components/responses/GatewayTimeout'
  '/v1/buckets/{bucketName}/scopes/{scopeName}/collections/{collectionName}/documents/{documentKey}/touch':
    parameters:
      - $ref: '#/components/parameters/AuthorizationHeader'
      - $ref: '#/components/parameters/BucketName'
      - $ref: '#/components/parameters/ScopeName'
      - $ref: '#/components/parameters/CollectionName'
      - $ref: '#/components/parameters/DocumentKey'
    post:
      summary: Touch Document
      operationId: touchDocument
      tags:
        - Basic Document Operations
      description: >-
        Updates the expiry of a document.

        For details, see
        [Expiration](https://docs.couchbase.com/server/current/learn/data/expiration.html).
      parameters:
        - $ref: '#/components/parameters/AcceptEncodingHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                expiry:
                  description: >-
                    The new expiry to set for the document, specified as an
                    ISO8601 string.
                  type: string
                  example: 'YYYY-MM-DDTHH:MM:SS.sssZ'
                returnContent:
                  description: >-
                    Specifies whether the document's contents should be returned
                    in the response.
                  type: boolean
      responses:
        '200':
          description: >-
            Successful updated the expiry of the document and is returning the
            content of the document.
          headers:
            Content-Encoding:
              $ref: '#/components/headers/ContentEncoding'
            ETag:
              $ref: '#/components/headers/ETag'
            X-CB-Flags:
              $ref: '#/components/headers/DocumentFlags'
          content:
            application/json:
              schema:
                type: object
                description: The contents of the document.
                example:
                  title: Brighton
                  name: Brighton Palace Pier
                  alt: null
                  address: 'Madeira Dr, Brighton BN2 1TW'
                  directions: null
                  phone: '01273609361'
                  tollfree: null
                  email: info@brightonpalacepier.co.uk
                  url: 'https://www.brightonpier.co.uk'
                  hours: 11am–6pm
                  image: null
                  price: £2
                  content: >-
                    The Brighton Palace Pier, commonly known as Brighton Pier or
                    the Palace Pier, is a Grade II listed pleasure pier in
                    Brighton, England, located in the city centre opposite the
                    Old Steine. Established in 1899, it was the third pier to be
                    constructed in Brighton after the Royal Suspension Chain
                    Pier and the West Pier, but is now the only one still in
                    operation.
                  geo:
                    lat: 50.815
                    lon: -0.136944
                    accuracy: RANGE_INTERPOLATED
                  activity: do
                  type: landmark
                  id: 10044
                  country: United Kingdom
                  city: Brighton
                  state: null
            text/plain:
              example: Here is the text that was contained in the specified document.
              schema:
                type: string
                description: The text contained within the document.
                example: Here is the contents of your document
            application/octet-stream:
              example: |-
                01001000011001010111001001100101001000000110100101110011 
                00100000011101000110100001100101001000000110001001101001 
                01101110011000010111001001111001001000000110001101101111 
                01101110011101000110010101101110011101000111001100100000 
                01101111011001100010000001110100011010000110010100100000 
                01110011011100000110010101100011011010010110011001101001 
                01100101011001000010000001100100011011110110001101110101 
                0110110101100101011011100111010000101110
              schema:
                type: string
                format: binary
                description: The binary contents of the document.
            '*':
              schema:
                type: string
                format: binary
                description: The contents of the document.
        '204':
          description: >-
            Successful updated the expiry of the document but is not returning
            the content of the document.
          headers:
            ETag:
              $ref: '#/components/headers/ETag'
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
        '504':
          $ref: '#/components/responses/GatewayTimeout'
  /_p/query/query/service:
    post:
      summary: Query Service
      operationId: post_service
      description: >-
        Enables you to execute a SQL++ statement.

        This method allows you to run SELECT queries and other DML statements,
        and specify query parameters.
      requestBody:
        required: true
        description: An object specifying one or more query parameters.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Request'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Request'
      security:
        - &ref_0
          Header: []
      tags:
        - Query
      responses:
        '200':
          $ref: '#/components/responses/OK'
        '400':
          $ref: '#/components/responses/responses-BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/responses-Forbidden'
        '404':
          $ref: '#/components/responses/responses-NotFound'
        '405':
          $ref: '#/components/responses/MethodNotAllowed'
        '409':
          $ref: '#/components/responses/responses-Conflict'
        '410':
          $ref: '#/components/responses/Gone'
        '413':
          $ref: '#/components/responses/PayloadTooLarge'
        '500':
          $ref: '#/components/responses/responses-InternalServerError'
        '503':
          $ref: '#/components/responses/responses-ServiceUnavailable'
    get:
      summary: Read-Only Query Service
      operationId: get_service
      tags:
        - Query
      description: >-
        Enables you to execute a SQL++ statement.

        This method allows you to run SELECT queries, and specify query
        parameters.


        This endpoint is intended for situations where use of the `POST` method
        is restricted.
      parameters:
        - name: body
          in: query
          required: true
          style: form
          explode: true
          description: >-
            Specify the parameters in the query URL in URL-encoded format.

            The format for URL-encoded parameters is consistent with the syntax
            for variables according to RFC 6570.
          schema:
            $ref: '#/components/schemas/Request'
      security:
        - *ref_0
      responses:
        '200':
          $ref: '#/components/responses/OK'
        '400':
          $ref: '#/components/responses/responses-BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/responses-Forbidden'
        '404':
          $ref: '#/components/responses/responses-NotFound'
        '405':
          $ref: '#/components/responses/MethodNotAllowed'
        '409':
          $ref: '#/components/responses/responses-Conflict'
        '410':
          $ref: '#/components/responses/Gone'
        '413':
          $ref: '#/components/responses/PayloadTooLarge'
        '500':
          $ref: '#/components/responses/responses-InternalServerError'
        '503':
          $ref: '#/components/responses/responses-ServiceUnavailable'
  '/_p/fts/api/index/{INDEX_NAME}/count':
    get:
      summary: Get Document Count for an Index
      operationId: g-api-index-name-count
      tags:
        - Search
      description: |
        Returns the number of documents indexed in the specified Search index.
      parameters:
        - $ref: '#/components/parameters/PathIndexFull'
      responses:
        '200':
          description: The Search Service returns a response that includes the status `ok`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentCount'
              example:
                status: ok
                count: 285
      security:
        - Statistics: []
  '/_p/fts/api/bucket/{BUCKET_NAME}/scope/{SCOPE_NAME}/index/{INDEX_NAME}/query':
    post:
      summary: Query a Search Index (Scoped)
      operationId: p-api-scoped-query
      tags:
        - Search
      description: >
        Run a query formatted as a JSON object against the Search index
        definition specified in the endpoint URL.

        The endpoint returns a JSON object as a response.

        This endpoint is scoped and does not require a fully qualified
        `{INDEX_NAME}` value.
      parameters:
        - $ref: '#/components/parameters/PathBucket'
        - $ref: '#/components/parameters/PathScope'
        - $ref: '#/components/parameters/PathIndex'
      requestBody:
        required: true
        description: >-
          A JSON object to define the settings for your Search query.

          For more information about how to create a Search query JSON object,
          see [Search Request JSON
          Properties](../search/search-request-params.html).
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QueryRequest'
      responses:
        '200':
          description: >-
            The response object has a status section that must be checked for
            every request.

            Under nearly all circumstances, the query response will be HTTP 200
            even though individual index shards (partitions) may encounter a
            timeout or return an error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QueryResponse'
              examples:
                regular:
                  summary: Success Response for a Regular Query
                  value:
                    status:
                      total: 1
                      failed: 0
                      successful: 1
                    request:
                      query:
                        conjuncts:
                          - match: location
                            field: reviews.content
                            prefix_length: 0
                            fuzziness: 0
                            operator: or
                          - match_phrase: nice view
                            field: reviews.content
                      size: 10
                      from: 0
                      highlight:
                        style: html
                        fields:
                          - reviews.content
                      fields: null
                      facets: null
                      explain: true
                      sort:
                        - reviews.Ratings.Cleanliness
                        - by: field
                          field: reviews.Ratings.Cleanliness
                          type: number
                        - '-_score'
                        - '-_id'
                      includeLocations: false
                      score: none
                      search_after: null
                      search_before: null
                    hits:
                      - index: >-
                          travel-sample.inventory.travel-test_53373d2948c55e82_4c1c5584
                        id: hotel_7388
                        score: 0
                        explanation:
                          value: 0
                          message: 'sum of:'
                          children:
                            - value: 0
                              message: 'product of:'
                              children:
                                - value: 0
                                  message: 'sum of:'
                                  children:
                                    - value: 0
                                      message: "weight(reviews.content:location^1.000000 in \0\0\0\0\0\0\x03\n), product of:"
                                      children:
                                        - value: 0.5320504947307548
                                          message: >-
                                            queryWeight(reviews.content:location^1.000000),
                                            product of:
                                          children:
                                            - value: 1
                                              message: boost
                                            - value: 1.4291903588638628
                                              message: 'idf(docFreq=596, maxDocs=917)'
                                            - value: 0.3722740581273647
                                              message: queryNorm
                                        - value: 0
                                          message: "fieldWeight(reviews.content:location in \0\0\0\0\0\0\x03\n), product of:"
                                          children:
                                            - value: 0
                                              message: 'tf(termFreq(reviews.content:location)=0'
                                            - value: 0
                                              message: "fieldNorm(field=reviews.content, doc=\0\0\0\0\0\0\x03\n)"
                                            - value: 1.4291903588638628
                                              message: 'idf(docFreq=596, maxDocs=917)'
                                - value: 1
                                  message: coord(1/1)
                            - value: 0
                              message: 'sum of:'
                              children:
                                - value: 0
                                  message: "weight(reviews.content:view^1.000000 in \0\0\0\0\0\0\x03\n), product of:"
                                  children:
                                    - value: 0.6867550119496617
                                      message: >-
                                        queryWeight(reviews.content:view^1.000000),
                                        product of:
                                      children:
                                        - value: 1
                                          message: boost
                                        - value: 1.8447565629585312
                                          message: 'idf(docFreq=393, maxDocs=917)'
                                        - value: 0.3722740581273647
                                          message: queryNorm
                                    - value: 0
                                      message: "fieldWeight(reviews.content:view in \0\0\0\0\0\0\x03\n), product of:"
                                      children:
                                        - value: 0
                                          message: 'tf(termFreq(reviews.content:view)=0'
                                        - value: 0
                                          message: "fieldNorm(field=reviews.content, doc=\0\0\0\0\0\0\x03\n)"
                                        - value: 1.8447565629585312
                                          message: 'idf(docFreq=393, maxDocs=917)'
                                - value: 0
                                  message: "weight(reviews.content:nice^1.000000 in \0\0\0\0\0\0\x03\n), product of:"
                                  children:
                                    - value: 0.4952674273751292
                                      message: >-
                                        queryWeight(reviews.content:nice^1.000000),
                                        product of:
                                      children:
                                        - value: 1
                                          message: boost
                                        - value: 1.3303839377539577
                                          message: 'idf(docFreq=658, maxDocs=917)'
                                        - value: 0.3722740581273647
                                          message: queryNorm
                                    - value: 0
                                      message: "fieldWeight(reviews.content:nice in \0\0\0\0\0\0\x03\n), product of:"
                                      children:
                                        - value: 0
                                          message: 'tf(termFreq(reviews.content:nice)=0'
                                        - value: 0
                                          message: "fieldNorm(field=reviews.content, doc=\0\0\0\0\0\0\x03\n)"
                                        - value: 1.3303839377539577
                                          message: 'idf(docFreq=658, maxDocs=917)'
                        locations:
                          reviews.content:
                            location:
                              - pos: 312
                                start: 1641
                                end: 1649
                                array_positions:
                                  - 4
                            nice:
                              - pos: 165
                                start: 840
                                end: 844
                                array_positions:
                                  - 2
                            view:
                              - pos: 166
                                start: 845
                                end: 849
                                array_positions:
                                  - 2
                        fragments:
                          reviews.content:
                            - >-
                              …at&#39;s her name checked us in, very friendly
                              and knowlegeable of the area. I would stay here
                              again get area and right at the street car stop.
                              nice resturants in walking distance.
                              <mark>nice</mark> <mark>view</mark> of the city o…
                        sort:
                          - "\U0010FFFF\U0010FFFF\U0010FFFF"
                          - "\U0010FFFF\U0010FFFF\U0010FFFF"
                          - _score
                          - hotel_7388
                      - ...
                    total_hits: 27
                    cost: 108906
                    max_score: 0
                    took: 14964461
                    facets: null
                hybrid:
                  summary: Success Response for a Hybrid Query
                  value:
                    status:
                      total: 1
                      failed: 0
                      successful: 1
                    request:
                      fields:
                        - '*'
                      query:
                        match_none: ''
                      knn:
                        - k: 2
                          field: colorvect_dot
                          vector:
                            - 0.707106781186548
                            - 0
                            - 0.707106781186548
                    hits:
                      - index: >-
                          vector-sample.color.color-test_4d6a4a2f00f48fa2_4c1c5584
                        id: '#FF00FF'
                        score: 0.9999999403953552
                        sort:
                          - _score
                        fields:
                          color: magenta / fuchsia
                      - index: >-
                          vector-sample.color.color-test_4d6a4a2f00f48fa2_4c1c5584
                        id: '#B000B0'
                        score: 0.9999999403953552
                        sort:
                          - _score
                        fields:
                          color: dark lavender
                    total_hits: 2
                    cost: 0
                    max_score: 0.9999999403953552
                    took: 4608572
                    facets: null
        default:
          description: >-
            The Search Service returns a non-200 HTTP error code when a request
            fails.
          content:
            application/json:
              example:
                error: >-
                  rest_index: Query, indexName:
                  travel-sample.inventory.travel-test, err: bleve: QueryBleve
                  parsing searchRequest, err: unknown query type
                request:
                  collections:
                    - hotel
                  ctl:
                    consistency:
                      level: at_plus
                      results: complete
                      vectors:
                        searchIndexName:
                          607/205096593892159: 2
                          640/298739127912798: 4
                    timeout: 10000
                  explain: true
                  from: 0
                  highlight:
                    fields:
                      - reviews.content
                    style: html
                  includeLocations: false
                  limit: 10
                  offset: 0
                  query: {}
                  score: none
                  size: 10
                  sort:
                    - reviews.Ratings.Cleanliness
                    - by: field
                      desc: false
                      field: reviews.Ratings.Cleanliness
                      missing: last
                      mode: default
                      type: number
                    - '-_score'
                    - '-_id'
                status: fail
      security:
        - Manage: []
  '/_p/fts/api/bucket/{BUCKET_NAME}/scope/{SCOPE_NAME}/index':
    get:
      summary: Get All Search Index Definitions (Scoped)
      operationId: g-api-scoped-index
      tags:
        - Search Indexes
      description: >-
        Returns all Search index definitions inside the bucket and scope
        specified in the endpoint URL as a JSON object.
      parameters:
        - $ref: '#/components/parameters/PathBucket'
        - $ref: '#/components/parameters/PathScope'
      responses:
        '200':
          description: A JSON object containing all Search index definitions.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetIndexesResponse'
              example:
                status: ok
                indexDefs:
                  uuid: 23cf9530131858b8
                  indexDefs:
                    travel-sample.inventory.travel-hotel:
                      type: fulltext-index
                      name: travel-hotel
                      uuid: a04a16f178846bc4
                      sourceType: gocbcore
                      sourceName: travel-sample
                      sourceUUID: 8f866261438f8b0d415a437552f3ae99
                      planParams:
                        maxPartitionsPerPIndex: 1024
                        indexPartitions: 1
                      params:
                        doc_config:
                          docid_prefix_delim: ''
                          docid_regexp: ''
                          mode: scope.collection.type_field
                          type_field: type
                        mapping:
                          analysis: {}
                          default_analyzer: standard
                          default_datetime_parser: dateTimeOptional
                          default_field: _all
                          default_mapping:
                            dynamic: true
                            enabled: false
                          default_type: _default
                          docvalues_dynamic: false
                          index_dynamic: true
                          store_dynamic: false
                          type_field: _type
                          types:
                            inventory.hotel:
                              dynamic: false
                              enabled: true
                              properties:
                                reviews:
                                  dynamic: false
                                  enabled: true
                                  properties:
                                    content:
                                      dynamic: false
                                      enabled: true
                                      fields:
                                        - docvalues: true
                                          include_in_all: true
                                          include_term_vectors: true
                                          index: true
                                          name: content
                                          store: true
                                          type: text
                        store:
                          indexType: scorch
                          segmentVersion: 15
                      sourceParams: {}
                    travel-sample.inventory.travel-test:
                      type: fulltext-index
                      name: travel-test
                      uuid: 766ddce5d41a3b41
                      sourceType: gocbcore
                      sourceName: travel-sample
                      sourceUUID: 8f866261438f8b0d415a437552f3ae99
                      planParams:
                        maxPartitionsPerPIndex: 1024
                        indexPartitions: 1
                      params:
                        doc_config:
                          docid_prefix_delim: ''
                          docid_regexp: ''
                          mode: scope.collection.type_field
                          type_field: type
                        mapping:
                          analysis: {}
                          default_analyzer: standard
                          default_datetime_parser: dateTimeOptional
                          default_field: _all
                          default_mapping:
                            dynamic: true
                            enabled: true
                          default_type: _default
                          docvalues_dynamic: false
                          index_dynamic: true
                          store_dynamic: false
                          type_field: _type
                        store:
                          indexType: scorch
                          segmentVersion: 15
                      sourceParams: {}
                  implVersion: 5.7.0
      security:
        - Read: []
  '/_p/fts/api/bucket/{BUCKET_NAME}/scope/{SCOPE_NAME}/index/{INDEX_NAME}':
    get:
      summary: Get Index Definition (Scoped)
      operationId: g-api-scoped-index-name
      tags:
        - Search Indexes
      description: >-
        Returns the Search index definition for the Search index specified in
        the endpoint URL as a JSON object.

        This endpoint is scoped and does not require a fully qualified
        `{INDEX_NAME}` value.
      parameters:
        - $ref: '#/components/parameters/PathBucket'
        - $ref: '#/components/parameters/PathScope'
        - $ref: '#/components/parameters/PathIndex'
      responses:
        '200':
          description: A JSON object containing the Search index definition.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetIndexResponse'
              example:
                status: ok
                indexDef:
                  type: fulltext-index
                  name: color-test
                  uuid: 6ea521a918bd3837
                  sourceType: gocbcore
                  sourceName: vector-sample
                  sourceUUID: 614177a67bdfbd2823c5f9c3e62f5991
                  planParams:
                    maxPartitionsPerPIndex: 1024
                    indexPartitions: 1
                  params:
                    doc_config:
                      docid_prefix_delim: ''
                      docid_regexp: ''
                      mode: scope.collection.type_field
                      type_field: type
                    mapping:
                      analysis: {}
                      default_analyzer: standard
                      default_datetime_parser: dateTimeOptional
                      default_field: _all
                      default_mapping:
                        dynamic: false
                        enabled: false
                      default_type: _default
                      docvalues_dynamic: false
                      index_dynamic: false
                      store_dynamic: false
                      type_field: _type
                      types:
                        color.rgb:
                          dynamic: false
                          enabled: true
                          properties:
                            color:
                              dynamic: false
                              enabled: true
                              fields:
                                - analyzer: en
                                  docvalues: true
                                  include_in_all: true
                                  include_term_vectors: true
                                  index: true
                                  name: color
                                  store: true
                                  type: text
                            colorvect_dot:
                              dynamic: false
                              enabled: true
                              fields:
                                - dims: 3
                                  index: true
                                  name: colorvect_dot
                                  similarity: dot_product
                                  type: vector
                                  vector_index_optimized_for: recall
                    store:
                      indexType: scorch
                      segmentVersion: 16
                  sourceParams: {}
                planPIndexes:
                  - name: vector-sample.color.color-test_6ea521a918bd3837_4c1c5584
                    uuid: '1543820346544e08'
                    indexType: fulltext-index
                    indexName: vector-sample.color.color-test
                    indexUUID: 6ea521a918bd3837
                    sourceType: gocbcore
                    sourceName: vector-sample
                    sourceUUID: 614177a67bdfbd2823c5f9c3e62f5991
                    sourcePartitions: >-
                      0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,465,466,467,468,469,470,471,472,473,474,475,476,477,478,479,480,481,482,483,484,485,486,487,488,489,490,491,492,493,494,495,496,497,498,499,500,501,502,503,504,505,506,507,508,509,510,511,512,513,514,515,516,517,518,519,520,521,522,523,524,525,526,527,528,529,530,531,532,533,534,535,536,537,538,539,540,541,542,543,544,545,546,547,548,549,550,551,552,553,554,555,556,557,558,559,560,561,562,563,564,565,566,567,568,569,570,571,572,573,574,575,576,577,578,579,580,581,582,583,584,585,586,587,588,589,590,591,592,593,594,595,596,597,598,599,600,601,602,603,604,605,606,607,608,609,610,611,612,613,614,615,616,617,618,619,620,621,622,623,624,625,626,627,628,629,630,631,632,633,634,635,636,637,638,639,640,641,642,643,644,645,646,647,648,649,650,651,652,653,654,655,656,657,658,659,660,661,662,663,664,665,666,667,668,669,670,671,672,673,674,675,676,677,678,679,680,681,682,683,684,685,686,687,688,689,690,691,692,693,694,695,696,697,698,699,700,701,702,703,704,705,706,707,708,709,710,711,712,713,714,715,716,717,718,719,720,721,722,723,724,725,726,727,728,729,730,731,732,733,734,735,736,737,738,739,740,741,742,743,744,745,746,747,748,749,750,751,752,753,754,755,756,757,758,759,760,761,762,763,764,765,766,767,768,769,770,771,772,773,774,775,776,777,778,779,780,781,782,783,784,785,786,787,788,789,790,791,792,793,794,795,796,797,798,799,800,801,802,803,804,805,806,807,808,809,810,811,812,813,814,815,816,817,818,819,820,821,822,823,824,825,826,827,828,829,830,831,832,833,834,835,836,837,838,839,840,841,842,843,844,845,846,847,848,849,850,851,852,853,854,855,856,857,858,859,860,861,862,863,864,865,866,867,868,869,870,871,872,873,874,875,876,877,878,879,880,881,882,883,884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,930,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,975,976,977,978,979,980,981,982,983,984,985,986,987,988,989,990,991,992,993,994,995,996,997,998,999,1000,1001,1002,1003,1004,1005,1006,1007,1008,1009,1010,1011,1012,1013,1014,1015,1016,1017,1018,1019,1020,1021,1022,1023
                    nodes:
                      b7d460b7d4145482ac132dfa23727c5c:
                        canRead: true
                        canWrite: true
                        priority: 0
                    indexParams:
                      doc_config:
                        docid_prefix_delim: ''
                        docid_regexp: ''
                        mode: scope.collection.type_field
                        type_field: type
                      mapping:
                        analysis: {}
                        default_analyzer: standard
                        default_datetime_parser: dateTimeOptional
                        default_field: _all
                        default_mapping:
                          dynamic: false
                          enabled: false
                        default_type: _default
                        docvalues_dynamic: false
                        index_dynamic: false
                        store_dynamic: false
                        type_field: _type
                        types:
                          color.rgb:
                            dynamic: false
                            enabled: true
                            properties:
                              color:
                                dynamic: false
                                enabled: true
                                fields:
                                  - analyzer: en
                                    docvalues: true
                                    include_in_all: true
                                    include_term_vectors: true
                                    index: true
                                    name: color
                                    store: true
                                    type: text
                              colorvect_dot:
                                dynamic: false
                                enabled: true
                                fields:
                                  - dims: 3
                                    index: true
                                    name: colorvect_dot
                                    similarity: dot_product
                                    type: vector
                                    vector_index_optimized_for: recall
                      store:
                        indexType: scorch
                        segmentVersion: 16
                warnings: []
      security:
        - Read: []
    put:
      summary: Create or Update an Index Definition (Scoped)
      operationId: p-api-scoped-index-name
      tags:
        - Search Indexes
      description: >-
        If the Search index in the endpoint URL does not exist, this endpoint
        uses a JSON object in the request body to create a new index.

        If the Search index already exists, this endpoint updates the Search
        index definition.

        This endpoint is scoped and does not require a fully qualified
        `{INDEX_NAME}` value.
      parameters:
        - $ref: '#/components/parameters/PathBucket'
        - $ref: '#/components/parameters/PathScope'
        - $ref: '#/components/parameters/PathIndex'
      requestBody:
        required: true
        description: >-
          The full Search index definition.

          For a detailed list of all parameters for the request body, see
          [Search Index JSON Properties](../search/search-index-params.html).
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IndexDefinition'
      responses:
        '200':
          description: A JSON object indicating the status of the operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PutIndexResponse'
              example:
                status: ok
                name: travel-sample.inventory.travel-test
                uuid: 654cb62baebf2d26
        default:
          description: >-
            The Search Service returns a non-200 HTTP error code when a request
            fails.
          content:
            application/json:
              schema:
                type: object
              example:
                error: >-
                  rest_create_index: index type is required, indexName:
                  travel-test
                request: {}
                status: fail
      security:
        - Write: []
    delete:
      summary: Delete Index Definition (Scoped)
      operationId: d-api-scoped-index-name
      tags:
        - Search Indexes
      description: >-
        Delete the Search index definition from the bucket and scope specified
        in the endpoint URL.

        This endpoint is scoped and does not require a fully qualified
        `{INDEX_NAME}` value.
      parameters:
        - $ref: '#/components/parameters/PathBucket'
        - $ref: '#/components/parameters/PathScope'
        - $ref: '#/components/parameters/PathIndex'
      responses:
        '200':
          description: A JSON object indicating the status of the operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteIndexResponse'
              example:
                status: ok
                uuid: 687be6a2ad647c34
        default:
          description: >-
            The Search Service returns a non-200 HTTP error code when a request
            fails.
          content:
            application/json:
              schema:
                type: object
              example:
                error: 'rest_auth: preparePerms, err: index not found'
                request: ''
                status: fail
      security:
        - Write: []
components:
  securitySchemes:
    BasicAuth:
      type: http
      scheme: basic
    Header:
      type: http
      scheme: basic
      description: |-
        Specify a user name and password via HTTP headers.
        This method can only be used to provide a single credential.
    Manage:
      type: http
      scheme: basic
      description: >-
        You must have the **Search Admin** role, with
        `cluster.bucket[$BUCKET_NAME].fts!manage` permissions on the required
        bucket.
    Statistics:
      type: http
      scheme: basic
      description: >-
        You must have the **Search Admin** role, with
        `cluster.bucket[$BUCKET_NAME].stats!read` permissions on the required
        bucket.
    Read:
      type: http
      scheme: basic
      description: >-
        You must have the **Search Reader** or **Search Admin** role, with
        `cluster.bucket[$BUCKET_NAME].fts!read` permissions on the required
        bucket.
    Write:
      type: http
      scheme: basic
      description: >-
        You must have the **Search Admin** role, with
        `cluster.bucket[$BUCKET_NAME].fts!write` permissions on the required
        bucket.
  responses:
    BadRequest:
      description: The request was malformed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            BadRequest:
              value:
                code: InvalidArgument
                message: The request was malformed or invalid.
    Forbidden:
      description: The user does not have permission to access the resource
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            Forbidden:
              value:
                code: InvalidAuth
                message: Your username or password is invalid.
    NotFound:
      description: The specified resource was not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            NotFound:
              value:
                code: ResourceNotFound
                message: The requested resource was not found.
    Conflict:
      description: A conflict occurred while processing the request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            Conflict:
              value:
                code: ResourceConflict
                message: There is a conflict with the current state of a resource.
    ContentTooLarge:
      description: The document is too large to be stored
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            ContentTooLarge:
              value:
                code: InvalidArgument
                message: The content of the request was too large.
    InternalServerError:
      description: An internal server error occurred
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            InternalServerError:
              value:
                code: Internal
                message: An internal error occurred.
    ServiceUnavailable:
      description: One of the underlying services was not available
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            ServiceUnavailable:
              value:
                code: UnderlyingServiceUnavailable
                message: One of the underlying services were not available.
    GatewayTimeout:
      description: The request timed out
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            GatewayTimeout:
              value:
                code: RequestCanceled
                message: The request deadline was exceeded.
    OK:
      description: The operation was successful.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Response'
          example:
            requestID: 615e0b26-dd61-4a1a-bda9-22333193b982
            signature:
              name: json
            results:
              - name: Medway Youth Hostel
            status: success
            metrics:
              elapsedTime: 5.232754ms
              executionTime: 5.160022ms
              resultCount: 1
              resultSize: 30
              serviceLoad: 12
    responses-BadRequest:
      description: >-
        Bad Request.

        The request cannot be processed for one of the following reasons:

        the statement contains a SQL++ syntax error;

        the request has a missing or unrecognized HTTP parameter;

        the request is badly formatted &mdash; for example, the request body
        contains a JSON syntax error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Response'
          examples:
            n1qlerror:
              summary: SQL++ Error
              value:
                requestID: 27087759-07af-431d-a3d7-29080f870e56
                errors:
                  - code: 3000
                    msg: 'syntax error - line 1, column 7, near ''SLECT'', at: name'
                status: fatal
                metrics:
                  elapsedTime: 1.478631ms
                  executionTime: 1.393274ms
                  resultCount: 0
                  resultSize: 0
                  serviceLoad: 12
                  errorCount: 1
            requesterror:
              summary: Request Error
              value:
                requestID: 424c0a6d-b851-4feb-892c-0d9a106f2e13
                errors:
                  - code: 1050
                    msg: No statement or prepared value
                status: fatal
                metrics:
                  elapsedTime: 1.124637ms
                  executionTime: 1.094663ms
                  resultCount: 0
                  resultSize: 0
                  serviceLoad: 0
                  errorCount: 1
    Unauthorized:
      description: |-
        Unauthorized.
        The credentials provided with the request are missing or invalid.
    responses-Forbidden:
      description: >-
        Forbidden.

        There is a read-only violation.

        Either there was an attempt to create or update in a GET request or a
        POST request where `readonly` is set, or the client does not have the
        authorization to modify an object (index, keyspace or namespace) in the
        statement.
    responses-NotFound:
      description: >-
        Not found.

        The statement in the request references an invalid namespace or
        keyspace.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Response'
          example:
            requestID: d30b805f-6c1e-44ec-9aec-35ff711a6e88
            errors:
              - code: 12003
                msg: >-
                  Keyspace not found in CB datastore:
                  default:travel-sample.inventory.motel
            status: fatal
            metrics:
              elapsedTime: 3.096786ms
              executionTime: 2.468282ms
              resultCount: 0
              resultSize: 0
              serviceLoad: 12
              errorCount: 1
    MethodNotAllowed:
      description: >-
        Method not allowed.

        The statement in the request references an invalid namespace or
        keyspace.
    responses-Conflict:
      description: >-
        Conflict.

        There is an attempt to create an object (keyspace or index) that already
        exists.
    Gone:
      description: >-
        Gone.

        The server is shutting down gracefully.

        Previously made requests are being completed, but no new requests are
        being accepted.
    PayloadTooLarge:
      description: |-
        Payload too large.
        The query is too large for the Query Service to process.
    responses-InternalServerError:
      description: |-
        Internal server error.
        There was an unforeseen problem processing the request.
    responses-ServiceUnavailable:
      description: >-
        Service unavailable.

        There is an issue (that is possibly temporary) preventing the request
        being processed; the request queue is full or the data store is not
        accessible.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Response'
          example:
            requestID: 5c0a6a81-2fc8-4a33-a035-ed7fb1512710
            errors:
              - code: <int>
                msg: Request queue full
            status: errors
            metrics:
              elapsedTime: 134.7944us
              executionTime: 130.5518us
              resultCount: 0
              resultSize: 0
              mutationCount: 0
              errorCount: 1
              warningCount: 0
  schemas:
    LookupInOperation:
      type: object
      properties:
        operation:
          $ref: '#/components/schemas/LookupInOperationType'
        path:
          description: >-
            The path within the document where you want to perform the
            operation.
          type: string
          example: address
    LookupInOperationResult:
      type: object
      properties:
        value:
          example: 'Madeira Dr, Brighton BN2 1TW'
          description: The value contained in the specified field
        error:
          $ref: '#/components/schemas/SubdocError'
    MutateInOperation:
      type: object
      properties:
        operation:
          $ref: '#/components/schemas/MutateInOperationType'
        path:
          description: >-
            The path within the document where you want to perform the
            operation.
          type: string
          example: hours
        value:
          description: The value to use for the sub-document operation.
          type: object
          x-go-type: json.RawMessage
          example: 10am-8pm
    MutateInOperationResult:
      type: object
      properties:
        value: {}
    DocumentEncoding:
      title: DocumentEncoding
      description: The compression used for the the document.
      type: string
      enum:
        - identity
        - snappy
      x-enum-varnames:
        - DocumentEncodingIdentity
        - DocumentEncodingSnappy
    DurabilityLevel:
      title: DurabilityLevel
      description: >-
        The level of synchronous replication to use.

        For details, see
        [Durability](https://docs.couchbase.com/server/current/learn/data/durability.html).
      type: string
      enum:
        - None
        - Majority
        - MajorityAndPersistOnMaster
        - PersistToMajority
      x-enum-varnames:
        - DurabilityLevelNone
        - DurabilityLevelMajority
        - DurabilityLevelMajorityAndPersistOnMaster
        - DurabilityLevelPersistToMajority
    SubdocErrorCode:
      title: SubdocErrorCode
      description: The specific sub-document error that occurred.
      type: string
      enum:
        - Internal
        - PathNotFound
        - PathMismatch
        - InvalidArgument
        - UnknownVattr
      x-enum-varnames:
        - SubdocErrorCodeInternal
        - SubdocErrorCodePathNotFound
        - SubdocErrorCodePathMismatch
        - SubdocErrorCodeInvalidArgument
        - SubdocErrorCodeUnknownVattr
    SubdocError:
      title: SubdocError
      description: A sub-document error from the server.
      type: object
      properties:
        error:
          $ref: '#/components/schemas/SubdocErrorCode'
        message:
          type: string
          description: A human-readable description of the error.
      required:
        - error
        - message
      example: null
    ErrorCode:
      title: ErrorCode
      description: The specific error that occurred.
      type: string
      enum:
        - InvalidArgument
        - Unauthorized
        - NoReadAccess
        - NoWriteAccess
        - InvalidAuth
        - Internal
        - UnderlyingServiceUnavailable
        - RequestCanceled
        - DeadlineExceeded
        - BucketNotFound
        - ScopeNotFound
        - CollectionNotFound
        - DocumentNotFound
        - DocumentExists
        - CasMismatch
        - DocumentLocked
        - DocumentNotLocked
        - ValueTooLarge
        - DocumentTooDeep
        - DocumentNotJson
        - PathMismatch
        - DocumentNotNumeric
        - PathNotFound
        - PathExists
        - PathInvalid
        - PathTooBig
        - UnknownVattr
        - DurabilityImpossible
      x-enum-varnames:
        - ErrorCodeInvalidArgument
        - ErrorCodeUnauthorized
        - ErrorCodeNoReadAccess
        - ErrorCodeNoWriteAccess
        - ErrorCodeInvalidAuth
        - ErrorCodeInternal
        - ErrorCodeUnderlyingServiceUnavailable
        - ErrorCodeRequestCanceled
        - ErrorCodeDeadlineExceeded
        - ErrorCodeBucketNotFound
        - ErrorCodeScopeNotFound
        - ErrorCodeCollectionNotFound
        - ErrorCodeDocumentNotFound
        - ErrorCodeDocumentExists
        - ErrorCodeCasMismatch
        - ErrorCodeDocumentLocked
        - ErrorCodeDocumentNotLocked
        - ErrorCodeValueTooLarge
        - ErrorCodeDocumentTooDeep
        - ErrorCodeDocumentNotJson
        - ErrorCodePathMismatch
        - ErrorCodeDocumentNotNumeric
        - ErrorCodePathNotFound
        - ErrorCodePathExists
        - ErrorCodePathInvalid
        - ErrorCodePathTooBig
        - ErrorCodeUnknownVattr
        - ErrorCodeDurabilityImpossible
    Error:
      title: Error
      description: An error response from the server.
      type: object
      properties:
        code:
          $ref: '#/components/schemas/ErrorCode'
        message:
          type: string
          description: A human-readable description of the error.
        resource:
          type: string
          description: The resource that caused the error.
        requestId:
          type: string
          description: The ID of the request that caused the error.
        debug:
          type: string
          description: Debug information about the error.
      required:
        - code
        - message
    StoreSemantic:
      title: StoreSemantic
      description: >-
        Specifies whether the document mutation should be performed as an
        insert, upsert, or replace.
      type: string
      enum:
        - Upsert
        - Insert
        - Replace
      x-enum-varnames:
        - StoreSemanticUpsert
        - StoreSemanticInsert
        - StoreSemanticReplace
    LookupInOperationType:
      title: LookupInOperationType
      description: Specifies the lookup operation to perform on the document.
      type: string
      enum:
        - Get
        - Exists
        - GetCount
      x-enum-varnames:
        - LookupInOperationTypeGet
        - LookupInOperationTypeExists
        - LookupInOperationTypeGetCount
      x-enumDescriptions:
        Get: Retrieve the field at the given path.
        Exists: Check if the given path exists in the document.
        GetCount: Count the number of elements in the field at the given path.
    MutateInOperationType:
      title: MutateInOperationType
      description: Specifies the mutation operation to perform on the document.
      type: string
      enum:
        - DictAdd
        - DictSet
        - Delete
        - Replace
        - ArrayPushLast
        - ArrayPushFirst
        - ArrayInsert
        - ArrayAddUnique
        - Counter
      x-enum-varnames:
        - MutateInOperationTypeDictAdd
        - MutateInOperationTypeDictSet
        - MutateInOperationTypeDelete
        - MutateInOperationTypeReplace
        - MutateInOperationTypeArrayPushLast
        - MutateInOperationTypeArrayPushFirst
        - MutateInOperationTypeArrayInsert
        - MutateInOperationTypeArrayAddUnique
        - MutateInOperationTypeCounter
      x-enumDescriptions:
        DictAdd: 'Add the value at the given path, if the given path does not exist.'
        DictSet: Unconditionally set the value at the given path.
        Delete: Remove item at the given path.
        Replace: Store value at the given path.
        ArrayPushLast: Append value to the array given by the path.
        ArrayPushFirst: Prepend value to the array given by the path.
        ArrayInsert: |-
          Add the value at the given array index.
          Path must include index, for example `my.list[4]`.
        ArrayAddUnique: >-
          Add the value to the array given by the path, if the value is not
          already in the array.
        Counter: |-
          Increment or decrement an existing numeric path.
          The value must be 64-bit integer.
      example: Upsert
    Request:
      type: object
      title: Request Parameters
      properties:
        args:
          type: array
          items: {}
          x-desc-name: args
          description: >-
            Supplies the values for positional parameters in the statement.

            Applicable if the statement or prepared statement contains 1 or more
            positional parameters.


            The value is an array of JSON values, one for each positional
            parameter in the statement.


            Refer to [Named Parameters and Positional
            Parameters][section_srh_tlm_n1b] for details.


            [section_srh_tlm_n1b]:
            ../n1ql/n1ql-manage/query-settings.html#section_srh_tlm_n1b
          x-desc-refs: '[section_srh_tlm_n1b]: #section_srh_tlm_n1b'
          x-has-example: true
          example:
            - LAX
            - 6
        atrcollection:
          type: string
          x-desc-name: atrcollection_req
          description: >-
            Specifies the collection where the [active transaction
            record][additional-storage-use] (ATR) is stored.

            The collection must be present.

            If not specified, the ATR is stored in the default collection in the
            default scope in the bucket containing the first mutated document
            within the transaction.


            The value must be a string in the form `"bucket.scope.collection"`
            or `"namespace:bucket.scope.collection"`.

            If any part of the path contains a special character, that part of
            the path must be delimited in backticks &grave;&grave;.


            [additional-storage-use]:
            /server/8.0/learn/data/transactions.html#active-transaction-record-entries
          x-desc-more: >-
            The [node-level][atrcollection-srv] `atrcollection` setting
            specifies the default for this parameter for a single node.

            The request-level parameter overrides the node-level setting.


            [atrcollection-srv]: ../n1ql-rest-admin/index.html#atrcollection-srv
          x-desc-refs: '[atrcollection-srv]: #atrcollection-srv'
          x-has-example: true
          example: 'default:`travel-sample`.transaction.test'
        auto_execute:
          type: boolean
          x-desc-name: auto_execute
          description: >-
            Specifies that prepared statements should be executed automatically
            as soon as they are created.

            This saves you from having to make two separate requests in cases
            where you want to prepare a statement and execute it immediately.


            Refer to [Auto-Execute][auto-execute] for more information.


            [auto-execute]:
            ../n1ql/n1ql-language-reference/prepare.html#auto-execute
          x-desc-refs: '[auto-execute]: ../n1ql-language-reference/prepare.html#auto-execute'
          x-has-default: true
          x-has-example: true
          default: false
          example: true
        client_context_id:
          type: string
          x-desc-name: client_context_id
          description: >-
            A piece of data supplied by the client that is echoed in the
            response, if present.

            SQL++ is agnostic about the content of this parameter; it is just
            echoed in the response.


            * Maximum allowed size is 64 characters; all others will be cut.

            * If it contains an escape character `/` or quote `"`, it will be
            rejected as error code 1110.
        compression:
          type: string
          x-desc-name: compression
          description: |-
            Compression format to use for response data on the wire.

            Values are case-insensitive.
          enum:
            - ZIP
            - RLE
            - LZMA
            - LZO
            - NONE
          x-has-default: true
          x-has-example: true
          default: NONE
          example: zip
        controls:
          type: boolean
          x-desc-name: controls_req
          description: >-
            Specifies if there should be a controls section returned with the
            request results.


            When set to `true`, the query response document includes a controls
            section with runtime information provided along with the request,
            such as positional and named parameters or settings.


            If the request qualifies for caching, these values will also be
            cached in the `completed_requests` system keyspace.
          x-desc-more: >-
            The [node-level][controls-srv] `controls` setting specifies the
            default for this parameter for a single node.

            The request-level parameter overrides the node-level setting.


            [controls-srv]: ../n1ql-rest-admin/index.html#controls-srv
          x-desc-refs: '[controls-srv]: #controls-srv'
          x-has-example: true
          example: true
        creds:
          type: array
          items:
            type: object
          x-desc-name: creds
          description: 'In the Data API, this parameter is ignored and has no effect.'
          example: []
        durability_level:
          type: string
          x-desc-name: durability_level
          description: >-
            The level of [durability][durability] for mutations produced by the
            request.


            If the request contains a `BEGIN TRANSACTION` statement, or a DML
            statement with the `tximplicit` parameter set to `true`, the
            durability level is specified for all mutations within that
            transaction.


            Durability is also supported for non-transactional DML statements.

            In this case, the `kvtimeout` parameter is used as the durability
            timeout.


            If not specified, the default durability level is `"majority"`.

            Set the durability level to `"none"` or `""` to specify no
            durability.


            [durability]: /server/8.0/learn/data/durability.html
          enum:
            - ''
            - none
            - majority
            - majorityAndPersistActive
            - persistToMajority
          x-has-default: true
          x-has-example: true
          default: majority
          example: none
        encoded_plan:
          type: string
          x-desc-name: encoded_plan
          description: >-
            In clusters running Couchbase Server 6.5 and later, this parameter
            is ignored and has no effect.

            It is included for compatibility with previous versions.
        encoding:
          type: string
          x-desc-name: encoding
          description: |-
            Desired character encoding for the query results.

            Only possible value is `UTF-8` and is case-insensitive.
          x-has-default: true
          default: UTF-8
        format:
          type: string
          x-desc-name: format
          description: |-
            Desired format for the query results.

            Values are case-insensitive.
          enum:
            - JSON
            - XML
            - CSV
            - TSV
          x-has-default: true
          x-has-example: true
          default: JSON
          example: XML
        kvtimeout:
          type: string
          x-desc-name: kvtimeout
          description: >-
            The approximate time to wait for a KV get operation before timing
            out.

            This applies to statements within a transaction, and to
            non-transactional statements, whether `durability_level` is set or
            not.


            If `use_replica` is enabled for a query, then this parameter also
            specifies the approximate time to wait before fetching data from a
            replica vBucket when the active vBucket is inaccessible.


            The value for this parameter is a string.

            Its format includes an amount and a mandatory unit, e.g. `10ms` (10
            milliseconds) or `0.5s` (half a second).

            Valid units are:


            * `ns` (nanoseconds)

            * `us` (microseconds)

            * `ms` (milliseconds)

            * `s` (seconds)

            * `m` (minutes)

            * `h` (hours)


            Specify a duration of `0` or a negative duration to disable.

            When disabled, no timeout is applied and the KV operation runs for
            however long it takes.
          x-has-default: true
          x-has-example: true
          default: 2.5s
          example: 10ms
        max_parallelism:
          type: integer
          format: int32
          x-desc-name: max_parallelism_req
          description: >-
            Specifies the maximum parallelism for the query.


            The default value is the same as the number of partitions of the
            index selected for the query.
          x-desc-more: >-
            The [node-level][max-parallelism-srv] `max-parallelism` setting
            specifies the ceiling for this parameter for a single node.

            If the request-level parameter is zero or negative, the parallelism
            for the query is set to the node-level setting.

            If the request-level parameter is greater than zero and less than
            the node-level setting, the request-level parameter overrides the
            node-level setting.

            If the request-level parameter is greater than the node-level
            setting, the parallelism for the query is set to the node-level
            setting.


            In addition, the [cluster-level][queryMaxParallelism]
            `queryMaxParallelism` setting specifies the ceiling for this
            parameter for the whole cluster.

            When you change the cluster-level setting, the node-level setting is
            overwritten for all nodes in the cluster.


            To enable queries to run in parallel, you must specify the
            cluster-level `queryMaxParallelism` parameter, or specify the
            node-level `max-parallelism` parameter on all Query nodes.


            [max-parallelism-srv]:
            ../n1ql-rest-admin/index.html#max-parallelism-srv

            [queryMaxParallelism]:
            ../n1ql-rest-settings/index.html#queryMaxParallelism
          x-desc-refs: |-
            [max-parallelism-srv]: #max-parallelism-srv
            [queryMaxParallelism]: #queryMaxParallelism
          x-has-example: true
          example: 3
        memory_quota:
          type: integer
          format: int32
          x-desc-name: memory_quota_req
          description: >-
            Specifies the maximum amount of memory the request may use, in MB.


            Specify `0` (the default value) to disable.

            When disabled, there is no quota.


            This parameter enforces a ceiling on the memory used for the tracked
            documents required for processing a request.

            It does not take into account any other memory that might be used to
            process a request, such as the stack, the operators, or some
            intermediate values.


            Within a transaction, this setting enforces the memory quota for the
            transaction by tracking the

            delta table and the transaction log (approximately).
          x-desc-more: >-
            The [node-level][memory-quota-srv] `memory-quota` setting specifies
            the ceiling for this parameter for a single node.

            If the node-level setting is zero (the default), the request-level
            parameter overrides the node-level setting.

            If the node-level setting is greater than zero, the request-level
            parameter is capped by the node-level setting.


            In addition, the [cluster-level][queryMemoryQuota]
            `queryMemoryQuota` setting specifies the ceiling for this parameter
            for the whole cluster.

            When you change the cluster-level setting, the node-level setting is
            overwritten for all nodes in the cluster.


            [memory-quota-srv]: ../n1ql-rest-admin/index.html#memory-quota-srv

            [queryMemoryQuota]:
            ../n1ql-rest-settings/index.html#queryMemoryQuota
          x-desc-refs: |-
            [memory-quota-srv]: #memory-quota-srv
            [queryMemoryQuota]: #queryMemoryQuota
          x-has-default: true
          x-has-example: true
          default: 0
          example: 4
        metrics:
          type: boolean
          x-desc-name: metrics
          description: Specifies that metrics should be returned with query results.
          x-has-default: true
          x-has-example: true
          default: true
          example: false
        namespace:
          type: string
          x-desc-name: namespace
          description: |-
            Specifies the namespace to use.
            Currently, only the `default` namespace is available.
          x-has-example: true
          example: default
        natural:
          type: string
          x-desc-name: natural
          x-desc-status: Couchbase Server 8.0
          description: >-
            The prompt for a natural language request.

            The Query Service uses the prompt to generate a SQL++ statement.


            If the generated statement is a SELECT statement, the generated
            statement is returned and executed automatically.


            If the generated statement is not a SELECT statement, the generated
            statement is returned, but not executed.

            In this case, you must verify the statement and execute it in a
            separate request.


            Natural language requests use the Couchbase Capella iQ service as a
            backend.

            To make a natural language request, you must have a Couchbase
            Capella user account.


            This parameter is available in clusters running Couchbase Server 8.0
            and later.


            To use this parameter, you must also specify the `natural_cred`,
            `natural_orgid`, and `natural_context` parameters.

            If you don't specify all four parameters, the Query Service returns
            an error.
          x-has-example: true
          example: Show me count of airlines per country
        natural_cred:
          type: string
          format: password
          x-desc-name: natural_cred
          x-desc-status: Couchbase Server 8.0
          description: >-
            The Couchbase Capella user account credentials for a natural
            language request, in the form `username:password`.

            Be careful not to expose the credentials in log files or other
            output.


            This parameter does not support single sign-on (SSO), multi-factor
            authentication (MFA), or social login credentials such as Google or
            GitHub.


            Natural language requests use the Couchbase Capella iQ service as a
            backend.

            To make a natural language request, you must have a Couchbase
            Capella user account.


            This parameter is available in clusters running Couchbase Server 8.0
            and later.


            To use this parameter, you must also specify the `natural`,
            `natural_orgid`, and `natural_context` parameters.

            If you don't specify all four parameters, the Query Service returns
            an error.
          x-has-example: true
          example: 'username:password'
        natural_orgid:
          type: string
          format: uuid
          x-desc-name: natural_orgid
          x-desc-status: Couchbase Server 8.0
          description: >-
            The Couchbase Capella organization ID for a natural language
            request.


            Natural language requests use the Couchbase Capella iQ service as a
            backend.

            To make a natural language request, you must have a Couchbase
            Capella user account.


            This parameter is available in clusters running Couchbase Server 8.0
            and later.


            To use this parameter, you must also specify the `natural`,
            `natural_cred`, and `natural_context` parameters.

            If you don't specify all four parameters, the Query Service returns
            an error.
        natural_context:
          type: string
          x-desc-name: natural_context
          x-desc-status: Couchbase Server 8.0
          description: >-
            A list of paths specifying keyspaces for a natural language request.

            The Query Service infers the schema of each keyspace, in order to
            give more precise responses from the natural language request.


            The parameter may contain up to four paths, separated by commas.

            Spaces are allowed.

            Each path may be:


            * A full path, in the form `bucket.scope.collection` or
            `namespace:bucket.scope.collection`.


            * A path prefix, in the form `namespace:bucket` or `bucket`, to
            specify the default collection in the default scope.


            * A partial path, in the form `collection`.
              In this case, you must specify the `query_context` parameter to provide the bucket and scope.

            Natural language requests use the Couchbase Capella iQ service as a
            backend.

            To make a natural language request, you must have a Couchbase
            Capella user account.


            This parameter is available in clusters running Couchbase Server 8.0
            and later.


            To use this parameter, you must also specify the `natural`,
            `natural_cred`, and `natural_orgid` parameters.

            If you don't specify all four parameters, the Query Service returns
            an error.
          x-has-example: true
          example: 'travel-sample, travel-sample.inventory.airline, airline'
        natural_output:
          type: string
          x-desc-name: natural_output
          x-desc-status: Couchbase Server 8.0
          description: >-
            Specifies the required output for a natural language request.


            * `sql` &mdash;
              The output is a SQL++ statement.

            * `jsudf` &mdash;
              The output is a `CREATE FUNCTION` statement which you can use to generate a SQL++ managed JavaScript user-defined function.

            * `ftssql` &mdash;
              The output is a SQL++ statement which can use a Flex index, if available.

            Natural language requests use the Couchbase Capella iQ service as a
            backend.

            To make a natural language request, you must have a Couchbase
            Capella user account.


            This parameter is available in clusters running Couchbase Server 8.0
            and later.
          x-has-default: true
          default: sql
          enum:
            - sql
            - jsudf
            - ftssql
        numatrs:
          type: integer
          format: int32
          x-desc-name: numatrs_req
          description: |-
            Reserved for future use.
            This parameter is ignored and has no effect.
        pipeline_batch:
          type: integer
          format: int32
          x-desc-name: pipeline_batch_req
          description: >-
            Controls the number of items execution operators can batch for Fetch
            from the KV.
          x-desc-more: >-
            The [node-level][pipeline-batch-srv] `pipeline-batch` setting
            specifies the default for this parameter for a single node.

            The request-level parameter overrides the node-level setting, but
            only if it is lower than the node-level setting.


            In addition, the [cluster-level][queryPipelineBatch]
            `queryPipelineBatch` setting specifies the default for this
            parameter for the whole cluster.

            When you change the cluster-level setting, the node-level setting is
            overwritten for all nodes in the cluster.


            [pipeline-batch-srv]:
            ../n1ql-rest-admin/index.html#pipeline-batch-srv

            [queryPipelineBatch]:
            ../n1ql-rest-settings/index.html#queryPipelineBatch
          x-desc-refs: |-
            [pipeline-batch-srv]: #pipeline-batch-srv
            [queryPipelineBatch]: #queryPipelineBatch
          x-has-example: true
          example: 64
        pipeline_cap:
          type: integer
          format: int32
          x-desc-name: pipeline_cap_req
          description: >-
            Maximum number of items each execution operator can buffer between
            various operators.
          x-desc-more: >-
            The [node-level][pipeline-cap-srv] `pipeline-cap` setting specifies
            the default for this parameter for a single node.

            The request-level parameter overrides the node-level setting, but
            only if it is lower than the node-level setting.


            In addition, the [cluster-level][queryPipelineCap]
            `queryPipelineCap` setting specifies the default for this parameter
            for the whole cluster.

            When you change the cluster-level setting, the node-level setting is
            overwritten for all nodes in the cluster.


            [pipeline-cap-srv]: ../n1ql-rest-admin/index.html#pipeline-cap-srv

            [queryPipelineCap]:
            ../n1ql-rest-settings/index.html#queryPipelineCap
          x-desc-refs: |-
            [pipeline-cap-srv]: #pipeline-cap-srv
            [queryPipelineCap]: #queryPipelineCap
          x-has-example: true
          example: 1024
        prepared:
          type: string
          x-desc-name: prepared
          description: >-
            _Required_ if `statement` or `natural` not provided.


            The name of the prepared SQL++ statement to be executed.

            Refer to [EXECUTE][execute] for examples.


            If both `prepared` and `statement` are present and non-empty, an
            error is returned.


            [execute]: ../n1ql/n1ql-language-reference/execute.html
          x-desc-refs: '[execute]: ../n1ql-language-reference/execute.html'
          x-has-example: true
          example: '[127.0.0.1:8091]pricy_hotel'
        preserve_expiry:
          type: boolean
          x-desc-name: preserve_expiry
          description: >-
            Specifies whether documents should keep their current expiration
            setting when modified by a DML statement.


            If `true`, documents will keep any existing expiration setting when
            modified by a DML statement.

            If the DML statement explicitly specifies the document expiration,
            the statement overrides this parameter, and the expiration is
            changed.


            If `false`, document expiration is set to 0 when modified by a DML
            statement, unless the DML statement explicitly specifies the
            document expiration.


            Not supported for statements in a transaction.
          x-has-default: true
          x-has-example: true
          default: false
          example: true
        pretty:
          type: boolean
          x-desc-name: pretty_req
          description: Specifies the query results returned in pretty format.
          x-desc-more: >-
            The [node-level][pretty-srv] `pretty` setting specifies the default
            for this parameter for a single node.

            The request-level parameter overrides the node-level setting.


            [pretty-srv]: ../n1ql-rest-admin/index.html#pretty-srv
          x-desc-refs: '[pretty-srv]: #pretty-srv'
          x-has-example: true
          example: false
        profile:
          type: string
          x-desc-name: profile_req
          description: >-
            Specifies if there should be a profile section returned with the
            request results.

            The valid values are:


            * `off` &mdash; No profiling information is added to the query
            response.


            * `phases` &mdash;

            The query response includes a profile section with stats and details
            about various phases of the query plan and execution.

            Three phase times will be included in the `system:active_requests`
            and `system:completed_requests` monitoring keyspaces.


            * `timings` &mdash;

            Besides the phase times, the profile section of the query response
            document will include a full query plan with timing and information
            about the number of processed documents at each phase.

            This information will be included in the `system:active_requests`
            and `system:completed_requests` keyspaces.


            If `profile` is not set as one of the above values, then the profile
            setting does not change.
          x-desc-more: >-
            The [node-level][profile-srv] `profile` setting specifies the
            default for this parameter for a single node.

            The request-level parameter overrides the node-level setting.


            [profile-srv]: ../n1ql-rest-admin/index.html#profile-srv
          x-desc-refs: '[profile-srv]: #profile-srv'
          enum:
            - 'off'
            - phases
            - timings
          x-has-example: true
          example: phases
        query_context:
          type: string
          x-desc-name: query_context
          description: >-
            Specifies the namespace, bucket, and scope used to resolve partial
            keyspace references within the request.


            The query context may be a _full path_, containing namespace,
            bucket, and scope; or a _relative path_, containing just the bucket
            and scope.

            Currently, only the `default` namespace is available.

            If the namespace name is omitted, the default namespace in the
            current session is used.
          x-has-default: true
          x-has-example: true
          default: 'default:'
          example: 'default:travel-sample.inventory'
        readonly:
          type: boolean
          x-desc-name: readonly
          description: >-
            Controls whether a query can change a resulting recordset.


            If `readonly` is `true`, then the following statements are not
            allowed:


            * CREATE INDEX

            * DROP INDEX

            * INSERT

            * MERGE

            * UPDATE

            * UPSERT


            When using GET requests, it's best to set `readonly` to `true`.
          x-has-default: true
          x-has-example: true
          default: false
          example: true
        scan_cap:
          type: integer
          format: int32
          x-desc-name: scan_cap_req
          description: >-
            Maximum buffered channel size between the indexer client and the
            query service for index scans.

            This parameter controls when to use scan backfill.


            Use `0` or a negative number to disable.

            Smaller values reduce GC, while larger values reduce indexer
            backfill.
          x-desc-more: >-
            The [node-level][scan-cap-srv] `scan-cap` setting specifies the
            default for this parameter for a single node.

            The request-level parameter overrides the node-level setting, but
            only if it is lower than the node-level setting.


            In addition, the [cluster-level][queryScanCap] `queryScanCap`
            setting specifies the default for this parameter for the whole
            cluster.

            When you change the cluster-level setting, the node-level setting is
            overwritten for all nodes in the cluster.


            [scan-cap-srv]: ../n1ql-rest-admin/index.html#scan-cap-srv

            [queryScanCap]: ../n1ql-rest-settings/index.html#queryScanCap
          x-desc-refs: |-
            [scan-cap-srv]: #scan-cap-srv
            [queryScanCap]: #queryScanCap
          x-has-example: true
          example: 1024
        scan_consistency:
          type: string
          x-desc-name: scan_consistency
          description: >-
            Specifies the consistency guarantee or constraint for index
            scanning.

            The valid values are:


            * `not_bounded` &mdash;

            No timestamp vector is used in the index scan.

            This is the fastest mode, because it avoids the costs of obtaining
            the vector and waiting for the index to catch up to the vector.


            * `at_plus` &mdash;

            This implements bounded consistency.

            The request includes a `scan_vector` parameter and value, which is
            used as a lower bound.

            This can be used to implement read-your-own-writes (RYOW).


            * `request_plus` &mdash;

            This implements strong consistency per request.

            Before processing the request, a current vector is obtained.

            The vector is used as a lower bound for the statements in the
            request.

            If there are DML statements in the request, RYOW is also applied
            within the request.

            (If `request_plus` is specified in a query that runs during a
            failover of an index node, the query waits until the rebalance
            operation completes and the index data has rebalanced before
            returning a result.)


            * `statement_plus` &mdash;

            This implements strong consistency per statement.

            Before processing each statement, a current vector is obtained and
            used as a lower bound for that statement.


            Values are case-insensitive.


            For multi-statement requests, the default behavior is RYOW within
            each request.

            If you want to disable RYOW within a request, add a separate
            `request_consistency` parameter that can be set to `not_bounded`.


            If the request contains a `BEGIN TRANSACTION` statement, or a DML
            statement with the `tximplicit` parameter set to `true`, then this
            parameter sets the transactional scan consistency.

            Refer to [Transactional Scan
            Consistency][transactional-scan-consistency] for details.


            [transactional-scan-consistency]:
            ../n1ql/n1ql-manage/query-settings.html#transactional-scan-consistency
          x-desc-refs: '[transactional-scan-consistency]: #transactional-scan-consistency'
          enum:
            - not_bounded
            - at_plus
            - request_plus
            - statement_plus
          x-has-default: true
          x-has-example: true
          default: not_bounded
          example: at_plus
        scan_vector:
          type: object
          x-type: array
          x-desc-name: scan_vector
          description: >-
            _Required_ if `scan_consistency` is `at_plus` and `scan_vectors` not
            provided.


            Specify the lower bound vector timestamp for one keyspace when using
            `at_plus` scan consistency.


            Scan vectors are built of two-element [`value`, `guard`] entries:


            * `value`: a vBucket's sequence number (a JSON number)

            * `guard`: a vBucket's UUID (a string)


            Scan vectors have two forms:


            1. Full: an array of [`value`, `guard`] entries, giving an entry for
            every vBucket in the system.

            2. Sparse: an object providing entries for specific vBuckets,
            mapping a vBucket number (a string) to each [`value`, `guard`]
            entry.


            Note that `scan_vector` can only be used if the query uses at most
            one keyspace; if it is used for a query referencing more than one
            keyspace, the query will fail with an error.


            For queries referencing multiple keyspaces, use `scan_vectors`.
          x-has-example: true
          example:
            '5':
              - 5409393
              - VB5ID
            '19':
              - 47574574
              - VB19ID
        scan_vectors:
          type: object
          x-type: array
          x-desc-name: scan_vectors
          description: >-
            _Required_ if `scan_consistency` is `at_plus` and `scan_vector` not
            provided.


            A map from keyspace names to scan vectors.

            See `scan_vector`.


            The scan vectors can be Full or Sparse.
        scan_wait:
          type: string
          format: duration
          x-desc-name: scan_wait
          description: >-
            Can be supplied with `scan_consistency` values of `request_plus`,
            `statement_plus` and `at_plus`.


            Specifies the maximum time the client is willing to wait for an
            index to catch up to the vector timestamp in the request.


            Specifies how much time the client is willing to wait for the
            indexer to satisfy the required `scan_consistency` and `scan_vector`
            criteria.

            After receiving the scan request, if the indexer is unable to catch
            up within the `scan_wait` time and initiate the scan, the indexer
            aborts with an error and the scan fails.


            Its format includes an amount and a mandatory unit, e.g. `10ms` (10
            milliseconds) or `0.5s` (half a second).

            Valid units are:


            * `ns` (nanoseconds)

            * `us` (microseconds)

            * `ms` (milliseconds)

            * `s` (seconds)

            * `m` (minutes)

            * `h` (hours)


            Specify `0` or a negative integer to disable.
          x-has-default: true
          x-has-example: true
          default: ''
          example: 30m
        signature:
          type: boolean
          x-desc-name: signature
          description: Include a header for the results schema in the response.
          x-has-default: true
          x-has-example: true
          default: true
          example: false
        sort_projection:
          type: boolean
          x-desc-name: sort_projection
          description: >-
            If `true`, causes statement projection terms to be sorted
            alphabetically.


            If `false` (the default), statement projection terms are returned in
            the order specified by the query.
          x-has-default: true
          x-has-example: true
          default: false
          example: true
        statement:
          type: string
          x-desc-name: statement
          description: >-
            _Required_ if `prepared` or `natural` not provided.


            Any valid SQL++ statement for a POST request, or a read-only SQL++
            statement (SELECT, EXPLAIN) for a GET request.


            If both `prepared` and `statement` are present and non-empty, an
            error is returned.


            ---


            When specifying the request parameters as form data, the statement
            may not contain an unescaped semicolon (`;`).

            If it does, the Query Service responds with error 1040.

            To avoid this, either URL-encode the semicolon as `%3B`, or just
            omit the semicolon if possible.


            This restriction does not apply when specifying the request
            parameters in JSON format.
          x-has-example: true
          example: SELECT * FROM `travel-sample`.inventory.hotel LIMIT 1
        timeout:
          type: string
          format: duration
          x-desc-name: timeout_req
          description: >-
            Maximum time to spend on the request before timing out (s).


            The value for this parameter is a string.

            Its format includes an amount and an optional unit: for example,
            `10ms` (10 milliseconds) or `0.5s` (half a second).

            If not specified, the default unit is `s` (seconds).

            Valid units are:


            * `ns` (nanoseconds)

            * `us` (microseconds)

            * `ms` (milliseconds)

            * `s` (seconds)

            * `m` (minutes)

            * `h` (hours)


            Specify a duration of `0` or a negative duration to disable.

            When disabled, no timeout is applied and the request runs for
            however long it takes.


            If `tximplicit` or `txid` is set, this parameter is ignored.

            The request inherits the remaining time of the transaction as
            timeout.
          x-desc-more: >-
            The [node-level][timeout-srv] `timeout` setting specifies the
            default for this parameter for a single node.

            The request-level parameter overrides the node-level setting.

            However, if the node-level setting is greater than 0, the timeout
            for the query is limited to the node-level setting.


            In addition, the [cluster-level][queryTimeout] `queryTimeout`
            setting specifies the default for this parameter for the whole
            cluster.

            When you change the cluster-level setting, the node-level setting is
            overwritten for all nodes in the cluster.


            [timeout-srv]: ../n1ql-rest-admin/index.html#timeout-srv

            [queryTimeout]: ../n1ql-rest-settings/index.html#queryTimeout
          x-desc-refs: |-
            [timeout-srv]: #timeout-srv
            [queryTimeout]: #queryTimeout
          x-has-example: true
          example: 30m
        txdata:
          type: object
          x-desc-name: txdata
          description: |-
            Transaction data.
            For internal use only.
        txid:
          type: string
          format: UUID
          x-desc-name: txid
          description: >-
            _Required_ for statements within a transaction.


            Transaction ID.

            Specifies the transaction to which a statement belongs.

            For use with DML statements within a transaction, rollbacks, and
            commits.


            The transaction ID should be the same as the transaction ID
            generated by the `BEGIN TRANSACTION` statement.

            The transaction must be active and non-expired.
          x-has-example: true
          example: d81d9b4a-b758-4f98-b007-87ba262d3a51
        tximplicit:
          type: boolean
          x-desc-name: tximplicit
          description: >-
            Specifies that a DML statement is a singleton transaction.


            When this parameter is true, the Query service starts a transaction
            and executes the statement.

            If execution is successful, the Query service commits the
            transaction; otherwise the transaction is rolled back.


            The statement may not be part of an ongoing transaction.

            If the `txid` request-level parameter is set, the `tximplicit`
            parameter is ignored.
          x-has-default: true
          x-has-example: true
          default: false
          example: true
        txstmtnum:
          type: integer
          format: int32
          x-desc-name: txstmtnum
          description: >-
            Transaction statement number.

            The transaction statement number must be a positive integer, and
            must be higher than any previous transaction statement numbers in
            the transaction.

            If the transaction statement number is lower than the transaction
            statement number for any previous statement, an error is generated.
          x-has-example: true
          example: 10
        txtimeout:
          type: string
          format: duration
          x-desc-name: txtimeout_req
          description: >-
            Maximum time to spend on a transaction before timing out.

            Only applies to `BEGIN TRANSACTION` statements, or DML statements
            for which `tximplicit` is set.

            For other statements, it is ignored.


            Within a transaction, the request-level `timeout` parameter is
            ignored.

            The transaction timeout clock starts when the `BEGIN WORK` statement
            is successful.

            Once the transaction timeout is reached, no statement is allowed to
            continue in the transaction.


            The value for this parameter is a string.

            Its format includes an amount and a mandatory unit, e.g. `10ms` (10
            milliseconds) or `0.5s` (half a second).

            Valid units are:


            * `ns` (nanoseconds)

            * `us` (microseconds)

            * `ms` (milliseconds)

            * `s` (seconds)

            * `m` (minutes)

            * `h` (hours)


            Specify a duration of `0` to disable.

            When disabled, the request-level timeout is set to the default.


            The default is `"15s"` for cbq files or scripts, `"2m"` for
            interactive cbq sessions or redirected input.
          x-desc-more: >-
            The [node-level][txtimeout-srv] `txtimeout` setting specifies the
            default for this parameter for a single node.

            The request-level parameter overrides the node-level setting.

            However, if the node-level setting is greater than 0, the
            transaction timeout for the query is limited to the node-level
            setting.


            In addition, the [cluster-level][queryTxTimeout] `queryTxTimeout`
            setting specifies the default for this parameter for the whole
            cluster.

            When you change the cluster-level setting, the node-level setting is
            overwritten for all nodes in the cluster.


            [txtimeout-srv]: ../n1ql-rest-admin/index.html#txtimeout-srv

            [queryTxTimeout]: ../n1ql-rest-settings/index.html#queryTxTimeout
          x-desc-refs: |-
            [txtimeout-srv]: #txtimeout-srv
            [queryTxTimeout]: #queryTxTimeout
          x-has-example: true
          example: 30m
        use_cbo:
          type: boolean
          x-desc-name: use_cbo_req
          description: Specifies whether the cost-based optimizer is enabled.
          x-desc-more: >-
            The [node-level][use-cbo-srv] `use-cbo` setting specifies the
            default for this parameter for a single node.

            The request-level parameter overrides the node-level setting.


            In addition, the [cluster-level][queryUseCBO] `queryUseCBO` setting
            specifies the default for this parameter for the whole cluster.

            When you change the cluster-level setting, the node-level setting is
            overwritten for all nodes in the cluster.


            [use-cbo-srv]: ../n1ql-rest-admin/index.html#use-cbo-srv

            [queryUseCBO]: ../n1ql-rest-settings/index.html#queryUseCBO
          x-desc-refs: |-
            [use-cbo-srv]: #use-cbo-srv
            [queryUseCBO]: #queryUseCBO
          x-has-example: true
          example: true
        use_fts:
          type: boolean
          x-desc-name: use_fts
          x-desc-edition: '{enterprise}'
          description: >-
            Specifies that the query should use a Search index.


            If the query contains a `USING FTS` hint, that takes priority over
            this parameter.


            If the query does not contain a `USING FTS` hint, and this parameter
            is set to true, all Search indexes are considered for the query.

            If a qualified Search index is available, it is selected for the
            query.

            If none of the available Search indexes are qualified, the available
            GSI indexes are considered instead.


            Refer to [Flex Indexes][flex-indexes] for more information.


            [flex-indexes]: ../n1ql/n1ql-language-reference/flex-indexes.html
          x-desc-refs: '[flex-indexes]: ../n1ql-language-reference/flex-indexes.html'
          x-has-default: true
          x-has-example: true
          default: false
          example: true
        use_replica:
          type: string
          enum:
            - 'off'
            - 'on'
            - unset
          x-has-default: true
          x-has-example: true
          default: unset
          example: 'on'
          x-desc-name: use_replica_req
          description: >-
            Specifies whether a query can fetch data from a replica vBucket if
            active vBuckets are inaccessible.

            The possible values are:


            * `off` &mdash; read from replica is disabled for this request.


            * `on` &mdash; read from replica is enabled for this request, unless
            it has been disabled for all requests at node level.


            * `unset` &mdash; read from replica is specified by the node-level
            setting.

            If the node-level setting is also `unset`, read from replica is
            disabled for this request.


            Do not enable read from replica when you require consistent results.

            Only SELECT queries that are not within a transaction can read from
            replica.


            Reading from replica is only possible if the cluster uses Couchbase
            Server 7.6.0 or later.


            Note that KV range scans cannot currently be started on a replica
            vBucket.

            If a query uses sequential scan and a data node becomes unavailable,
            the query might return an error, even if read from replica is
            enabled for the request.
          x-desc-more: >-
            The [node-level][use-replica-srv] `use-replica` setting specifies
            the default for this property for a single node.

            The request-level parameter usually overrides the node-level
            setting.

            However, when the node-level setting is `off`, the request-level
            parameter cannot enable the property.


            In addition, the [cluster-level][queryUseReplica] `queryUseReplica`
            setting specifies the default for this property for the whole
            cluster.

            When you change the cluster-level setting, the node-level setting is
            overwritten for all nodes in the cluster.


            [use-replica-srv]: ../n1ql-rest-admin/index.html#use-replica-srv

            [queryUseReplica]: ../n1ql-rest-settings/index.html#queryUseReplica
          x-desc-refs: |-
            [use-replica-srv]: #use-replica-srv
            [queryUseReplica]: #queryUseReplica
      additionalProperties:
        x-desc-name: identifier
        x-additionalPropertiesName: $identifier
        description: >-
          Supplies the value for a named parameter in the statement.

          Applicable if the statement or prepared statement contains 1 or more
          named parameters.


          The name of this property consists of two parts:


          1. The `$` character or the `@` character.

          2. An identifier that specifies the name of the parameter.
              This starts with an optional underscore (`_`), followed by an alpha character, followed by one or more alphanumeric characters, and ends with an optional underscore (`_`).

          If the named parameter contains sensitive information, start and end
          the name of the parameter (after the initial `$` or `@`) with an
          underscore (`_`).

          This masks the parameter value in the active requests catalog, the
          completed requests catalog, the response `controls` section, the cbq
          shell file history, and the query logs.

          When masked, a string parameter value is replaced by asterisks (`*`);
          other parameter values are replaced by `null`.

          Parameter masking is available in clusters running Couchbase Server
          7.6.8 and later.


          The value of the named parameter can be any JSON value.


          Refer to [Named Parameters and Positional
          Parameters][section_srh_tlm_n1b] for details.


          [section_srh_tlm_n1b]:
          ../n1ql/n1ql-manage/query-settings.html#section_srh_tlm_n1b
        x-desc-refs: '[section_srh_tlm_n1b]: #section_srh_tlm_n1b'
        example: LAX
        x-has-example: true
    Conditions:
      type: object
      description: Errors and warnings have the following format.
      required:
        - code
        - msg
      properties:
        code:
          type: integer
          description: >-
            A unique number that identifies the error or warning.

            The code ranges are partitioned by component.

            The codes can also include parts that indicate severity and
            transience.

            This property is always present in every condition returned in the
            Query REST API or captured in a log.
        msg:
          type: string
          description: >-
            A message describing the error or warning in detail.

            This property is always present in every condition returned in the
            Query REST API or captured in a log.
        name:
          type: string
          description: >-
            Unique name that has a 1:1 mapping to the code.

            Uniquely identifies the condition.

            This property is helpful for pattern matching and can have meaning,
            making it more memorable than the code.

            The name should be fully qualified.
          x-has-example: true
          example: indexing.scan.io_failure
          x-example: query.execute.index_not_found
        sev:
          type: integer
          description: >-
            One of the following SQL++ severity levels, listed in order of
            severity:

             1. Severe
             2. Error
             3. Warn
             4. Info
        temp:
          type: boolean
          description: >-
            Indicates if the condition is transient &mdash; for example, the
            queue is full.

            If the value is `false`, it tells clients and users that a retry
            without modification produces the same condition.
    Metrics:
      type: object
      description: An object containing metrics about the request.
      required:
        - elapsedTime
        - executionTime
        - resultCount
        - resultSize
      properties:
        elapsedTime:
          type: string
          format: duration
          description: >-
            The total time taken for the request, that is the time from when the
            request was received until the results were returned.
        executionTime:
          type: string
          format: duration
          description: >-
            The time taken for the execution of the request, that is the time
            from when query execution started until the results were returned.
        resultCount:
          type: integer
          format: unsigned
          description: The total number of objects in the results.
        resultSize:
          type: integer
          format: unsigned
          description: The total number of bytes in the results.
        naturalLanguageProcessingTime:
          type: string
          format: duration
          description: >-
            The total time spent processing a natural language request.

            The cumulation of authentication, collecting schema, and time
            waiting for the response from the LLM, or wait time for the natural
            language request to be serviced.
        mutationCount:
          type: integer
          description: The number of mutations that were made during the request.
          format: unsigned
        sortCount:
          type: integer
          format: unsigned
          description: >-
            The number of objects that were sorted.

            Present only if the request includes `ORDER BY`.


            If a query includes ORDER BY, LIMIT, or OFFSET clauses, an
            application can use the `sortCount` value to give the overall number
            of results in a message such as `"page 1 of N"`.
        usedMemory:
          type: integer
          format: unsigned
          description: >-
            The amount of document memory used to execute the request.

            This property is only returned if a memory quota was set for the
            query.
        errorCount:
          type: integer
          format: unsigned
          description: The number of errors that occurred during the request.
        warningCount:
          type: integer
          format: unsigned
          description: The number of warnings that occurred during the request.
        sessionMemory:
          type: integer
          format: bytes
          description: >-
            The memory session size for the request, in bytes.


            Each request has a dedicated memory session.

            When a query requires a document or value, memory is allocated from
            this session based on the size of the document or value.

            Once the document or value is processed, the allocated memory is
            returned back to the session, enabling it to be reused by the
            request.


            This metric is available only when `node-quota` and
            `node-quota-val-percent` are configured for the node.
    Controls:
      type: object
      description: >-
        An object containing runtime information provided along with the
        request.

        Present only if `controls` was set to true in the request parameters.
      properties:
        scan_consistency:
          type: string
          description: The value of the query setting Scan Consistency used for the query.
        use_cbo:
          type: boolean
          description: Whether the cost-based optimizer was enabled for the query.
        memoryQuota:
          type: integer
          format: unsigned
          description: >-
            The memory quota for the request, in MB.

            This property is only returned if a memory quota was set for the
            query.
        stmtType:
          type: string
          description: The type of query statement.
          x-has-example: true
          example: SELECT
    Profile:
      type: object
      description: >-
        An object containing monitoring and profiling information about the
        request.

        Present only if `profile` was set to `"phases"` or `"timings"` in the
        request parameters.
      required:
        - requestTime
        - servicingHost
        - phaseCounts
        - phaseOperators
        - phaseTimes
      properties:
        requestTime:
          type: string
          format: date-time
          description: Timestamp when the query was received.
        servicingHost:
          type: string
          description: IP address and port number of the node where the query was executed.
        phaseCounts:
          type: object
          description: >-
            Count of documents processed at selective phases involved in the
            query execution, such as authorize, index scan, fetch, parse, plan,
            run, etc.
          x-has-example: true
          example:
            fetch: 16
            indexScan: 187
        phaseOperators:
          type: object
          description: >-
            Indicates the numbers of each kind of query operator involved in
            different phases of the query processing.


            For instance, a non-covering index path might involve one index scan
            and one fetch operator.

            A join would probably involve two or more fetches, one per keyspace.

            A union select would have twice as many operator counts, one per
            each branch of the union.


            This is in essence the count of all the operators in the
            `executionTimings` object.
          x-has-example: true
          example:
            authorize: 1
            fetch: 1
            indexScan: 2
        phaseTimes:
          type: object
          description: >-
            Cumulative execution times for various phases involved in the query
            execution, such as authorize, index scan, fetch, parse, plan, run,
            etc.
          x-has-example: true
          example:
            authorize: 823.631µs
            fetch: 656.873µs
            indexScan: 29.146543ms
            instantiate: 236.221µs
            parse: 826.382µs
            plan: 11.831101ms
            run: 16.892181ms
        executionTimings:
          type: object
          title: Execution Timings
          description: >-
            Present only if `profile` was set to `"timings"` in the request
            parameters.


            The execution details for various phases involved in the query
            execution, such as kernel and service execution times, number of
            documents processed at each query operator in each phase, and number
            of phase switches.
          required:
            - '#operator'
            - '#stats'
          properties:
            '#operator':
              type: string
              description: Name of the operator.
              x-has-example: true
              example: Fetch
            '#stats':
              type: object
              title: Statistics
              description: Statistics collected for the operator.
              properties:
                '#itemsIn':
                  type: integer
                  format: int32
                  description: Number of input documents to the operator.
                  x-has-example: true
                  example: 187
                '#itemsOut':
                  type: integer
                  format: int32
                  description: Number of output documents after the operator processing.
                  x-has-example: true
                  example: 16
                '#phaseSwitches':
                  type: integer
                  format: int32
                  description: >-
                    Number of switches between executing, waiting for services,
                    or waiting for the goroutine scheduler.
                  x-has-example: true
                  example: 413
                execTime:
                  type: string
                  format: duration
                  x-desc-name: exec_time
                  description: >-
                    Time spent executing the operator code inside SQL++ query
                    engine.
                  x-has-example: true
                  example: 128.434µs
                kernTime:
                  type: string
                  format: duration
                  x-desc-name: kern_time
                  description: Time spent waiting to be scheduled for CPU time.
                  x-has-example: true
                  example: 15.027879ms
                servTime:
                  type: string
                  format: duration
                  x-desc-name: serv_time
                  description: >-
                    Time spent waiting for another service, such as index or
                    data.


                    For index scan, it is time spent waiting for GSI/indexer.


                    For fetch, it is time spent waiting on the KV store.
                  x-has-example: true
                  example: 1.590934ms
            ~child:
              type: object
              description: 'Further nested operators, each with their own execution timings.'
        ioTime:
          type: string
          format: duration
          description: |
            The total sum of [servTime](#serv_time) across all operators.
          x-has-example: true
          example: 752.858519ms
        waitTime:
          type: string
          format: duration
          description: |
            The total sum of [kernTime](#kern_time) across all operators.
          x-has-example: true
          example: 1.201307s
        cpuTime:
          type: string
          format: duration
          description: |
            The total sum of [execTime](#exec_time) across all operators.
          x-has-example: true
          example: 90.734075ms
        ~analysis:
          type: array
          items:
            type: string
          description: >
            An array of text phrases that provide a basic analysis of the
            request execution.

            These phrases highlight notable aspects of the execution, such as
            high document counts during primary scans or warnings related to
            memory and resource usages.
          x-has-example: true
          example:
            - High IO time
            - High primary scan document count
    Response:
      type: object
      title: Response Body
      description: The response body has the following structure.
      properties:
        requestID:
          type: string
          format: UUID
          description: A unique identifier for the response.
        clientContextID:
          type: string
          description: >-
            The client context ID of the request, if one was supplied &mdash;
            see `client_context_id` in the request parameters.
        generated_statement:
          type: string
          x-desc-status: Couchbase Server 8.0
          description: >-
            The generated statement, if the request was a natural language
            prompt.
          x-has-example: true
          example: >-
            SELECT country, COUNT(*) AS `airline_count` FROM
            `travel-sample`.`inventory`.`airline` AS `a` GROUP BY country
        signature:
          type: object
          description: |-
            The schema of the results.
            Present only when the query completes successfully.
          x-has-example: true
          example:
            id: json
        results:
          type: array
          items: {}
          description: |-
            An array of all the objects returned by the query.
            An object can be any JSON value.
        status:
          type: string
          description: The status of the request.
          enum:
            - success
            - running
            - errors
            - completed
            - stopped
            - timeout
            - fatal
        errors:
          type: array
          description: >-
            An array of 0 or more error objects.

            If an error occurred during processing of the request, it will be
            represented by an error object in this list.
          items:
            $ref: '#/components/schemas/Conditions'
        warnings:
          type: array
          description: >-
            An array of 0 or more warning objects.

            If a warning occurred during processing of the request, it is
            represented by a warning object in this list.
          items:
            $ref: '#/components/schemas/Conditions'
        metrics:
          $ref: '#/components/schemas/Metrics'
        controls:
          $ref: '#/components/schemas/Controls'
        profile:
          $ref: '#/components/schemas/Profile'
    CommonStatus:
      type: string
      title: Status
      description: The status of the operation.
    DocumentCount:
      type: object
      title: Document Count
      properties:
        status:
          $ref: '#/components/schemas/CommonStatus'
        count:
          type: integer
          description: The document count for the specified index.
    QueryRequest:
      type: object
      title: Query Request
      properties:
        query:
          type: object
          description: >-
            An object that contains the properties for one of the supported
            query types.

            For more information, see [Query
            Object](../search/search-request-params.html#query-object).
        knn:
          type: array
          description: >-
            An array that contains objects that describe a Vector Search query.

            For more information, see [Knn
            Objects](../search/search-request-params.html#knn-object).
          items:
            type: object
        ctl:
          type: object
          description: >-
            An object that contains properties for query consistency.

            For more information, see [Ctl
            Object](../search/search-request-params.html#ctl).
        size:
          type: integer
          description: >-
            Set the total number of results to return for a single page of
            search results.
        from:
          type: integer
          description: >-
            Set an offset value to change where pagination starts for search
            results.
        highlight:
          type: object
          description: >-
            Contains properties to control search result highlighting.

            For more information, see [Highlight
            Objects](../search/search-request-params.html#highlight).
        fields:
          type: array
          description: >-
            An array of strings to specify each indexed field you want to return
            in search results.
          items:
            type: string
        facets:
          type: object
          description: >-
            Contains nested objects to define each facet you want to return with
            search results.

            For more information, see [Facet
            Objects](../search/search-request-params.html#facet-name).
        explain:
          type: boolean
          description: >-
            Whether to create an explanation for a search result's score in
            search results.
        sort:
          type: array
          description: >-
            Contains an array of strings or JSON objects to set how to sort
            search results.

            For more information, see [Sort
            Object](../search/search-request-params.html#sort).
          items: {}
        includeLocations:
          type: boolean
          description: >-
            Whether to return the position of each occurrence of a search term
            inside a document.
        score:
          type: string
          description: Whether to include document relevancy scoring in search results.
        search_after:
          type: array
          description: Use to control pagination in search results.
          items:
            type: string
        search_before:
          type: array
          description: Use to control pagination in search results.
          items:
            type: string
        collections:
          type: array
          description: >-
            An array of strings that specify the collections where you want to
            run the query.
          items:
            type: string
    QueryResponse:
      type: object
      title: Query Response
      properties:
        status:
          $ref: '#/components/schemas/CommonStatus'
        results:
          type: array
          description: The results of the Search query.
          items:
            type: object
    CommonIndexName:
      type: string
      title: Index Name
      description: >-
        The name of the Search index.

        For more information, see [Initial
        Settings](../search/search-index-params.html#initial).
    CommonIndexType:
      type: string
      title: Index Type
      description: >-
        The type of the Search index.

        For more information, see [Initial
        Settings](../search/search-index-params.html#initial).
    CommonSourceName:
      type: string
      title: Source Name
      description: >-
        The name of the bucket where the Search index is stored.

        For more information, see [Initial
        Settings](../search/search-index-params.html#initial).
    CommonSourceUUID:
      type: string
      title: Source UUID
      description: >-
        The UUID of the bucket where the Search index is stored.

        For more information, see [Initial
        Settings](../search/search-index-params.html#initial).
    CommonSourceParams:
      type: object
      title: Source Parameters
      description: >-
        Advanced settings for Search index behavior.

        For more information, see [Initial
        Settings](../search/search-index-params.html#initial).
    CommonSourceType:
      type: string
      title: Source Type
      description: >-
        The type of the bucket where the Search index is stored.

        For more information, see [Initial
        Settings](../search/search-index-params.html#initial).
    CommonIndexParams:
      type: object
      title: Index Parameters
      description: >-
        The Search index's type identifier, type mappings, and analyzers.

        For more information, see [Params
        Object](../search/search-index-params.html#params).
    IndexDefinitionPlanParams:
      title: Plan Parameters
      type: object
      description: >-
        The Search index's partitioning and replication settings.

        For more information, see [Plan Params
        Object](../search/search-index-params.html#planParams).
      properties:
        hierarchyRules:
          type: string
          nullable: true
        maxPartitionsPerPIndex:
          type: integer
          description: |-
            This setting is deprecated.
            Use `indexPartitions` instead.
        indexPartitions:
          type: integer
          description: >-
            The number of partitions to split the Search index into, across the
            nodes you have available in your database with the Search Service
            enabled.
        nodePlanParams:
          type: string
          nullable: true
        numReplicas:
          type: integer
          description: >-
            The number of replicas the Search Service creates for the Search
            index to ensure high availability.
        planFrozen:
          type: boolean
    CommonIndexUUID:
      type: string
      title: Index UUID
      description: >-
        The UUID of the Search index.

        For more information, see [Initial
        Settings](../search/search-index-params.html#initial).
    IndexDefinition:
      type: object
      title: Index Definition
      description: >-
        The full Search index definition.

        For a detailed list of all parameters, see [Search Index JSON
        Properties](../search/search-index-params.html).
      properties:
        name:
          $ref: '#/components/schemas/CommonIndexName'
        type:
          $ref: '#/components/schemas/CommonIndexType'
        sourceName:
          $ref: '#/components/schemas/CommonSourceName'
        sourceUUID:
          $ref: '#/components/schemas/CommonSourceUUID'
        sourceParams:
          $ref: '#/components/schemas/CommonSourceParams'
        sourceType:
          $ref: '#/components/schemas/CommonSourceType'
        params:
          $ref: '#/components/schemas/CommonIndexParams'
        planParams:
          $ref: '#/components/schemas/IndexDefinitionPlanParams'
        prevIndexUUID:
          type: string
          writeOnly: true
          description: >-
            The UUID of the previous index.

            Intended for clients that want to check that they are not
            overwriting the Search index definition updates of concurrent
            clients.
        uuid:
          $ref: '#/components/schemas/CommonIndexUUID'
      required:
        - name
        - type
        - sourceName
        - sourceType
        - params
        - planParams
    GetIndexesResponseIndexesWrapper:
      title: Index Definitions Wrapper
      type: object
      description: An object containing 1 or more Search index definitions.
      additionalProperties:
        x-additionalPropertiesName: Index Name
        $ref: '#/components/schemas/IndexDefinition'
    GetIndexesResponseIndexes:
      title: Index Definitions
      type: object
      description: An object containing Search index definitions and related information.
      properties:
        implVersion:
          type: string
        indexDefs:
          $ref: '#/components/schemas/GetIndexesResponseIndexesWrapper'
        uuid:
          type: string
    GetIndexesResponse:
      type: object
      title: Indexes Response
      properties:
        indexDefs:
          $ref: '#/components/schemas/GetIndexesResponseIndexes'
        status:
          $ref: '#/components/schemas/CommonStatus'
    CommonPIndexName:
      type: string
      title: Partition Name
      description: The name of the Search index partition.
    GetIndexResponsePIndexNodesWrapperNode:
      type: object
      title: Partition Node
      description: >-
        An object containing information about a single Search index partition
        node.

        The name of the property is the node UUID.
      properties:
        canRead:
          type: boolean
        canWrite:
          type: boolean
        priority:
          type: integer
    GetIndexResponsePIndexNodesWrapper:
      type: object
      title: Partition Nodes Wrapper
      description: >-
        An object containing information about 1 or more Search index partition
        nodes.
      additionalProperties:
        x-additionalPropertiesName: Node UUID
        $ref: '#/components/schemas/GetIndexResponsePIndexNodesWrapperNode'
    CommonPIndexUUID:
      type: string
      title: Partition UUID
      description: The UUID of the Search index partition.
    GetIndexResponsePIndex:
      type: object
      title: Plan Partition
      description: An object containing information about a single Search index partition.
      properties:
        indexName:
          $ref: '#/components/schemas/CommonIndexName'
        indexParams:
          $ref: '#/components/schemas/CommonIndexParams'
        indexType:
          $ref: '#/components/schemas/CommonIndexType'
        indexUUID:
          $ref: '#/components/schemas/CommonIndexUUID'
        name:
          $ref: '#/components/schemas/CommonPIndexName'
        nodes:
          $ref: '#/components/schemas/GetIndexResponsePIndexNodesWrapper'
        sourceName:
          $ref: '#/components/schemas/CommonSourceName'
        sourceParams:
          $ref: '#/components/schemas/CommonSourceParams'
        sourcePartitions:
          type: string
        sourceType:
          $ref: '#/components/schemas/CommonSourceType'
        sourceUUID:
          $ref: '#/components/schemas/CommonSourceUUID'
        uuid:
          $ref: '#/components/schemas/CommonPIndexUUID'
    GetIndexResponse:
      type: object
      title: Index Response
      properties:
        indexDef:
          $ref: '#/components/schemas/IndexDefinition'
        planPIndexes:
          type: array
          description: >-
            An array of objects, each containing information about a single
            Search index partition.
          items:
            $ref: '#/components/schemas/GetIndexResponsePIndex'
        status:
          $ref: '#/components/schemas/CommonStatus'
        warnings:
          type: array
          description: An array of warnings.
          items:
            type: string
    PutIndexResponse:
      type: object
      title: Create or Update Response
      properties:
        status:
          $ref: '#/components/schemas/CommonStatus'
        name:
          $ref: '#/components/schemas/CommonIndexName'
        uuid:
          $ref: '#/components/schemas/CommonIndexUUID'
    DeleteIndexResponse:
      type: object
      title: Delete Response
      properties:
        status:
          $ref: '#/components/schemas/CommonStatus'
        uuid:
          $ref: '#/components/schemas/CommonIndexUUID'
  parameters:
    AuthorizationHeader:
      in: header
      name: Authorization
      description: Header for authentication.
      schema:
        type: string
      required: true
    AcceptEncodingHeader:
      in: header
      name: Accept-Encoding
      description: >-
        Specifies the compression used for the response in HTTP
        content-negotiation format.
      schema:
        type: string
    ContentEncodingHeader:
      in: header
      name: Content-Encoding
      description: The Content-Encoding of the body of the request.
      schema:
        $ref: '#/components/schemas/DocumentEncoding'
    IfMatchHeader:
      in: header
      name: If-Match
      description: The CAS of the document to check before updating.
      schema:
        type: string
    ExpiresHeader:
      in: header
      name: Expires
      description: >-
        The expiry time to set for the document, specified as a HTTP Date header
        or Go Duration string.
      schema:
        type: string
    DocumentFlagsHeader:
      in: header
      name: X-CB-Flags
      description: >-
        Overrides the document flags to a custom value rather than using values
        based on the Content-Type header.
      schema:
        type: integer
        format: uint32
    DurabilityLevelHeader:
      in: header
      name: X-CB-DurabilityLevel
      description: >-
        The level of durability required for this write operation.

        For details, see
        [Durability](https://docs.couchbase.com/server/current/learn/data/durability.html).
      schema:
        $ref: '#/components/schemas/DurabilityLevel'
    BucketName:
      in: path
      name: bucketName
      description: The name of the bucket containing the document.
      schema:
        type: string
      required: true
    ScopeName:
      in: path
      name: scopeName
      description: The name of the scope containing the document.
      schema:
        type: string
      required: true
    CollectionName:
      in: path
      name: collectionName
      description: The name of the collection containing the document.
      schema:
        type: string
      required: true
    DocumentKey:
      in: path
      name: documentKey
      description: The ID of the document.
      schema:
        type: string
      required: true
    PathIndexFull:
      name: INDEX_NAME
      in: path
      required: true
      schema:
        type: string
      description: >-
        The name of the Search index definition.

        You must use the fully qualified name for the index, which includes the
        bucket and scope.


        To view the full, scoped name for an index for use with this endpoint:


        1. Go to the **Search** tab in the Couchbase Server Web Console.

        2. Point to the **Index Name** for an index.
    PathBucket:
      name: BUCKET_NAME
      in: path
      required: true
      schema:
        type: string
      description: The name of the bucket containing the Search index definition.
    PathScope:
      name: SCOPE_NAME
      in: path
      required: true
      schema:
        type: string
      description: The name of the scope containing the Search index definition.
    PathIndex:
      name: INDEX_NAME
      in: path
      required: true
      schema:
        type: string
        pattern: '^[A-Za-z][0-9A-Za-z_\-]*$'
      description: The name of the Search index definition.
  headers:
    ContentEncoding:
      description: The encoding of the document
      schema:
        $ref: '#/components/schemas/DocumentEncoding'
    ETag:
      description: The CAS of the document.
      schema:
        type: string
    Expires:
      description: The expiry time of the document represented as an HTTP Date header.
      schema:
        type: string
    DocumentFlags:
      description: The flags of the document.
      schema:
        type: integer
        format: uint32
    MutationToken:
      schema:
        type: string
      description: A token representing the mutation of the document.
x-tagGroups:
  - name: Data API
    tags:
      - Health Check
      - Basic Document Operations
      - Binary Operations
      - Locking Operations
      - Sub-Document Operations
  - name: Query Service
    tags:
      - Query
      - Query Indexes
  - name: Search Service
    tags:
      - Search
      - Search Indexes

