# Submit feedback

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://help.moveworks.com/api-reference/beta-conversations-api/messages/llms.txt.
> For full documentation content, see https://help.moveworks.com/api-reference/beta-conversations-api/messages/llms-full.txt.

POST https://api.moveworks.ai/rest/v1beta1/conversations/{conversation_id}/responses/{response_id}/messages/{message_id}/feedback
Content-Type: application/json

Submits a feedback rating (helpful or unhelpful) for a specific assistant message.

Use the `callback_id` from the message's `feedback` field to indicate which rating is being submitted. The `callback_id` is an opaque token. Pass it back exactly as received.

Optionally include `additional_feedback` for free-text comments.

Reference: https://help.moveworks.com/api-reference/beta-conversations-api/messages/submit-feedback

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: conversations-api
  version: 1.0.0
paths:
  /conversations/{conversation_id}/responses/{response_id}/messages/{message_id}/feedback:
    post:
      operationId: submit-feedback
      summary: Submit feedback
      description: >-
        Submits a feedback rating (helpful or unhelpful) for a specific
        assistant message.


        Use the `callback_id` from the message's `feedback` field to indicate
        which rating is being submitted. The `callback_id` is an opaque token.
        Pass it back exactly as received.


        Optionally include `additional_feedback` for free-text comments.
      tags:
        - subpackage_messages
      parameters:
        - name: conversation_id
          in: path
          description: A base-62 identifier prefixed by a short resource type
          required: true
          schema:
            type: string
        - name: response_id
          in: path
          description: A base-62 identifier prefixed by a short resource type
          required: true
          schema:
            type: string
        - name: message_id
          in: path
          description: A base-62 identifier prefixed by a short resource type
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: >-
            JWT bearer token authentication. Obtain an access token from the
            Moveworks auth endpoint and include it in the Authorization header
            as 'Bearer <token>'.
          required: true
          schema:
            type: string
        - name: Assistant-Name
          in: header
          description: >-
            The Moveworks assistant identifier that was configured for your
            organization.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Feedback submitted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubmitFeedbackResponse'
        '400':
          description: >-
            Invalid request - the callback_id is malformed, does not match this
            message, or this message does not support feedback
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvalidFeedbackErrorResponse'
        '404':
          description: Not found - conversation, response, or message does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponse'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitExceededErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalErrorResponse'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubmitFeedbackRequest'
servers:
  - url: https://api.moveworks.ai/rest/v1beta1
components:
  schemas:
    SubmitFeedbackRequest:
      type: object
      properties:
        callback_id:
          type: string
          description: >-
            The callback_id from either `feedback.helpful` or
            `feedback.unhelpful` on the message object. Determines which rating
            (helpful or unhelpful) is being submitted.
        additional_feedback:
          type: string
          description: >-
            Optional free-text feedback from the user. Use this to capture
            additional context about why the user rated the response this way.
      required:
        - callback_id
      title: SubmitFeedbackRequest
    SubmitFeedbackResponseStatus:
      type: string
      enum:
        - SUBMITTED
      description: Feedback submission status
      title: SubmitFeedbackResponseStatus
    SubmitFeedbackResponse:
      type: object
      properties:
        status:
          $ref: '#/components/schemas/SubmitFeedbackResponseStatus'
          description: Feedback submission status
      required:
        - status
      title: SubmitFeedbackResponse
    InvalidFeedbackErrorResponseErrorCode:
      type: string
      enum:
        - INVALID_REQUEST
      title: InvalidFeedbackErrorResponseErrorCode
    InvalidFeedbackErrorResponseError:
      type: object
      properties:
        code:
          $ref: '#/components/schemas/InvalidFeedbackErrorResponseErrorCode'
        message:
          type: string
      required:
        - code
        - message
      title: InvalidFeedbackErrorResponseError
    InvalidFeedbackErrorResponse:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/InvalidFeedbackErrorResponseError'
      required:
        - error
      description: Error response for invalid feedback submission
      title: InvalidFeedbackErrorResponse
    NotFoundErrorResponseErrorCode:
      type: string
      enum:
        - NOT_FOUND
      title: NotFoundErrorResponseErrorCode
    NotFoundErrorResponseError:
      type: object
      properties:
        code:
          $ref: '#/components/schemas/NotFoundErrorResponseErrorCode'
        message:
          type: string
      required:
        - code
        - message
      title: NotFoundErrorResponseError
    NotFoundErrorResponse:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/NotFoundErrorResponseError'
      required:
        - error
      description: Error response for resource not found
      title: NotFoundErrorResponse
    RateLimitExceededErrorResponseErrorCode:
      type: string
      enum:
        - RATE_LIMIT_EXCEEDED
      title: RateLimitExceededErrorResponseErrorCode
    RateLimitExceededErrorResponseError:
      type: object
      properties:
        code:
          $ref: '#/components/schemas/RateLimitExceededErrorResponseErrorCode'
        message:
          type: string
      required:
        - code
        - message
      title: RateLimitExceededErrorResponseError
    RateLimitExceededErrorResponse:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/RateLimitExceededErrorResponseError'
      required:
        - error
      description: Error response for rate limit exceeded
      title: RateLimitExceededErrorResponse
    InternalErrorResponseErrorCode:
      type: string
      enum:
        - INTERNAL_ERROR
      title: InternalErrorResponseErrorCode
    InternalErrorResponseError:
      type: object
      properties:
        code:
          $ref: '#/components/schemas/InternalErrorResponseErrorCode'
        message:
          type: string
      required:
        - code
        - message
      title: InternalErrorResponseError
    InternalErrorResponse:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/InternalErrorResponseError'
      required:
        - error
      description: Error response for internal server error
      title: InternalErrorResponse
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        JWT bearer token authentication. Obtain an access token from the
        Moveworks auth endpoint and include it in the Authorization header as
        'Bearer <token>'.

