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

# Update Feedback

> Update an existing feedback entry.

**Required ACL:** `search`


## OpenAPI

````yaml specs/agent-studio.yml patch /1/feedback
openapi: 3.1.0
info:
  title: Agent Studio API
  description: >
    The Agent Studio API lets you build and operate generative AI agents that
    use Algolia data, tools, and your chosen LLM provider.


    Use it to create, configure, publish, and update agents, then generate chat
    completions grounded in live data from your Algolia indices. You can manage
    LLM providers, Agent Studio tools, conversations, feedback, secret keys,
    user data, caching, and application settings for your AI experiences.


    ## Client libraries


    Use Algolia's API clients and libraries to reliably integrate Algolia's APIs
    with your apps.

    The official API clients are covered by Algolia's [Service Level
    Agreement](https://www.algolia.com/policies/sla).


    For more information, see [Algolia's
    ecosystem](https://www.algolia.com/doc/libraries).


    ## Base URLs


    Base URLs for the Agent Studio API:


    - `https://{APPLICATION_ID}.algolia.net`

    - `https://{APPLICATION_ID}-dsn.algolia.net`.
      If your subscription includes a [Distributed Search Network](https://dashboard.algolia.com/infra),
      this ensures that requests are sent to servers closest to users.

    Both URLs provide high availability by distributing requests with load
    balancing.


    All Agent Studio paths are prefixed with `/agent-studio`.


    **All requests must use HTTPS.**


    ## Retry strategy


    To guarantee high availability, implement a retry strategy for all API
    requests using the URLs of your servers as fallbacks:


    - `https://{APPLICATION_ID}-1.algolianet.com`

    - `https://{APPLICATION_ID}-2.algolianet.com`

    - `https://{APPLICATION_ID}-3.algolianet.com`


    These URLs use a different DNS provider than the primary URLs.

    Randomize this list to ensure an even load across the three servers.


    All Algolia API clients implement this retry strategy.


    ## 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).


    ## Rate limits


    The Agent Studio API rate-limits requests.

    Responses include `X-RateLimit-Limit` and `X-RateLimit-Remaining` headers
    with the current limit.

    When you exceed the limit, the API returns a `429` status with a
    `Retry-After` header.


    ## Request format


    Request bodies must be JSON objects.


    ## Parameters


    Parameters are passed as query parameters for GET and DELETE requests,

    and in the request body for POST and PUT requests.


    Query parameters must be
    [URL-encoded](https://developer.mozilla.org/en-US/docs/Glossary/Percent-encoding).

    Non-ASCII characters must be UTF-8 encoded.

    Plus characters (`+`) are interpreted as spaces.


    ## Response status and errors


    The Agent Studio API returns JSON responses. Since JSON doesn't guarantee
    any specific ordering, don't rely on the order of attributes in the API
    response.


    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 Agent Studio API is version 1, indicated by the
    `/1/` in each endpoint's URL.
  version: 1.0.0
servers:
  - url: https://{APPLICATION_ID}.algolia.net/agent-studio
    description: Agent Studio API.
    variables:
      APPLICATION_ID:
        default: EXAMPLE
        description: Your Algolia application ID.
security:
  - appId: []
    apiKey: []
tags:
  - name: Agents
    description: Manage your agents.
  - name: Allowed Domains
    description: Restrict where an agent's API key may be used.
  - name: Completions
    description: Generate completions.
  - name: Configurations
    description: Manage Agent Studio related application configurations.
  - name: Context
    description: Compact or trim conversation context before sending it to completions.
  - name: Conversations
    description: View, export, and delete conversation history.
  - name: Feedback
    description: Capture user feedback on agent responses.
  - name: Providers
    description: Manage your LLM providers.
  - name: Secret Keys
    description: Manage secret keys used to authenticate requests.
  - name: Tasks
    description: Run configured agent tasks.
  - name: User Data
    description: Manage end-user data associated with conversations.
paths:
  /1/feedback:
    patch:
      tags:
        - Feedback
      summary: Update Feedback
      description: Update an existing feedback entry.
      operationId: updateFeedback
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FeedbackUpdateRequest'
      responses:
        '200':
          description: Successful Response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FeedbackResponse'
        '422':
          description: Validation Error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-codeSamples:
        - lang: csharp
          label: C#
          source: |-
            // Initialize the client
            var client = new AgentStudioClient(
              new AgentStudioConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")
            );

            // Call the API
            var response = await client.UpdateFeedbackAsync(
              new FeedbackUpdateRequest
              {
                MessageId = "msg-abc123",
                AgentId = "76710f1b-8231-42e5-b0d1-f43aac618e15",
              }
            );

            // print the response
            Console.WriteLine(response);
        - lang: dart
          label: Dart
          source: |-
            // Initialize the client
            final client = AgentStudioClient(
                appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY');

            // Call the API
            final response = await client.updateFeedback(
              feedbackUpdateRequest: FeedbackUpdateRequest(
                messageId: "msg-abc123",
                agentId: "76710f1b-8231-42e5-b0d1-f43aac618e15",
              ),
            );

            // print the response
            print(response);
        - lang: go
          label: Go
          source: >-
            // Initialize the client

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

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


            // Call the API

            response, err :=
            client.UpdateFeedback(client.NewApiUpdateFeedbackRequest(

              agentStudio.NewEmptyFeedbackUpdateRequest().SetMessageId("msg-abc123").SetAgentId("76710f1b-8231-42e5-b0d1-f43aac618e15")))
            if err != nil {
              // handle the eventual error
              panic(err)
            }



            // print the response

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

            AgentStudioClient client = new
            AgentStudioClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY");


            // Call the API

            FeedbackResponse response = client.updateFeedback(
              new FeedbackUpdateRequest().setMessageId("msg-abc123").setAgentId("76710f1b-8231-42e5-b0d1-f43aac618e15")
            );


            // print the response

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

            const client = agentStudioClient('ALGOLIA_APPLICATION_ID',
            'ALGOLIA_API_KEY');


            // Call the API

            const response = await client.updateFeedback({
              messageId: 'msg-abc123',
              agentId: '76710f1b-8231-42e5-b0d1-f43aac618e15',
            });



            // print the response

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

            val client = AgentStudioClient(appId = "ALGOLIA_APPLICATION_ID",
            apiKey = "ALGOLIA_API_KEY")


            // Call the API

            var response =
              client.updateFeedback(
                feedbackUpdateRequest =
                  FeedbackUpdateRequest(
                    messageId = "msg-abc123",
                    agentId = "76710f1b-8231-42e5-b0d1-f43aac618e15",
                  )
              )


            // print the response

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

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


            // Call the API

            $response = $client->updateFeedback(
                ['messageId' => 'msg-abc123',
                    'agentId' => '76710f1b-8231-42e5-b0d1-f43aac618e15',
                ],
            );



            // print the response

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

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

            client = AgentStudioClientSync("ALGOLIA_APPLICATION_ID",
            "ALGOLIA_API_KEY")


            # Call the API

            response = client.update_feedback(
                feedback_update_request={
                    "messageId": "msg-abc123",
                    "agentId": "76710f1b-8231-42e5-b0d1-f43aac618e15",
                },
            )



            # print the response

            print(response)
        - lang: ruby
          label: Ruby
          source: >-
            # Initialize the client

            client = Algolia::AgentStudioClient.create("ALGOLIA_APPLICATION_ID",
            "ALGOLIA_API_KEY")


            # Call the API

            response = client.update_feedback(
              Algolia::AgentStudio::FeedbackUpdateRequest.new(
                message_id: "msg-abc123",
                agent_id: "76710f1b-8231-42e5-b0d1-f43aac618e15"
              )
            )



            # print the response

            puts(response)
        - lang: scala
          label: Scala
          source: >-
            // Initialize the client

            val client = AgentStudioClient(appId = "ALGOLIA_APPLICATION_ID",
            apiKey = "ALGOLIA_API_KEY")


            // Call the API

            val response = Await.result(
              client.updateFeedback(
                feedbackUpdateRequest = FeedbackUpdateRequest(
                  messageId = "msg-abc123",
                  agentId = "76710f1b-8231-42e5-b0d1-f43aac618e15"
                )
              ),
              Duration(100, "sec")
            )


            // print the response

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

            let client = try AgentStudioClient(appID: "ALGOLIA_APPLICATION_ID",
            apiKey: "ALGOLIA_API_KEY")


            // Call the API

            let response = try await
            client.updateFeedback(feedbackUpdateRequest: FeedbackUpdateRequest(
                messageId: "msg-abc123",
                agentId: "76710f1b-8231-42e5-b0d1-f43aac618e15"
            ))


            // print the response

            print(response)
        - lang: cURL
          label: curl
          source: |-
            curl --request PATCH \
              --url https://example.algolia.net/agent-studio/1/feedback \
              --header 'accept: application/json' \
              --header 'content-type: application/json' \
              --header 'x-algolia-api-key: ALGOLIA_API_KEY' \
              --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' \
              --data '
            {
              "messageId": "lorem",
              "agentId": "lorem",
              "vote": 0,
              "tags": [
                "lorem"
              ],
              "notes": "lorem"
            }
            '
components:
  schemas:
    FeedbackUpdateRequest:
      properties:
        agentId:
          type: string
          title: agentid
        messageId:
          type: string
          title: messageid
        notes:
          oneOf:
            - type: string
              maxLength: 1000
            - type: 'null'
          title: notes
        tags:
          oneOf:
            - items:
                type: string
                maxLength: 50
              type: array
              maxItems: 10
            - type: 'null'
          title: tags
        vote:
          oneOf:
            - $ref: '#/components/schemas/VoteEnum'
            - type: 'null'
          title: vote
      type: object
      required:
        - messageId
        - agentId
      title: feedbackUpdateRequest
      description: Request model for updating an existing feedback entry.
    FeedbackResponse:
      properties:
        agentId:
          type: string
          title: agentid
        createdAt:
          type: string
          title: createdat
        id:
          type: string
          title: id
        messageId:
          type: string
          title: messageid
        tags:
          items:
            type: string
          type: array
          title: tags
        updatedAt:
          type: string
          title: updatedat
        vote:
          type: integer
          title: vote
        model:
          oneOf:
            - type: string
            - type: 'null'
          title: model
        notes:
          oneOf:
            - type: string
            - type: 'null'
          title: notes
      type: object
      required:
        - id
        - agentId
        - messageId
        - vote
        - tags
        - createdAt
        - updatedAt
      title: feedbackResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: detail
      type: object
      title: hTTPValidationError
    VoteEnum:
      type: integer
      enum:
        - 0
        - 1
      x-enum-varnames:
        - downvote
        - upvote
    ValidationError:
      properties:
        loc:
          items:
            $ref: '#/components/schemas/LocationItemUnion'
          type: array
          title: location
        msg:
          type: string
          title: message
        type:
          type: string
          title: errorType
      type: object
      required:
        - loc
        - msg
        - type
      title: validationError
    LocationItemUnion:
      oneOf:
        - type: string
        - type: integer
  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.

````