Skip to main content

AI Assistants - Rate Message

Endpoint

/i/ai-assistants/rate-message

Enterprise Only
This API is available exclusively in Countly Enterprise.

Overview

Rates one assistant message in a thread and records feedback telemetry.

Authentication

Authentication Methods:

  • API Key (parameter): api_key=YOUR_API_KEY
  • Auth Token (parameter): auth_token=YOUR_AUTH_TOKEN
  • Auth Token (header): countly-token: YOUR_AUTH_TOKEN

Permissions

  • Requires an authenticated Countly user.
  • Thread rating is owner-restricted.

Request Parameters

ParameterTypeRequiredDescription
api_keyStringYes (or auth_token)API key authentication
auth_tokenStringYes (or api_key)Auth token authentication
app_idStringYesApp ID (required by validation)
threadIdStringYesThread ID
messageIdStringYesMessage ID in thread
ratingStringYesRating value (typically thumbs_up or thumbs_down)

Response

Success Response

{
"ok": 1
}

Response Fields

FieldTypeDescription
okNumberRequest processed successfully

Error Responses

  • HTTP 400 - Invalid parameters:
{
"result": "Invalid parameters: <details>"
}
  • HTTP 400 - Missing auth parameters:
{
"result": "Missing parameter \"api_key\" or \"auth_token\""
}
  • HTTP 401 - User/auth validation failed:
{
"result": "User does not exist"
}
  • HTTP 403 - Not authorized for thread:
{
"result": "Not authorized"
}
  • HTTP 404 - Thread not found:
{
"result": "Thread not found"
}
  • HTTP 404 - App not found:
{
"result": "App not found"
}
  • HTTP 500 - Rating failed:
{
"result": "Couldn't rate the message"
}

Behavior/Processing

  1. Validates user authentication and required parameters.
  2. Loads thread and verifies ownership.
  3. Validates associated app exists.
  4. Writes message rating to thread.
  5. Emits feedback tracking event.
  6. Returns { "ok": 1 }.

Database Collections

CollectionUsed forData touched by this endpoint
countly.ai_assistants_threadsEndpoint data sourceStores endpoint-related records this endpoint reads or modifies.
countly.appsApp configuration and metadataStores app-level feature settings and metadata used or modified by this endpoint.

Examples

Example: Rate a message

curl "https://your-server.com/i/ai-assistants/rate-message?api_key=YOUR_API_KEY&app_id=YOUR_APP_ID&threadId=THREAD_ID&messageId=MESSAGE_ID&rating=thumbs_up"

Ⓔ Enterprise

This feature is part of Countly Enterprise.

Get Access:

Already a Customer? Use support portal if you have any questions.

Last Updated

2026-02-15

Last Updated

2026-02-16