openapi: 3.0.2
info:
  title: Query Suggestions API
  description: >
    The Query Suggestions API lets you manage your Query Suggestions
    configurations.

    Query Suggestions add new indices to your Algolia application with popular
    search queries, external suggestions, or facet values.

    In your user interface, you can query the Query Suggestions indices like
    regular indices and add [suggested
    searches](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/query-suggestions/js/)
    to guide users and speed up their search.


    ## Base URLs


    The base URLs for requests to the Query Suggestions API are:


    - `https://query-suggestions.us.algolia.com`

    - `https://query-suggestions.eu.algolia.com`


    Use the URL that matches your [analytics
    region](https://dashboard.algolia.com/account/infrastructure/analytics).


    **All requests must use HTTPS.**


    ## Authentication


    To authenticate your API requests, add these headers:


    - `x-algolia-application-id`. Your Algolia application ID.

    - `x-algolia-api-key`. An API key with the necessary permissions to make the
    request.
      The required access control list (ACL) to make a request is listed in each endpoint's reference.

    You can find your application ID and API key in the [Algolia
    dashboard](https://dashboard.algolia.com/account).


    ## Request format


    Request bodies must be JSON objects.


    ## Response status and errors


    Response bodies are JSON objects.

    Deleting a user token returns an empty response body with rate-limiting
    information as headers.


    Successful responses return a `2xx` status. Client errors return a `4xx`
    status. Server errors are indicated by a `5xx` status.

    Error responses have a `message` property with more information.


    ## Version


    The current version of the Query Suggestions API is version 1, as indicated
    by the `/1/` in each endpoint's URL.
  version: 1.0.0
servers:
  - url: https://query-suggestions.{region}.algolia.com
    description: >
      You can check the region for your application in the [Algolia
      dashboard](https://dashboard.algolia.com/account/infrastructure/analytics).

      If you connect to the wrong region, the API returns an error with the
      status `401` and the message: "The log processing region does not match".
    variables:
      region:
        enum:
          - us
          - eu
        default: us
security:
  - appId: []
    apiKey: []
tags:
  - name: configurations
    x-displayName: Configurations
    description: Manage Query Suggestions configurations.
  - name: logs
    x-displayName: Logs
    description: Get logs for a Query Suggestions index.
paths:
  /{path}:
    get:
      operationId: customGet
      summary: Send requests to the Algolia REST API
      description: This method allow you to send requests to the Algolia REST API.
      parameters:
        - $ref: '#/components/parameters/PathInPath'
        - $ref: '#/components/parameters/Parameters'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
        '400':
          $ref: '#/components/responses/BadRequest'
        '402':
          $ref: '#/components/responses/FeatureNotEnabled'
        '403':
          $ref: '#/components/responses/MethodNotAllowed'
        '404':
          $ref: '#/components/responses/IndexNotFound'
      x-codeSamples:
        - lang: csharp
          label: C#
          source: |
            // Initialize the client
            var client = new QuerySuggestionsClient(
              new QuerySuggestionsConfig("YOUR_APP_ID", "YOUR_API_KEY", "YOUR_APP_ID_REGION")
            );

            // Call the API
            var response = await client.CustomGetAsync("test/minimal");
        - lang: go
          label: Go
          source: >
            // Initialize the client with your application region, eg.
            suggestions.YOUR_APP_ID_REGION

            client, err := suggestions.NewClient("YOUR_APP_ID", "YOUR_API_KEY",
            suggestions.US)

            if err != nil {
              // The client can fail to initialize if you pass an invalid parameter.
              panic(err)
            }


            // Call the API

            resp, err := client.CustomGet(client.NewApiCustomGetRequest(
              "test/minimal",
            ))

            if err != nil {
              // handle the eventual error
              panic(err)
            }


            // use the model directly

            print(resp)
        - lang: java
          label: Java
          source: >
            // Initialize the client

            QuerySuggestionsClient client = new
            QuerySuggestionsClient("YOUR_APP_ID", "YOUR_API_KEY",
            "YOUR_APP_ID_REGION");


            // Call the API

            client.customGet("test/minimal");
        - lang: javascript
          label: JavaScript
          source: |
            // Initialize the client
            const client = querySuggestionsClient(
              'YOUR_APP_ID',
              'YOUR_API_KEY',
              'YOUR_APP_ID_REGION'
            );

            // Call the API
            const response = await client.customGet({ path: 'test/minimal' });

            // use typed response
            console.log(response);
        - lang: kotlin
          label: Kotlin
          source: >
            // Initialize the client

            val client = QuerySuggestionsClient(appId = "YOUR_APP_ID", apiKey =
            "YOUR_API_KEY", region = "YOUR_APP_ID_REGION")


            // Call the API

            var response = client.customGet(
              path = "test/minimal",
            )


            // Use the response

            println(response)
        - lang: php
          label: PHP
          source: >
            // Initialize the client

            $client =
            Algolia\AlgoliaSearch\Api\QuerySuggestionsClient::create('<YOUR_APP_ID>',
            '<YOUR_API_KEY>', 'YOUR_APP_ID_REGION');


            // Call the API

            $response = $client->customGet(
                'test/minimal',
            );


            // play with the response

            var_dump($response);
        - lang: python
          label: Python
          source: |
            # Initialize the client
            _client = QuerySuggestionsClient(
                "YOUR_APP_ID", "YOUR_API_KEY", "YOUR_APP_ID_REGION"
            )

            # Call the API
            resp = await _client.custom_get(
                path="test/minimal",
            )

            # use the class directly
            print(resp)

            # print the JSON response
            print(resp.to_json())
        - lang: ruby
          label: Ruby
          source: |
            # Initialize the client
            client = Algolia::QuerySuggestionsClient.create(
              'YOUR_APP_ID',
              'YOUR_API_KEY',
              'YOUR_APP_ID_REGION'
            )

            # Call the API
            resp = client.custom_get("test/minimal")

            # use the class directly
            puts resp

            # print the JSON response
            puts resp.to_json
        - lang: scala
          label: Scala
          source: >
            // Initialize the client

            val client = QuerySuggestionsClient(appId = "YOUR_APP_ID", apiKey =
            "YOUR_API_KEY", region = "YOUR_APP_ID_REGION")


            // Call the API

            val res = client.customGet[JObject](
              path = "test/minimal"
            )


            // Use the response

            val value = Await.result(res, Duration(100, "sec"))
        - lang: swift
          label: Swift
          source: >
            // Initialize the client

            let client = try QuerySuggestionsClient(appID: "YOUR_APP_ID",
            apiKey: "YOUR_API_KEY", region: .us)


            // Call the API

            _ = try await client.customGet(path: "test/minimal")
    post:
      operationId: customPost
      requestBody:
        description: Parameters to send with the custom request.
        content:
          application/json:
            schema:
              type: object
      summary: Send requests to the Algolia REST API
      description: This method allow you to send requests to the Algolia REST API.
      parameters:
        - $ref: '#/components/parameters/PathInPath'
        - $ref: '#/components/parameters/Parameters'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
        '400':
          $ref: '#/components/responses/BadRequest'
        '402':
          $ref: '#/components/responses/FeatureNotEnabled'
        '403':
          $ref: '#/components/responses/MethodNotAllowed'
        '404':
          $ref: '#/components/responses/IndexNotFound'
      x-codeSamples:
        - lang: csharp
          label: C#
          source: |
            // Initialize the client
            var client = new QuerySuggestionsClient(
              new QuerySuggestionsConfig("YOUR_APP_ID", "YOUR_API_KEY", "YOUR_APP_ID_REGION")
            );

            // Call the API
            var response = await client.CustomPostAsync("test/minimal");
        - lang: go
          label: Go
          source: >
            // Initialize the client with your application region, eg.
            suggestions.YOUR_APP_ID_REGION

            client, err := suggestions.NewClient("YOUR_APP_ID", "YOUR_API_KEY",
            suggestions.US)

            if err != nil {
              // The client can fail to initialize if you pass an invalid parameter.
              panic(err)
            }


            // Call the API

            resp, err := client.CustomPost(client.NewApiCustomPostRequest(
              "test/minimal",
            ))

            if err != nil {
              // handle the eventual error
              panic(err)
            }


            // use the model directly

            print(resp)
        - lang: java
          label: Java
          source: >
            // Initialize the client

            QuerySuggestionsClient client = new
            QuerySuggestionsClient("YOUR_APP_ID", "YOUR_API_KEY",
            "YOUR_APP_ID_REGION");


            // Call the API

            client.customPost("test/minimal");
        - lang: javascript
          label: JavaScript
          source: |
            // Initialize the client
            const client = querySuggestionsClient(
              'YOUR_APP_ID',
              'YOUR_API_KEY',
              'YOUR_APP_ID_REGION'
            );

            // Call the API
            const response = await client.customPost({ path: 'test/minimal' });

            // use typed response
            console.log(response);
        - lang: kotlin
          label: Kotlin
          source: >
            // Initialize the client

            val client = QuerySuggestionsClient(appId = "YOUR_APP_ID", apiKey =
            "YOUR_API_KEY", region = "YOUR_APP_ID_REGION")


            // Call the API

            var response = client.customPost(
              path = "test/minimal",
            )


            // Use the response

            println(response)
        - lang: php
          label: PHP
          source: >
            // Initialize the client

            $client =
            Algolia\AlgoliaSearch\Api\QuerySuggestionsClient::create('<YOUR_APP_ID>',
            '<YOUR_API_KEY>', 'YOUR_APP_ID_REGION');


            // Call the API

            $response = $client->customPost(
                'test/minimal',
            );


            // play with the response

            var_dump($response);
        - lang: python
          label: Python
          source: |
            # Initialize the client
            _client = QuerySuggestionsClient(
                "YOUR_APP_ID", "YOUR_API_KEY", "YOUR_APP_ID_REGION"
            )

            # Call the API
            resp = await _client.custom_post(
                path="test/minimal",
            )

            # use the class directly
            print(resp)

            # print the JSON response
            print(resp.to_json())
        - lang: ruby
          label: Ruby
          source: |
            # Initialize the client
            client = Algolia::QuerySuggestionsClient.create(
              'YOUR_APP_ID',
              'YOUR_API_KEY',
              'YOUR_APP_ID_REGION'
            )

            # Call the API
            resp = client.custom_post("test/minimal")

            # use the class directly
            puts resp

            # print the JSON response
            puts resp.to_json
        - lang: scala
          label: Scala
          source: >
            // Initialize the client

            val client = QuerySuggestionsClient(appId = "YOUR_APP_ID", apiKey =
            "YOUR_API_KEY", region = "YOUR_APP_ID_REGION")


            // Call the API

            val res = client.customPost[JObject](
              path = "test/minimal"
            )


            // Use the response

            val value = Await.result(res, Duration(100, "sec"))
        - lang: swift
          label: Swift
          source: >
            // Initialize the client

            let client = try QuerySuggestionsClient(appID: "YOUR_APP_ID",
            apiKey: "YOUR_API_KEY", region: .us)


            // Call the API

            _ = try await client.customPost(path: "test/minimal")
    put:
      operationId: customPut
      requestBody:
        description: Parameters to send with the custom request.
        content:
          application/json:
            schema:
              type: object
      summary: Send requests to the Algolia REST API
      description: This method allow you to send requests to the Algolia REST API.
      parameters:
        - $ref: '#/components/parameters/PathInPath'
        - $ref: '#/components/parameters/Parameters'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
        '400':
          $ref: '#/components/responses/BadRequest'
        '402':
          $ref: '#/components/responses/FeatureNotEnabled'
        '403':
          $ref: '#/components/responses/MethodNotAllowed'
        '404':
          $ref: '#/components/responses/IndexNotFound'
      x-codeSamples:
        - lang: csharp
          label: C#
          source: |
            // Initialize the client
            var client = new QuerySuggestionsClient(
              new QuerySuggestionsConfig("YOUR_APP_ID", "YOUR_API_KEY", "YOUR_APP_ID_REGION")
            );

            // Call the API
            var response = await client.CustomPutAsync("test/minimal");
        - lang: go
          label: Go
          source: >
            // Initialize the client with your application region, eg.
            suggestions.YOUR_APP_ID_REGION

            client, err := suggestions.NewClient("YOUR_APP_ID", "YOUR_API_KEY",
            suggestions.US)

            if err != nil {
              // The client can fail to initialize if you pass an invalid parameter.
              panic(err)
            }


            // Call the API

            resp, err := client.CustomPut(client.NewApiCustomPutRequest(
              "test/minimal",
            ))

            if err != nil {
              // handle the eventual error
              panic(err)
            }


            // use the model directly

            print(resp)
        - lang: java
          label: Java
          source: >
            // Initialize the client

            QuerySuggestionsClient client = new
            QuerySuggestionsClient("YOUR_APP_ID", "YOUR_API_KEY",
            "YOUR_APP_ID_REGION");


            // Call the API

            client.customPut("test/minimal");
        - lang: javascript
          label: JavaScript
          source: |
            // Initialize the client
            const client = querySuggestionsClient(
              'YOUR_APP_ID',
              'YOUR_API_KEY',
              'YOUR_APP_ID_REGION'
            );

            // Call the API
            const response = await client.customPut({ path: 'test/minimal' });

            // use typed response
            console.log(response);
        - lang: kotlin
          label: Kotlin
          source: >
            // Initialize the client

            val client = QuerySuggestionsClient(appId = "YOUR_APP_ID", apiKey =
            "YOUR_API_KEY", region = "YOUR_APP_ID_REGION")


            // Call the API

            var response = client.customPut(
              path = "test/minimal",
            )


            // Use the response

            println(response)
        - lang: php
          label: PHP
          source: >
            // Initialize the client

            $client =
            Algolia\AlgoliaSearch\Api\QuerySuggestionsClient::create('<YOUR_APP_ID>',
            '<YOUR_API_KEY>', 'YOUR_APP_ID_REGION');


            // Call the API

            $response = $client->customPut(
                'test/minimal',
            );


            // play with the response

            var_dump($response);
        - lang: python
          label: Python
          source: |
            # Initialize the client
            _client = QuerySuggestionsClient(
                "YOUR_APP_ID", "YOUR_API_KEY", "YOUR_APP_ID_REGION"
            )

            # Call the API
            resp = await _client.custom_put(
                path="test/minimal",
            )

            # use the class directly
            print(resp)

            # print the JSON response
            print(resp.to_json())
        - lang: ruby
          label: Ruby
          source: |
            # Initialize the client
            client = Algolia::QuerySuggestionsClient.create(
              'YOUR_APP_ID',
              'YOUR_API_KEY',
              'YOUR_APP_ID_REGION'
            )

            # Call the API
            resp = client.custom_put("test/minimal")

            # use the class directly
            puts resp

            # print the JSON response
            puts resp.to_json
        - lang: scala
          label: Scala
          source: >
            // Initialize the client

            val client = QuerySuggestionsClient(appId = "YOUR_APP_ID", apiKey =
            "YOUR_API_KEY", region = "YOUR_APP_ID_REGION")


            // Call the API

            val res = client.customPut[JObject](
              path = "test/minimal"
            )


            // Use the response

            val value = Await.result(res, Duration(100, "sec"))
        - lang: swift
          label: Swift
          source: >
            // Initialize the client

            let client = try QuerySuggestionsClient(appID: "YOUR_APP_ID",
            apiKey: "YOUR_API_KEY", region: .us)


            // Call the API

            _ = try await client.customPut(path: "test/minimal")
    delete:
      operationId: customDelete
      summary: Send requests to the Algolia REST API
      description: This method allow you to send requests to the Algolia REST API.
      parameters:
        - $ref: '#/components/parameters/PathInPath'
        - $ref: '#/components/parameters/Parameters'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
        '400':
          $ref: '#/components/responses/BadRequest'
        '402':
          $ref: '#/components/responses/FeatureNotEnabled'
        '403':
          $ref: '#/components/responses/MethodNotAllowed'
        '404':
          $ref: '#/components/responses/IndexNotFound'
      x-codeSamples:
        - lang: csharp
          label: C#
          source: |
            // Initialize the client
            var client = new QuerySuggestionsClient(
              new QuerySuggestionsConfig("YOUR_APP_ID", "YOUR_API_KEY", "YOUR_APP_ID_REGION")
            );

            // Call the API
            var response = await client.CustomDeleteAsync("test/minimal");
        - lang: go
          label: Go
          source: >
            // Initialize the client with your application region, eg.
            suggestions.YOUR_APP_ID_REGION

            client, err := suggestions.NewClient("YOUR_APP_ID", "YOUR_API_KEY",
            suggestions.US)

            if err != nil {
              // The client can fail to initialize if you pass an invalid parameter.
              panic(err)
            }


            // Call the API

            resp, err := client.CustomDelete(client.NewApiCustomDeleteRequest(
              "test/minimal",
            ))

            if err != nil {
              // handle the eventual error
              panic(err)
            }


            // use the model directly

            print(resp)
        - lang: java
          label: Java
          source: >
            // Initialize the client

            QuerySuggestionsClient client = new
            QuerySuggestionsClient("YOUR_APP_ID", "YOUR_API_KEY",
            "YOUR_APP_ID_REGION");


            // Call the API

            client.customDelete("test/minimal");
        - lang: javascript
          label: JavaScript
          source: >
            // Initialize the client

            const client = querySuggestionsClient(
              'YOUR_APP_ID',
              'YOUR_API_KEY',
              'YOUR_APP_ID_REGION'
            );


            // Call the API

            const response = await client.customDelete({ path: 'test/minimal'
            });


            // use typed response

            console.log(response);
        - lang: kotlin
          label: Kotlin
          source: >
            // Initialize the client

            val client = QuerySuggestionsClient(appId = "YOUR_APP_ID", apiKey =
            "YOUR_API_KEY", region = "YOUR_APP_ID_REGION")


            // Call the API

            var response = client.customDelete(
              path = "test/minimal",
            )


            // Use the response

            println(response)
        - lang: php
          label: PHP
          source: >
            // Initialize the client

            $client =
            Algolia\AlgoliaSearch\Api\QuerySuggestionsClient::create('<YOUR_APP_ID>',
            '<YOUR_API_KEY>', 'YOUR_APP_ID_REGION');


            // Call the API

            $response = $client->customDelete(
                'test/minimal',
            );


            // play with the response

            var_dump($response);
        - lang: python
          label: Python
          source: |
            # Initialize the client
            _client = QuerySuggestionsClient(
                "YOUR_APP_ID", "YOUR_API_KEY", "YOUR_APP_ID_REGION"
            )

            # Call the API
            resp = await _client.custom_delete(
                path="test/minimal",
            )

            # use the class directly
            print(resp)

            # print the JSON response
            print(resp.to_json())
        - lang: ruby
          label: Ruby
          source: |
            # Initialize the client
            client = Algolia::QuerySuggestionsClient.create(
              'YOUR_APP_ID',
              'YOUR_API_KEY',
              'YOUR_APP_ID_REGION'
            )

            # Call the API
            resp = client.custom_delete("test/minimal")

            # use the class directly
            puts resp

            # print the JSON response
            puts resp.to_json
        - lang: scala
          label: Scala
          source: >
            // Initialize the client

            val client = QuerySuggestionsClient(appId = "YOUR_APP_ID", apiKey =
            "YOUR_API_KEY", region = "YOUR_APP_ID_REGION")


            // Call the API

            val res = client.customDelete[JObject](
              path = "test/minimal"
            )


            // Use the response

            val value = Await.result(res, Duration(100, "sec"))
        - lang: swift
          label: Swift
          source: >
            // Initialize the client

            let client = try QuerySuggestionsClient(appID: "YOUR_APP_ID",
            apiKey: "YOUR_API_KEY", region: .us)


            // Call the API

            _ = try await client.customDelete(path: "test/minimal")
  /1/configs:
    get:
      tags:
        - configurations
      operationId: getAllConfigs
      x-acl:
        - settings
      summary: List configurations
      description: >-
        Retrieves all Query Suggestions configurations of your Algolia
        application.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/QuerySuggestionsConfigurationResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
      x-codeSamples:
        - lang: csharp
          label: C#
          source: |
            // Initialize the client
            var client = new QuerySuggestionsClient(
              new QuerySuggestionsConfig("YOUR_APP_ID", "YOUR_API_KEY", "YOUR_APP_ID_REGION")
            );

            // Call the API
            var response = await client.GetAllConfigsAsync();
        - lang: go
          label: Go
          source: >
            // Initialize the client with your application region, eg.
            suggestions.YOUR_APP_ID_REGION

            client, err := suggestions.NewClient("YOUR_APP_ID", "YOUR_API_KEY",
            suggestions.US)

            if err != nil {
              // The client can fail to initialize if you pass an invalid parameter.
              panic(err)
            }


            // Call the API

            resp, err := client.GetAllConfigs()

            if err != nil {
              // handle the eventual error
              panic(err)
            }


            // use the model directly

            print(resp)
        - lang: java
          label: Java
          source: >
            // Initialize the client

            QuerySuggestionsClient client = new
            QuerySuggestionsClient("YOUR_APP_ID", "YOUR_API_KEY",
            "YOUR_APP_ID_REGION");


            // Call the API

            client.getAllConfigs();
        - lang: javascript
          label: JavaScript
          source: |
            // Initialize the client
            const client = querySuggestionsClient(
              'YOUR_APP_ID',
              'YOUR_API_KEY',
              'YOUR_APP_ID_REGION'
            );

            // Call the API
            const response = await client.getAllConfigs();

            // use typed response
            console.log(response);
        - lang: kotlin
          label: Kotlin
          source: >
            // Initialize the client

            val client = QuerySuggestionsClient(appId = "YOUR_APP_ID", apiKey =
            "YOUR_API_KEY", region = "YOUR_APP_ID_REGION")


            // Call the API

            var response = client.getAllConfigs()


            // Use the response

            println(response)
        - lang: php
          label: PHP
          source: >
            // Initialize the client

            $client =
            Algolia\AlgoliaSearch\Api\QuerySuggestionsClient::create('<YOUR_APP_ID>',
            '<YOUR_API_KEY>', 'YOUR_APP_ID_REGION');


            // Call the API

            $response = $client->getAllConfigs();


            // play with the response

            var_dump($response);
        - lang: python
          label: Python
          source: |
            # Initialize the client
            _client = QuerySuggestionsClient(
                "YOUR_APP_ID", "YOUR_API_KEY", "YOUR_APP_ID_REGION"
            )

            # Call the API
            resp = await _client.get_all_configs()

            # use the class directly
            print(resp)

            # print the JSON response
            print(resp.to_json())
        - lang: ruby
          label: Ruby
          source: |
            # Initialize the client
            client = Algolia::QuerySuggestionsClient.create(
              'YOUR_APP_ID',
              'YOUR_API_KEY',
              'YOUR_APP_ID_REGION'
            )

            # Call the API
            resp = client.get_all_configs

            # use the class directly
            puts resp

            # print the JSON response
            puts resp.to_json
        - lang: scala
          label: Scala
          source: >
            // Initialize the client

            val client = QuerySuggestionsClient(appId = "YOUR_APP_ID", apiKey =
            "YOUR_API_KEY", region = "YOUR_APP_ID_REGION")


            // Call the API

            val res = client.getAllConfigs(

            )


            // Use the response

            val value = Await.result(res, Duration(100, "sec"))
        - lang: swift
          label: Swift
          source: >
            // Initialize the client

            let client = try QuerySuggestionsClient(appID: "YOUR_APP_ID",
            apiKey: "YOUR_API_KEY", region: .us)


            // Call the API

            _ = try await client.getAllConfigs()
    post:
      tags:
        - configurations
      operationId: createConfig
      x-acl:
        - editSettings
      summary: Create a configuration
      description: |
        Creates a new Query Suggestions configuration.

        You can have up to 100 configurations per Algolia application.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QuerySuggestionsConfigurationWithIndex'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaseResponse'
              examples:
                Created:
                  summary: Configuration created
                  value:
                    status: 200
                    message: >-
                      Configuration was created, and a new indexing job has been
                      scheduled.
        '400':
          $ref: '#/components/responses/BadRequest-2'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '500':
          $ref: '#/components/responses/InternalError'
      x-codeSamples:
        - lang: csharp
          label: C#
          source: |
            // Initialize the client
            var client = new QuerySuggestionsClient(
              new QuerySuggestionsConfig("YOUR_APP_ID", "YOUR_API_KEY", "YOUR_APP_ID_REGION")
            );

            // Call the API
            var response = await client.CreateConfigAsync(
              new QuerySuggestionsConfigurationWithIndex
              {
                IndexName = "theIndexName",
                SourceIndices = new List<SourceIndex>
                {
                  new SourceIndex
                  {
                    IndexName = "testIndex",
                    Facets = new List<Facet> { new Facet { Attribute = "test", } },
                    Generate = new List<List<string>>
                    {
                      new List<string> { "facetA", "facetB" },
                      new List<string> { "facetC" }
                    },
                  }
                },
                Languages = new Languages(new List<string> { "french" }),
                Exclude = new List<string> { "test" },
              }
            );
        - lang: go
          label: Go
          source: >
            // Initialize the client with your application region, eg.
            suggestions.YOUR_APP_ID_REGION

            client, err := suggestions.NewClient("YOUR_APP_ID", "YOUR_API_KEY",
            suggestions.US)

            if err != nil {
              // The client can fail to initialize if you pass an invalid parameter.
              panic(err)
            }


            // Call the API

            resp, err := client.CreateConfig(client.NewApiCreateConfigRequest(

              suggestions.NewEmptyQuerySuggestionsConfigurationWithIndex().SetIndexName("theIndexName").SetSourceIndices(
                []suggestions.SourceIndex{*suggestions.NewEmptySourceIndex().SetIndexName("testIndex").SetFacets(
                  []suggestions.Facet{*suggestions.NewEmptyFacet().SetAttribute("test")}).SetGenerate(
                  [][]string{
                    []string{"facetA", "facetB"},
                    []string{"facetC"}})}).SetLanguages(suggestions.ArrayOfStringAsLanguages(
                []string{"french"})).SetExclude(
                []string{"test"}),
            ))

            if err != nil {
              // handle the eventual error
              panic(err)
            }


            // use the model directly

            print(resp)
        - lang: java
          label: Java
          source: >
            // Initialize the client

            QuerySuggestionsClient client = new
            QuerySuggestionsClient("YOUR_APP_ID", "YOUR_API_KEY",
            "YOUR_APP_ID_REGION");


            // Call the API

            client.createConfig(
              new QuerySuggestionsConfigurationWithIndex()
                .setIndexName("theIndexName")
                .setSourceIndices(
                  List.of(
                    new SourceIndex()
                      .setIndexName("testIndex")
                      .setFacets(List.of(new Facet().setAttribute("test")))
                      .setGenerate(List.of(List.of("facetA", "facetB"), List.of("facetC")))
                  )
                )
                .setLanguages(Languages.of(List.of("french")))
                .setExclude(List.of("test"))
            );
        - lang: javascript
          label: JavaScript
          source: |
            // Initialize the client
            const client = querySuggestionsClient(
              'YOUR_APP_ID',
              'YOUR_API_KEY',
              'YOUR_APP_ID_REGION'
            );

            // Call the API
            const response = await client.createConfig({
              indexName: 'theIndexName',
              sourceIndices: [
                {
                  indexName: 'testIndex',
                  facets: [{ attribute: 'test' }],
                  generate: [['facetA', 'facetB'], ['facetC']],
                },
              ],
              languages: ['french'],
              exclude: ['test'],
            });

            // use typed response
            console.log(response);
        - lang: kotlin
          label: Kotlin
          source: >
            // Initialize the client

            val client = QuerySuggestionsClient(appId = "YOUR_APP_ID", apiKey =
            "YOUR_API_KEY", region = "YOUR_APP_ID_REGION")


            // Call the API

            var response = client.createConfig(
              querySuggestionsConfigurationWithIndex = QuerySuggestionsConfigurationWithIndex(
                indexName = "theIndexName",
                sourceIndices = listOf(
                  SourceIndex(
                    indexName = "testIndex",
                    facets = listOf(
                      Facet(
                        attribute = "test",
                      ),
                    ),
                    generate = listOf(listOf("facetA", "facetB"), listOf("facetC")),
                  ),
                ),
                languages = Languages.of(listOf("french")),
                exclude = listOf("test"),
              ),
            )


            // Use the response

            println(response)
        - lang: php
          label: PHP
          source: >
            // Initialize the client

            $client =
            Algolia\AlgoliaSearch\Api\QuerySuggestionsClient::create('<YOUR_APP_ID>',
            '<YOUR_API_KEY>', 'YOUR_APP_ID_REGION');


            // Call the API

            $response = $client->createConfig(
                ['indexName' => 'theIndexName',
                    'sourceIndices' => [
                        ['indexName' => 'testIndex',
                            'facets' => [
                                ['attribute' => 'test',
                                ],
                            ],
                            'generate' => [
                                [
                                    'facetA',

                                    'facetB',
                                ],

                                [
                                    'facetC',
                                ],
                            ],
                        ],
                    ],
                    'languages' => [
                        'french',
                    ],
                    'exclude' => [
                        'test',
                    ],
                ],
            );


            // play with the response

            var_dump($response);
        - lang: python
          label: Python
          source: |
            # Initialize the client
            _client = QuerySuggestionsClient(
                "YOUR_APP_ID", "YOUR_API_KEY", "YOUR_APP_ID_REGION"
            )

            # Call the API
            resp = await _client.create_config(
                query_suggestions_configuration_with_index={
                    "indexName": "theIndexName",
                    "sourceIndices": [
                        {
                            "indexName": "testIndex",
                            "facets": [
                                {
                                    "attribute": "test",
                                },
                            ],
                            "generate": [
                                [
                                    "facetA",
                                    "facetB",
                                ],
                                [
                                    "facetC",
                                ],
                            ],
                        },
                    ],
                    "languages": [
                        "french",
                    ],
                    "exclude": [
                        "test",
                    ],
                },
            )

            # use the class directly
            print(resp)

            # print the JSON response
            print(resp.to_json())
        - lang: ruby
          label: Ruby
          source: |
            # Initialize the client
            client = Algolia::QuerySuggestionsClient.create(
              'YOUR_APP_ID',
              'YOUR_API_KEY',
              'YOUR_APP_ID_REGION'
            )

            # Call the API
            resp = client.create_config(
              QuerySuggestionsConfigurationWithIndex.new(
                index_name: "theIndexName",
                source_indices: [SourceIndex.new(
                  index_name: "testIndex",
                  facets: [Facet.new(attribute: "test")],
                  generate: [["facetA", "facetB"], ["facetC"]]
                )],
                languages: ["french"],
                exclude: ["test"]
              )
            )

            # use the class directly
            puts resp

            # print the JSON response
            puts resp.to_json
        - lang: scala
          label: Scala
          source: >
            // Initialize the client

            val client = QuerySuggestionsClient(appId = "YOUR_APP_ID", apiKey =
            "YOUR_API_KEY", region = "YOUR_APP_ID_REGION")


            // Call the API

            val res = client.createConfig(
              querySuggestionsConfigurationWithIndex = QuerySuggestionsConfigurationWithIndex(
                indexName = "theIndexName",
                sourceIndices = Seq(
                  SourceIndex(
                    indexName = "testIndex",
                    facets = Some(
                      Seq(
                        Facet(
                          attribute = Some("test")
                        )
                      )
                    ),
                    generate = Some(Seq(Seq("facetA", "facetB"), Seq("facetC")))
                  )
                ),
                languages = Some(Languages(Seq("french"))),
                exclude = Some(Seq("test"))
              )
            )


            // Use the response

            val value = Await.result(res, Duration(100, "sec"))
        - lang: swift
          label: Swift
          source: >
            // Initialize the client

            let client = try QuerySuggestionsClient(appID: "YOUR_APP_ID",
            apiKey: "YOUR_API_KEY", region: .us)


            // Call the API

            _ = try await client
                .createConfig(querySuggestionsConfigurationWithIndex: QuerySuggestionsConfigurationWithIndex(
                    sourceIndices: [SourceIndex(
                        indexName: "testIndex",
                        facets: [Facet(attribute: "test")],
                        generate: [["facetA", "facetB"], ["facetC"]]
                    )],
                    languages: QuerySuggestionsLanguages.arrayOfString(["french"]),
                    exclude: ["test"],
                    indexName: "theIndexName"
                ))
  /1/configs/{indexName}:
    get:
      tags:
        - configurations
      operationId: getConfig
      x-acl:
        - settings
      summary: Retrieve a configuration
      description: Retrieves a single Query Suggestions configuration by its index name.
      parameters:
        - $ref: '#/components/parameters/IndexName'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QuerySuggestionsConfigurationResponse'
        '400':
          $ref: '#/components/responses/BadRequest-2'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
      x-codeSamples:
        - lang: csharp
          label: C#
          source: >
            // Initialize the client

            var client = new QuerySuggestionsClient(
              new QuerySuggestionsConfig("YOUR_APP_ID", "YOUR_API_KEY", "YOUR_APP_ID_REGION")
            );


            // Call the API

            var response = await
            client.GetConfigAsync("cts_e2e_browse_query_suggestions");
        - lang: go
          label: Go
          source: >
            // Initialize the client with your application region, eg.
            suggestions.YOUR_APP_ID_REGION

            client, err := suggestions.NewClient("YOUR_APP_ID", "YOUR_API_KEY",
            suggestions.US)

            if err != nil {
              // The client can fail to initialize if you pass an invalid parameter.
              panic(err)
            }


            // Call the API

            resp, err := client.GetConfig(client.NewApiGetConfigRequest(
              "cts_e2e_browse_query_suggestions",
            ))

            if err != nil {
              // handle the eventual error
              panic(err)
            }


            // use the model directly

            print(resp)
        - lang: java
          label: Java
          source: >
            // Initialize the client

            QuerySuggestionsClient client = new
            QuerySuggestionsClient("YOUR_APP_ID", "YOUR_API_KEY",
            "YOUR_APP_ID_REGION");


            // Call the API

            client.getConfig("cts_e2e_browse_query_suggestions");
        - lang: javascript
          label: JavaScript
          source: |
            // Initialize the client
            const client = querySuggestionsClient(
              'YOUR_APP_ID',
              'YOUR_API_KEY',
              'YOUR_APP_ID_REGION'
            );

            // Call the API
            const response = await client.getConfig({
              indexName: 'cts_e2e_browse_query_suggestions',
            });

            // use typed response
            console.log(response);
        - lang: kotlin
          label: Kotlin
          source: >
            // Initialize the client

            val client = QuerySuggestionsClient(appId = "YOUR_APP_ID", apiKey =
            "YOUR_API_KEY", region = "YOUR_APP_ID_REGION")


            // Call the API

            var response = client.getConfig(
              indexName = "cts_e2e_browse_query_suggestions",
            )


            // Use the response

            println(response)
        - lang: php
          label: PHP
          source: >
            // Initialize the client

            $client =
            Algolia\AlgoliaSearch\Api\QuerySuggestionsClient::create('<YOUR_APP_ID>',
            '<YOUR_API_KEY>', 'YOUR_APP_ID_REGION');


            // Call the API

            $response = $client->getConfig(
                'cts_e2e_browse_query_suggestions',
            );


            // play with the response

            var_dump($response);
        - lang: python
          label: Python
          source: |
            # Initialize the client
            _client = QuerySuggestionsClient(
                "YOUR_APP_ID", "YOUR_API_KEY", "YOUR_APP_ID_REGION"
            )

            # Call the API
            resp = await _client.get_config(
                index_name="cts_e2e_browse_query_suggestions",
            )

            # use the class directly
            print(resp)

            # print the JSON response
            print(resp.to_json())
        - lang: ruby
          label: Ruby
          source: |
            # Initialize the client
            client = Algolia::QuerySuggestionsClient.create(
              'YOUR_APP_ID',
              'YOUR_API_KEY',
              'YOUR_APP_ID_REGION'
            )

            # Call the API
            resp = client.get_config("cts_e2e_browse_query_suggestions")

            # use the class directly
            puts resp

            # print the JSON response
            puts resp.to_json
        - lang: scala
          label: Scala
          source: >
            // Initialize the client

            val client = QuerySuggestionsClient(appId = "YOUR_APP_ID", apiKey =
            "YOUR_API_KEY", region = "YOUR_APP_ID_REGION")


            // Call the API

            val res = client.getConfig(
              indexName = "cts_e2e_browse_query_suggestions"
            )


            // Use the response

            val value = Await.result(res, Duration(100, "sec"))
        - lang: swift
          label: Swift
          source: >
            // Initialize the client

            let client = try QuerySuggestionsClient(appID: "YOUR_APP_ID",
            apiKey: "YOUR_API_KEY", region: .us)


            // Call the API

            _ = try await client.getConfig(indexName:
            "cts_e2e_browse_query_suggestions")
    put:
      tags:
        - configurations
      operationId: updateConfig
      x-acl:
        - editSettings
      summary: Update a configuration
      description: Updates a QuerySuggestions configuration.
      parameters:
        - $ref: '#/components/parameters/IndexName'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QuerySuggestionsConfiguration'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaseResponse'
              examples:
                Created:
                  summary: Configuration created
                  value:
                    status: 200
                    message: >-
                      Configuration was updated, and a new indexing job has been
                      scheduled.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalError-2'
      x-codeSamples:
        - lang: csharp
          label: C#
          source: |
            // Initialize the client
            var client = new QuerySuggestionsClient(
              new QuerySuggestionsConfig("YOUR_APP_ID", "YOUR_API_KEY", "YOUR_APP_ID_REGION")
            );

            // Call the API
            var response = await client.UpdateConfigAsync(
              "theIndexName",
              new QuerySuggestionsConfiguration
              {
                SourceIndices = new List<SourceIndex>
                {
                  new SourceIndex
                  {
                    IndexName = "testIndex",
                    Facets = new List<Facet> { new Facet { Attribute = "test", } },
                    Generate = new List<List<string>>
                    {
                      new List<string> { "facetA", "facetB" },
                      new List<string> { "facetC" }
                    },
                  }
                },
                Languages = new Languages(new List<string> { "french" }),
                Exclude = new List<string> { "test" },
              }
            );
        - lang: go
          label: Go
          source: >
            // Initialize the client with your application region, eg.
            suggestions.YOUR_APP_ID_REGION

            client, err := suggestions.NewClient("YOUR_APP_ID", "YOUR_API_KEY",
            suggestions.US)

            if err != nil {
              // The client can fail to initialize if you pass an invalid parameter.
              panic(err)
            }


            // Call the API

            resp, err := client.UpdateConfig(client.NewApiUpdateConfigRequest(
              "theIndexName",
              suggestions.NewEmptyQuerySuggestionsConfiguration().SetSourceIndices(
                []suggestions.SourceIndex{*suggestions.NewEmptySourceIndex().SetIndexName("testIndex").SetFacets(
                  []suggestions.Facet{*suggestions.NewEmptyFacet().SetAttribute("test")}).SetGenerate(
                  [][]string{
                    []string{"facetA", "facetB"},
                    []string{"facetC"}})}).SetLanguages(suggestions.ArrayOfStringAsLanguages(
                []string{"french"})).SetExclude(
                []string{"test"}),
            ))

            if err != nil {
              // handle the eventual error
              panic(err)
            }


            // use the model directly

            print(resp)
        - lang: java
          label: Java
          source: >
            // Initialize the client

            QuerySuggestionsClient client = new
            QuerySuggestionsClient("YOUR_APP_ID", "YOUR_API_KEY",
            "YOUR_APP_ID_REGION");


            // Call the API

            client.updateConfig(
              "theIndexName",
              new QuerySuggestionsConfiguration()
                .setSourceIndices(
                  List.of(
                    new SourceIndex()
                      .setIndexName("testIndex")
                      .setFacets(List.of(new Facet().setAttribute("test")))
                      .setGenerate(List.of(List.of("facetA", "facetB"), List.of("facetC")))
                  )
                )
                .setLanguages(Languages.of(List.of("french")))
                .setExclude(List.of("test"))
            );
        - lang: javascript
          label: JavaScript
          source: |
            // Initialize the client
            const client = querySuggestionsClient(
              'YOUR_APP_ID',
              'YOUR_API_KEY',
              'YOUR_APP_ID_REGION'
            );

            // Call the API
            const response = await client.updateConfig({
              indexName: 'theIndexName',
              querySuggestionsConfiguration: {
                sourceIndices: [
                  {
                    indexName: 'testIndex',
                    facets: [{ attribute: 'test' }],
                    generate: [['facetA', 'facetB'], ['facetC']],
                  },
                ],
                languages: ['french'],
                exclude: ['test'],
              },
            });

            // use typed response
            console.log(response);
        - lang: kotlin
          label: Kotlin
          source: >
            // Initialize the client

            val client = QuerySuggestionsClient(appId = "YOUR_APP_ID", apiKey =
            "YOUR_API_KEY", region = "YOUR_APP_ID_REGION")


            // Call the API

            var response = client.updateConfig(
              indexName = "theIndexName",
              querySuggestionsConfiguration = QuerySuggestionsConfiguration(
                sourceIndices = listOf(
                  SourceIndex(
                    indexName = "testIndex",
                    facets = listOf(
                      Facet(
                        attribute = "test",
                      ),
                    ),
                    generate = listOf(listOf("facetA", "facetB"), listOf("facetC")),
                  ),
                ),
                languages = Languages.of(listOf("french")),
                exclude = listOf("test"),
              ),
            )


            // Use the response

            println(response)
        - lang: php
          label: PHP
          source: >
            // Initialize the client

            $client =
            Algolia\AlgoliaSearch\Api\QuerySuggestionsClient::create('<YOUR_APP_ID>',
            '<YOUR_API_KEY>', 'YOUR_APP_ID_REGION');


            // Call the API

            $response = $client->updateConfig(
                'theIndexName',
                ['sourceIndices' => [
                    ['indexName' => 'testIndex',
                        'facets' => [
                            ['attribute' => 'test',
                            ],
                        ],
                        'generate' => [
                            [
                                'facetA',

                                'facetB',
                            ],

                            [
                                'facetC',
                            ],
                        ],
                    ],
                ],
                    'languages' => [
                        'french',
                    ],
                    'exclude' => [
                        'test',
                    ],
                ],
            );


            // play with the response

            var_dump($response);
        - lang: python
          label: Python
          source: |
            # Initialize the client
            _client = QuerySuggestionsClient(
                "YOUR_APP_ID", "YOUR_API_KEY", "YOUR_APP_ID_REGION"
            )

            # Call the API
            resp = await _client.update_config(
                index_name="theIndexName",
                query_suggestions_configuration={
                    "sourceIndices": [
                        {
                            "indexName": "testIndex",
                            "facets": [
                                {
                                    "attribute": "test",
                                },
                            ],
                            "generate": [
                                [
                                    "facetA",
                                    "facetB",
                                ],
                                [
                                    "facetC",
                                ],
                            ],
                        },
                    ],
                    "languages": [
                        "french",
                    ],
                    "exclude": [
                        "test",
                    ],
                },
            )

            # use the class directly
            print(resp)

            # print the JSON response
            print(resp.to_json())
        - lang: ruby
          label: Ruby
          source: |
            # Initialize the client
            client = Algolia::QuerySuggestionsClient.create(
              'YOUR_APP_ID',
              'YOUR_API_KEY',
              'YOUR_APP_ID_REGION'
            )

            # Call the API
            resp = client.update_config(
              "theIndexName",
              QuerySuggestionsConfiguration.new(
                source_indices: [SourceIndex.new(
                  index_name: "testIndex",
                  facets: [Facet.new(attribute: "test")],
                  generate: [["facetA", "facetB"], ["facetC"]]
                )],
                languages: ["french"],
                exclude: ["test"]
              )
            )

            # use the class directly
            puts resp

            # print the JSON response
            puts resp.to_json
        - lang: scala
          label: Scala
          source: >
            // Initialize the client

            val client = QuerySuggestionsClient(appId = "YOUR_APP_ID", apiKey =
            "YOUR_API_KEY", region = "YOUR_APP_ID_REGION")


            // Call the API

            val res = client.updateConfig(
              indexName = "theIndexName",
              querySuggestionsConfiguration = QuerySuggestionsConfiguration(
                sourceIndices = Seq(
                  SourceIndex(
                    indexName = "testIndex",
                    facets = Some(
                      Seq(
                        Facet(
                          attribute = Some("test")
                        )
                      )
                    ),
                    generate = Some(Seq(Seq("facetA", "facetB"), Seq("facetC")))
                  )
                ),
                languages = Some(Languages(Seq("french"))),
                exclude = Some(Seq("test"))
              )
            )


            // Use the response

            val value = Await.result(res, Duration(100, "sec"))
        - lang: swift
          label: Swift
          source: >
            // Initialize the client

            let client = try QuerySuggestionsClient(appID: "YOUR_APP_ID",
            apiKey: "YOUR_API_KEY", region: .us)


            // Call the API

            _ = try await client.updateConfig(
                indexName: "theIndexName",
                configuration: QuerySuggestionsConfiguration(
                    sourceIndices: [SourceIndex(
                        indexName: "testIndex",
                        facets: [Facet(attribute: "test")],
                        generate: [["facetA", "facetB"], ["facetC"]]
                    )],
                    languages: QuerySuggestionsLanguages.arrayOfString(["french"]),
                    exclude: ["test"]
                )
            )
    delete:
      tags:
        - configurations
      operationId: deleteConfig
      x-acl:
        - editSettings
      summary: Delete a configuration
      description: >
        Deletes a Query Suggestions configuration.


        Deleting only removes the configuration and stops updates to the Query
        Suggestions index.

        To delete the Query Suggestions index itself, use the Search API and the
        [Delete an index](/specs/search#tag/Indices/operation/deleteIndex)
        operation.
      parameters:
        - $ref: '#/components/parameters/IndexName'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaseResponse'
              examples:
                Created:
                  summary: Configuration created
                  value:
                    status: 200
                    message: Configuration was deleted with success.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalError-2'
      x-codeSamples:
        - lang: csharp
          label: C#
          source: |
            // Initialize the client
            var client = new QuerySuggestionsClient(
              new QuerySuggestionsConfig("YOUR_APP_ID", "YOUR_API_KEY", "YOUR_APP_ID_REGION")
            );

            // Call the API
            var response = await client.DeleteConfigAsync("theIndexName");
        - lang: go
          label: Go
          source: >
            // Initialize the client with your application region, eg.
            suggestions.YOUR_APP_ID_REGION

            client, err := suggestions.NewClient("YOUR_APP_ID", "YOUR_API_KEY",
            suggestions.US)

            if err != nil {
              // The client can fail to initialize if you pass an invalid parameter.
              panic(err)
            }


            // Call the API

            resp, err := client.DeleteConfig(client.NewApiDeleteConfigRequest(
              "theIndexName",
            ))

            if err != nil {
              // handle the eventual error
              panic(err)
            }


            // use the model directly

            print(resp)
        - lang: java
          label: Java
          source: >
            // Initialize the client

            QuerySuggestionsClient client = new
            QuerySuggestionsClient("YOUR_APP_ID", "YOUR_API_KEY",
            "YOUR_APP_ID_REGION");


            // Call the API

            client.deleteConfig("theIndexName");
        - lang: javascript
          label: JavaScript
          source: >
            // Initialize the client

            const client = querySuggestionsClient(
              'YOUR_APP_ID',
              'YOUR_API_KEY',
              'YOUR_APP_ID_REGION'
            );


            // Call the API

            const response = await client.deleteConfig({ indexName:
            'theIndexName' });


            // use typed response

            console.log(response);
        - lang: kotlin
          label: Kotlin
          source: >
            // Initialize the client

            val client = QuerySuggestionsClient(appId = "YOUR_APP_ID", apiKey =
            "YOUR_API_KEY", region = "YOUR_APP_ID_REGION")


            // Call the API

            var response = client.deleteConfig(
              indexName = "theIndexName",
            )


            // Use the response

            println(response)
        - lang: php
          label: PHP
          source: >
            // Initialize the client

            $client =
            Algolia\AlgoliaSearch\Api\QuerySuggestionsClient::create('<YOUR_APP_ID>',
            '<YOUR_API_KEY>', 'YOUR_APP_ID_REGION');


            // Call the API

            $response = $client->deleteConfig(
                'theIndexName',
            );


            // play with the response

            var_dump($response);
        - lang: python
          label: Python
          source: |
            # Initialize the client
            _client = QuerySuggestionsClient(
                "YOUR_APP_ID", "YOUR_API_KEY", "YOUR_APP_ID_REGION"
            )

            # Call the API
            resp = await _client.delete_config(
                index_name="theIndexName",
            )

            # use the class directly
            print(resp)

            # print the JSON response
            print(resp.to_json())
        - lang: ruby
          label: Ruby
          source: |
            # Initialize the client
            client = Algolia::QuerySuggestionsClient.create(
              'YOUR_APP_ID',
              'YOUR_API_KEY',
              'YOUR_APP_ID_REGION'
            )

            # Call the API
            resp = client.delete_config("theIndexName")

            # use the class directly
            puts resp

            # print the JSON response
            puts resp.to_json
        - lang: scala
          label: Scala
          source: >
            // Initialize the client

            val client = QuerySuggestionsClient(appId = "YOUR_APP_ID", apiKey =
            "YOUR_API_KEY", region = "YOUR_APP_ID_REGION")


            // Call the API

            val res = client.deleteConfig(
              indexName = "theIndexName"
            )


            // Use the response

            val value = Await.result(res, Duration(100, "sec"))
        - lang: swift
          label: Swift
          source: >
            // Initialize the client

            let client = try QuerySuggestionsClient(appID: "YOUR_APP_ID",
            apiKey: "YOUR_API_KEY", region: .us)


            // Call the API

            _ = try await client.deleteConfig(indexName: "theIndexName")
  /1/configs/{indexName}/status:
    get:
      tags:
        - configurations
      operationId: getConfigStatus
      x-acl:
        - settings
      summary: Retrieve configuration status
      description: Reports the status of a Query Suggestions index.
      parameters:
        - $ref: '#/components/parameters/IndexName'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                additionalProperties: false
                properties:
                  indexName:
                    $ref: '#/components/schemas/QuerySuggestionsIndexName'
                  isRunning:
                    type: boolean
                    description: >-
                      Whether the creation or update of the Query Suggestions
                      index is in progress.
                    example: false
                  lastBuiltAt:
                    type: string
                    description: >-
                      Date and time when the Query Suggestions index was last
                      built, in RFC 3339 format.
                    example: '2023-07-05T08:03:53Z'
                  lastSuccessfulBuiltAt:
                    type: string
                    description: >-
                      Date and time when the Query Suggestions index was last
                      updated successfully.
                    example: '2023-07-05T08:03:53Z'
                  lastSuccessfulBuildDuration:
                    type: string
                    description: Duration of the last successful build in seconds.
                    example: 28
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
      x-codeSamples:
        - lang: csharp
          label: C#
          source: |
            // Initialize the client
            var client = new QuerySuggestionsClient(
              new QuerySuggestionsConfig("YOUR_APP_ID", "YOUR_API_KEY", "YOUR_APP_ID_REGION")
            );

            // Call the API
            var response = await client.GetConfigStatusAsync("theIndexName");
        - lang: go
          label: Go
          source: >
            // Initialize the client with your application region, eg.
            suggestions.YOUR_APP_ID_REGION

            client, err := suggestions.NewClient("YOUR_APP_ID", "YOUR_API_KEY",
            suggestions.US)

            if err != nil {
              // The client can fail to initialize if you pass an invalid parameter.
              panic(err)
            }


            // Call the API

            resp, err :=
            client.GetConfigStatus(client.NewApiGetConfigStatusRequest(
              "theIndexName",
            ))

            if err != nil {
              // handle the eventual error
              panic(err)
            }


            // use the model directly

            print(resp)
        - lang: java
          label: Java
          source: >
            // Initialize the client

            QuerySuggestionsClient client = new
            QuerySuggestionsClient("YOUR_APP_ID", "YOUR_API_KEY",
            "YOUR_APP_ID_REGION");


            // Call the API

            client.getConfigStatus("theIndexName");
        - lang: javascript
          label: JavaScript
          source: >
            // Initialize the client

            const client = querySuggestionsClient(
              'YOUR_APP_ID',
              'YOUR_API_KEY',
              'YOUR_APP_ID_REGION'
            );


            // Call the API

            const response = await client.getConfigStatus({ indexName:
            'theIndexName' });


            // use typed response

            console.log(response);
        - lang: kotlin
          label: Kotlin
          source: >
            // Initialize the client

            val client = QuerySuggestionsClient(appId = "YOUR_APP_ID", apiKey =
            "YOUR_API_KEY", region = "YOUR_APP_ID_REGION")


            // Call the API

            var response = client.getConfigStatus(
              indexName = "theIndexName",
            )


            // Use the response

            println(response)
        - lang: php
          label: PHP
          source: >
            // Initialize the client

            $client =
            Algolia\AlgoliaSearch\Api\QuerySuggestionsClient::create('<YOUR_APP_ID>',
            '<YOUR_API_KEY>', 'YOUR_APP_ID_REGION');


            // Call the API

            $response = $client->getConfigStatus(
                'theIndexName',
            );


            // play with the response

            var_dump($response);
        - lang: python
          label: Python
          source: |
            # Initialize the client
            _client = QuerySuggestionsClient(
                "YOUR_APP_ID", "YOUR_API_KEY", "YOUR_APP_ID_REGION"
            )

            # Call the API
            resp = await _client.get_config_status(
                index_name="theIndexName",
            )

            # use the class directly
            print(resp)

            # print the JSON response
            print(resp.to_json())
        - lang: ruby
          label: Ruby
          source: |
            # Initialize the client
            client = Algolia::QuerySuggestionsClient.create(
              'YOUR_APP_ID',
              'YOUR_API_KEY',
              'YOUR_APP_ID_REGION'
            )

            # Call the API
            resp = client.get_config_status("theIndexName")

            # use the class directly
            puts resp

            # print the JSON response
            puts resp.to_json
        - lang: scala
          label: Scala
          source: >
            // Initialize the client

            val client = QuerySuggestionsClient(appId = "YOUR_APP_ID", apiKey =
            "YOUR_API_KEY", region = "YOUR_APP_ID_REGION")


            // Call the API

            val res = client.getConfigStatus(
              indexName = "theIndexName"
            )


            // Use the response

            val value = Await.result(res, Duration(100, "sec"))
        - lang: swift
          label: Swift
          source: >
            // Initialize the client

            let client = try QuerySuggestionsClient(appID: "YOUR_APP_ID",
            apiKey: "YOUR_API_KEY", region: .us)


            // Call the API

            _ = try await client.getConfigStatus(indexName: "theIndexName")
  /1/logs/{indexName}:
    get:
      tags:
        - logs
      operationId: getLogFile
      x-acl:
        - settings
      summary: Retrieve logs
      description: Retrieves the logs for a single Query Suggestions index.
      parameters:
        - $ref: '#/components/parameters/IndexName'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                additionalProperties: false
                properties:
                  timestamp:
                    type: string
                    description: Date and time of the log entry, in RFC 3339 format.
                    example: '2023-07-05T08:03:33.898076171Z'
                  level:
                    $ref: '#/components/schemas/LogLevel'
                  message:
                    type: string
                    description: Details about this log entry.
                    example: >-
                      skipping query "Brooke Adams": not enough search results,
                      got 1, expected 5
                  contextLevel:
                    type: integer
                    description: >
                      Level indicating the position of a suggestion in a
                      hierarchy of records.


                      For example, a `contextLevel` of 1 indicates that this
                      suggestion belongs to a previous suggestion with
                      `contextLevel` 0.
                    example: 1
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
      x-codeSamples:
        - lang: csharp
          label: C#
          source: |
            // Initialize the client
            var client = new QuerySuggestionsClient(
              new QuerySuggestionsConfig("YOUR_APP_ID", "YOUR_API_KEY", "YOUR_APP_ID_REGION")
            );

            // Call the API
            var response = await client.GetLogFileAsync("theIndexName");
        - lang: go
          label: Go
          source: >
            // Initialize the client with your application region, eg.
            suggestions.YOUR_APP_ID_REGION

            client, err := suggestions.NewClient("YOUR_APP_ID", "YOUR_API_KEY",
            suggestions.US)

            if err != nil {
              // The client can fail to initialize if you pass an invalid parameter.
              panic(err)
            }


            // Call the API

            resp, err := client.GetLogFile(client.NewApiGetLogFileRequest(
              "theIndexName",
            ))

            if err != nil {
              // handle the eventual error
              panic(err)
            }


            // use the model directly

            print(resp)
        - lang: java
          label: Java
          source: >
            // Initialize the client

            QuerySuggestionsClient client = new
            QuerySuggestionsClient("YOUR_APP_ID", "YOUR_API_KEY",
            "YOUR_APP_ID_REGION");


            // Call the API

            client.getLogFile("theIndexName");
        - lang: javascript
          label: JavaScript
          source: >
            // Initialize the client

            const client = querySuggestionsClient(
              'YOUR_APP_ID',
              'YOUR_API_KEY',
              'YOUR_APP_ID_REGION'
            );


            // Call the API

            const response = await client.getLogFile({ indexName: 'theIndexName'
            });


            // use typed response

            console.log(response);
        - lang: kotlin
          label: Kotlin
          source: >
            // Initialize the client

            val client = QuerySuggestionsClient(appId = "YOUR_APP_ID", apiKey =
            "YOUR_API_KEY", region = "YOUR_APP_ID_REGION")


            // Call the API

            var response = client.getLogFile(
              indexName = "theIndexName",
            )


            // Use the response

            println(response)
        - lang: php
          label: PHP
          source: >
            // Initialize the client

            $client =
            Algolia\AlgoliaSearch\Api\QuerySuggestionsClient::create('<YOUR_APP_ID>',
            '<YOUR_API_KEY>', 'YOUR_APP_ID_REGION');


            // Call the API

            $response = $client->getLogFile(
                'theIndexName',
            );


            // play with the response

            var_dump($response);
        - lang: python
          label: Python
          source: |
            # Initialize the client
            _client = QuerySuggestionsClient(
                "YOUR_APP_ID", "YOUR_API_KEY", "YOUR_APP_ID_REGION"
            )

            # Call the API
            resp = await _client.get_log_file(
                index_name="theIndexName",
            )

            # use the class directly
            print(resp)

            # print the JSON response
            print(resp.to_json())
        - lang: ruby
          label: Ruby
          source: |
            # Initialize the client
            client = Algolia::QuerySuggestionsClient.create(
              'YOUR_APP_ID',
              'YOUR_API_KEY',
              'YOUR_APP_ID_REGION'
            )

            # Call the API
            resp = client.get_log_file("theIndexName")

            # use the class directly
            puts resp

            # print the JSON response
            puts resp.to_json
        - lang: scala
          label: Scala
          source: >
            // Initialize the client

            val client = QuerySuggestionsClient(appId = "YOUR_APP_ID", apiKey =
            "YOUR_API_KEY", region = "YOUR_APP_ID_REGION")


            // Call the API

            val res = client.getLogFile(
              indexName = "theIndexName"
            )


            // Use the response

            val value = Await.result(res, Duration(100, "sec"))
        - lang: swift
          label: Swift
          source: >
            // Initialize the client

            let client = try QuerySuggestionsClient(appID: "YOUR_APP_ID",
            apiKey: "YOUR_API_KEY", region: .us)


            // Call the API

            _ = try await client.getLogFile(indexName: "theIndexName")
components:
  securitySchemes:
    appId:
      type: apiKey
      in: header
      name: x-algolia-application-id
      description: Your Algolia application ID.
    apiKey:
      type: apiKey
      in: header
      name: x-algolia-api-key
      description: >
        Your Algolia API key with the necessary permissions to make the request.

        Permissions are controlled through access control lists (ACL) and access
        restrictions.

        The required ACL to make a request is listed in each endpoint's
        reference.
  parameters:
    PathInPath:
      name: path
      in: path
      description: Path of the endpoint, anything after "/1" must be specified.
      required: true
      schema:
        type: string
        example: /keys
    Parameters:
      name: parameters
      in: query
      description: Query parameters to apply to the current query.
      schema:
        type: object
        additionalProperties: true
    IndexName:
      name: indexName
      in: path
      required: true
      description: Query Suggestions index name.
      schema:
        $ref: '#/components/schemas/QuerySuggestionsIndexName'
  schemas:
    ErrorBase:
      description: Error.
      type: object
      additionalProperties: true
      properties:
        message:
          type: string
          example: Invalid Application-Id or API-Key
    AppID:
      type: object
      properties:
        appID:
          type: string
          description: >-
            Algolia application ID to which this Query Suggestions configuration
            belongs.
    QuerySuggestionsIndexName:
      title: indexName
      type: string
      description: Name of the Query Suggestions index (case-sensitive).
      example: products_query_suggestions
    AnalyticsTags:
      title: analyticsTags
      description: >
        Analytics tags for filtering the popular searches.

        For more information, see [Segment your analytics
        data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
      default: null
      oneOf:
        - type: array
          items:
            type: string
        - type: 'null'
    Facet:
      type: object
      description: Facet to use as category.
      properties:
        attribute:
          type: string
          description: Facet name.
        amount:
          type: integer
          description: Number of suggestions.
    Facets:
      title: facets
      description: >
        Facets to use as top categories with your suggestions.


        If provided, Query Suggestions adds the top facet values to each
        suggestion.
      default: null
      oneOf:
        - type: array
          items:
            $ref: '#/components/schemas/Facet'
        - type: 'null'
      example:
        - attribute: category
          amount: 3
        - attribute: brand
          amount: 2
    Generate:
      title: generate
      description: >
        Facets used for generating query suggestions from facet values.


        For example, if you set `generate: ["color", "brand"]`, combinations
        from the facet values are added as query suggestions,

        such as "blue adidas", "red adidas", "blue nike", "red nike", etc.


        You can include nested lists.
      default: null
      oneOf:
        - type: array
          items:
            type: array
            items:
              type: string
        - type: 'null'
      example:
        - - color
          - brand
    External:
      description: >
        Algolia indices with popular searches to use as query suggestions.


        Records of these indices must have these attributes:


        - `query`: search query which will be added as a suggestion

        - `count`: measure of popularity of that search query


        For example, you can export popular searches from an external analytics
        provider, such as Google Analytics or Adobe Analytics,

        and feed this data into an Algolia index.

        You can use this index to generate query suggestions until your Algolia
        Analytics has collected enough data.
      default: null
      oneOf:
        - type: array
          items:
            type: string
        - type: 'null'
    SourceIndex:
      type: object
      description: Configuration of an Algolia index for Query Suggestions.
      required:
        - indexName
      properties:
        indexName:
          type: string
          description: >-
            Name of the Algolia index (case-sensitive) to use as source for
            query suggestions.
          example: products
        replicas:
          type: boolean
          default: false
          description: >
            If true, Query Suggestions uses all replica indices to find popular
            searches.

            If false, only the primary index is used.
          example: false
        analyticsTags:
          $ref: '#/components/schemas/AnalyticsTags'
        facets:
          $ref: '#/components/schemas/Facets'
        minHits:
          type: integer
          minimum: 0
          default: 5
          description: >
            Minimum number of hits required to be included as a suggestion.


            A search query must at least generate `minHits` search results to be
            included in the Query Suggestions index.
        minLetters:
          type: integer
          minimum: 0
          default: 4
          description: >
            Minimum letters required to be included as a suggestion.


            A search query must be at least `minLetters` long to be included in
            the Query Suggestions index.
        generate:
          $ref: '#/components/schemas/Generate'
        external:
          $ref: '#/components/schemas/External'
    Languages:
      title: languages
      description: |
        Languages for deduplicating singular and plural suggestions.
        If specified, only the more popular form is included.
      default: false
      oneOf:
        - type: array
          description: Languages for which to deduplicate singular and plural forms.
          items:
            type: string
            description: Two-letter country code.
        - type: boolean
          description: If true, deduplication is enabled for all languages.
    Exclude:
      title: exclude
      description: Words or regular expressions to exclude from the suggestions.
      default: null
      oneOf:
        - type: array
          items:
            type: string
        - type: 'null'
    QuerySuggestionsConfiguration:
      type: object
      description: Query Suggestions configuration.
      required:
        - sourceIndices
      properties:
        sourceIndices:
          type: array
          description: >-
            Algolia indices from which to get the popular searches for query
            suggestions.
          minItems: 1
          items:
            $ref: '#/components/schemas/SourceIndex'
        languages:
          $ref: '#/components/schemas/Languages'
        exclude:
          $ref: '#/components/schemas/Exclude'
        enablePersonalization:
          type: boolean
          default: false
          description: Whether to turn on personalized query suggestions.
        allowSpecialCharacters:
          type: boolean
          default: false
          description: Whether to include suggestions with special characters.
    QuerySuggestionsConfigurationWithIndex:
      type: object
      description: Query Suggestions configuration.
      required:
        - indexName
        - sourceIndices
      allOf:
        - type: object
          properties:
            indexName:
              $ref: '#/components/schemas/QuerySuggestionsIndexName'
        - $ref: '#/components/schemas/QuerySuggestionsConfiguration'
    QuerySuggestionsConfigurationResponse:
      type: object
      description: API response for retrieving Query Suggestions configurations.
      allOf:
        - $ref: '#/components/schemas/AppID'
        - $ref: '#/components/schemas/QuerySuggestionsConfigurationWithIndex'
      required:
        - appID
        - allowSpecialCharacters
        - enablePersonalization
        - exclude
        - languages
        - sourceIndices
    BaseResponse:
      type: object
      properties:
        status:
          type: integer
          description: HTTP status code.
        message:
          type: string
          description: Details about the response, such as error messages.
    LogLevel:
      title: level
      type: string
      description: >
        Type of log entry.


        - `SKIP`. A query is skipped because it doesn't match the conditions for
        successful inclusion. For example, when a query doesn't generate enough
        search results.

        - `INFO`. An informative log entry.

        - `ERROR`. The Query Suggestions process encountered an error.
      enum:
        - SKIP
        - INFO
        - ERROR
  responses:
    BadRequest:
      description: Bad request or request arguments.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorBase'
    FeatureNotEnabled:
      description: This feature is not enabled on your Algolia account.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorBase'
    MethodNotAllowed:
      description: Method not allowed with this API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorBase'
    IndexNotFound:
      description: Index not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorBase'
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/BaseResponse'
          examples:
            Unauthorized:
              summary: Wrong region
              description: >
                Make sure to make your request to the server corresponding to
                your region.


                You can check the region for your application in the [Algolia
                dashboard](https://dashboard.algolia.com/account/infrastructure/analytics).
              value:
                status: 401
                message: The log processing region does not match.
            InvalidCredentials:
              summary: Invalid credentials
              description: Your application ID or API key is wrong.
              value:
                status: 401
                message: Invalid credentials
            MissingACL:
              summary: Key is missing ACL
              description: Your API key is missing the required ACL for this operation.
              value:
                status: 401
                message: The provided API key is missing the \"editSettings\" ACL.
    BadRequest-2:
      description: Bad Request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/BaseResponse'
          examples:
            IndexNameRequired:
              summary: Index name required
              value:
                status: 400
                message: IndexName cannot be empty.
            SourceIndicesRequired:
              summary: Source indices required
              value:
                status: 400
                message: >-
                  Invalid body "sourceIndices needs to contain at least one
                  index".
            SourceIndexNameRequired:
              summary: Source index name required
              value:
                status: 400
                message: Invalid body "every source index must have an `indexName`".
            MinHitsPositive:
              summary: MinHits must be positive
              value:
                status: 400
                message: Invalid body "every source index `minHits` must be positive".
            MinLettersPositive:
              summary: MinLetters must be positive
              value:
                status: 400
                message: >-
                  Invalid body "every source index `minLetters` must be
                  positive".
    UnprocessableEntity:
      description: Unprocessable Entity.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/BaseResponse'
          examples:
            UnprocessableEntity:
              summary: Configuration already exists
              value:
                status: 422
                message: 'Configuration already exists for index: test-qs'
    InternalError:
      description: Internal error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorBase'
    NotFound:
      description: Not Found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/BaseResponse'
          examples:
            NotFound:
              summary: Index not found
              value:
                status: 404
                message: Not Found
    InternalError-2:
      description: Internal Server Error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/BaseResponse'
          examples:
            Error:
              description: >-
                This error can happen if you use a non-existing `indexName` as a
                path parameter when trying to update or delete a Query
                Suggestions configuration.
              value:
                status: 500
                message: Internal Server Error
x-tagGroups:
  - name: Configurations
    tags:
      - configurations
  - name: Logs
    tags:
      - logs