```

## SDK Code Examples

```python Messages_submitFeedback_example
import requests

url = "https://api.moveworks.ai/rest/v1beta1/conversations/conv_32bt7BMLhLyVzTUjfi35N/responses/resp_32bt7rXXugeJjvE3pQzOk/messages/msg_32bt8vagXAoRwRLIdI2Oj/feedback"

payload = {
    "callback_id": "eyJhY3Rpb24iOiJoZWxwZnVsIi4uLn0",
    "additional_feedback": "The response answered my question clearly."
}
headers = {
    "Assistant-Name": "acmecorp-conversations-rest-api",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Messages_submitFeedback_example
const url = 'https://api.moveworks.ai/rest/v1beta1/conversations/conv_32bt7BMLhLyVzTUjfi35N/responses/resp_32bt7rXXugeJjvE3pQzOk/messages/msg_32bt8vagXAoRwRLIdI2Oj/feedback';
const options = {
  method: 'POST',
  headers: {
    'Assistant-Name': 'acmecorp-conversations-rest-api',
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json'
  },
  body: '{"callback_id":"eyJhY3Rpb24iOiJoZWxwZnVsIi4uLn0","additional_feedback":"The response answered my question clearly."}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Messages_submitFeedback_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.moveworks.ai/rest/v1beta1/conversations/conv_32bt7BMLhLyVzTUjfi35N/responses/resp_32bt7rXXugeJjvE3pQzOk/messages/msg_32bt8vagXAoRwRLIdI2Oj/feedback"

	payload := strings.NewReader("{\n  \"callback_id\": \"eyJhY3Rpb24iOiJoZWxwZnVsIi4uLn0\",\n  \"additional_feedback\": \"The response answered my question clearly.\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Assistant-Name", "acmecorp-conversations-rest-api")
	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Messages_submitFeedback_example
require 'uri'
require 'net/http'

url = URI("https://api.moveworks.ai/rest/v1beta1/conversations/conv_32bt7BMLhLyVzTUjfi35N/responses/resp_32bt7rXXugeJjvE3pQzOk/messages/msg_32bt8vagXAoRwRLIdI2Oj/feedback")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Assistant-Name"] = 'acmecorp-conversations-rest-api'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"callback_id\": \"eyJhY3Rpb24iOiJoZWxwZnVsIi4uLn0\",\n  \"additional_feedback\": \"The response answered my question clearly.\"\n}"

response = http.request(request)
puts response.read_body
```

```java Messages_submitFeedback_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.moveworks.ai/rest/v1beta1/conversations/conv_32bt7BMLhLyVzTUjfi35N/responses/resp_32bt7rXXugeJjvE3pQzOk/messages/msg_32bt8vagXAoRwRLIdI2Oj/feedback")
  .header("Assistant-Name", "acmecorp-conversations-rest-api")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"callback_id\": \"eyJhY3Rpb24iOiJoZWxwZnVsIi4uLn0\",\n  \"additional_feedback\": \"The response answered my question clearly.\"\n}")
  .asString();
```

```php Messages_submitFeedback_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.moveworks.ai/rest/v1beta1/conversations/conv_32bt7BMLhLyVzTUjfi35N/responses/resp_32bt7rXXugeJjvE3pQzOk/messages/msg_32bt8vagXAoRwRLIdI2Oj/feedback', [
  'body' => '{
  "callback_id": "eyJhY3Rpb24iOiJoZWxwZnVsIi4uLn0",
  "additional_feedback": "The response answered my question clearly."
}',
  'headers' => [
    'Assistant-Name' => 'acmecorp-conversations-rest-api',
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Messages_submitFeedback_example
using RestSharp;

var client = new RestClient("https://api.moveworks.ai/rest/v1beta1/conversations/conv_32bt7BMLhLyVzTUjfi35N/responses/resp_32bt7rXXugeJjvE3pQzOk/messages/msg_32bt8vagXAoRwRLIdI2Oj/feedback");
var request = new RestRequest(Method.POST);
request.AddHeader("Assistant-Name", "acmecorp-conversations-rest-api");
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"callback_id\": \"eyJhY3Rpb24iOiJoZWxwZnVsIi4uLn0\",\n  \"additional_feedback\": \"The response answered my question clearly.\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Messages_submitFeedback_example
import Foundation

let headers = [
  "Assistant-Name": "acmecorp-conversations-rest-api",
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "callback_id": "eyJhY3Rpb24iOiJoZWxwZnVsIi4uLn0",
  "additional_feedback": "The response answered my question clearly."
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.moveworks.ai/rest/v1beta1/conversations/conv_32bt7BMLhLyVzTUjfi35N/responses/resp_32bt7rXXugeJjvE3pQzOk/messages/msg_32bt8vagXAoRwRLIdI2Oj/feedback")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```