> ## Documentation Index
> Fetch the complete documentation index at: https://algolia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete a configuration

> 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` operation.

**Required ACL:** `editSettings`


## OpenAPI

````yaml specs/query-suggestions.yml delete /1/configs/{indexName}
openapi: 3.1.0
info:
  title: Query Suggestions API
  summary: >-
    The Query Suggestions API lets you manage your Query Suggestions
    configurations
  description: >
    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


    Base URLs for the Query Suggestions API:


    - `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


    Add these headers to authenticate requests:


    - `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/api-keys).


    ## 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 `2xx` statuses. Client errors return `4xx`
    statuses. Server errors return `5xx` statuses.

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


    ## Version


    The current version of the Query Suggestions API is version 1, 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:
        description: The region where your Algolia application is hosted.
        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:
  /1/configs/{indexName}:
    delete:
      tags:
        - configurations
      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` operation.
      operationId: deleteConfig
      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(
                "ALGOLIA_APPLICATION_ID",
                "ALGOLIA_API_KEY",
                "ALGOLIA_APPLICATION_REGION"
              )
            );

            // Call the API
            var response = await client.DeleteConfigAsync("<YOUR_INDEX_NAME>");

            // print the response
            Console.WriteLine(response);
        - lang: go
          label: Go
          source: >-
            // Initialize the client with your application region, eg.
            suggestions.ALGOLIA_APPLICATION_REGION

            client, err := suggestions.NewClient("ALGOLIA_APPLICATION_ID",
            "ALGOLIA_API_KEY", suggestions.US)

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


            // Call the API

            response, err :=
            client.DeleteConfig(client.NewApiDeleteConfigRequest(
              "<YOUR_INDEX_NAME>"))
            if err != nil {
              // handle the eventual error
              panic(err)
            }



            // print the response

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

            QuerySuggestionsClient client = new
            QuerySuggestionsClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY",
            "ALGOLIA_APPLICATION_REGION");


            // Call the API

            BaseResponse response = client.deleteConfig("<YOUR_INDEX_NAME>");


            // print the response

            System.out.println(response);
        - lang: javascript
          label: JavaScript
          source: >-
            // Initialize the client

            // Replace 'us' with your Algolia Application Region

            const client = algoliasearch('ALGOLIA_APPLICATION_ID',
            'ALGOLIA_API_KEY').initQuerySuggestions({ region: 'us' });


            // Call the API

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



            // print the response

            console.log(response);
        - lang: kotlin
          label: Kotlin
          source: |-
            // Initialize the client
            val client =
              QuerySuggestionsClient(
                appId = "ALGOLIA_APPLICATION_ID",
                apiKey = "ALGOLIA_API_KEY",
                region = "ALGOLIA_APPLICATION_REGION",
              )

            // Call the API
            var response = client.deleteConfig(indexName = "<YOUR_INDEX_NAME>")


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

            $client = QuerySuggestionsClient::create('ALGOLIA_APPLICATION_ID',
            'ALGOLIA_API_KEY', 'ALGOLIA_APPLICATION_REGION');


            // Call the API

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



            // print the response

            var_dump($response);
        - lang: python
          label: Python
          source: >-
            # Initialize the client

            # In an asynchronous context, you can use QuerySuggestionsClient
            instead, which exposes the exact same methods.

            client = QuerySuggestionsClientSync(
                "ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY", "ALGOLIA_APPLICATION_REGION"
            )


            # Call the API

            response = client.delete_config(
                index_name="<YOUR_INDEX_NAME>",
            )



            # print the response

            print(response)
        - lang: ruby
          label: Ruby
          source: |-
            # Initialize the client
            client = Algolia::QuerySuggestionsClient.create(
              "ALGOLIA_APPLICATION_ID",
              "ALGOLIA_API_KEY",
              "ALGOLIA_APPLICATION_REGION"
            )

            # Call the API
            response = client.delete_config("<YOUR_INDEX_NAME>")


            # print the response
            puts(response)
        - lang: scala
          label: Scala
          source: |-
            // Initialize the client
            val client = QuerySuggestionsClient(
              appId = "ALGOLIA_APPLICATION_ID",
              apiKey = "ALGOLIA_API_KEY",
              region = "ALGOLIA_APPLICATION_REGION"
            )

            // Call the API
            val response = Await.result(
              client.deleteConfig(
                indexName = "<YOUR_INDEX_NAME>"
              ),
              Duration(100, "sec")
            )

            // print the response
            println(response)
        - lang: swift
          label: Swift
          source: >-
            // Initialize the client

            let client = try QuerySuggestionsClient(appID:
            "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY", region: .us)


            // Call the API

            let response = try await client.deleteConfig(indexName:
            "<YOUR_INDEX_NAME>")


            // print the response

            print(response)
        - lang: cURL
          label: curl
          source: |-
            curl --request DELETE \
              --url https://query-suggestions.us.algolia.com/1/configs/ALGOLIA_INDEX_NAME \
              --header 'accept: application/json' \
              --header 'x-algolia-api-key: ALGOLIA_API_KEY' \
              --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID'
components:
  parameters:
    IndexName:
      name: indexName
      in: path
      required: true
      description: Query Suggestions index name.
      schema:
        $ref: '#/components/schemas/IndexName'
  schemas:
    BaseResponse:
      type: object
      properties:
        message:
          type: string
          description: Details about the response, such as error messages.
        status:
          type: integer
          description: HTTP status code.
    IndexName:
      title: indexName
      type: string
      description: Name of the Query Suggestions index (case-sensitive).
      example: ALGOLIA_INDEX_NAME
  responses:
    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.
    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
  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.

````