v1

latestOpenAPI 3.0.3BSL2026-07-17133415718.8 KB
Message

Edit message

This will delete the specified message and replace it with a new message. All messages after the message being edited in the sort order will be deleted. The new message will be generated by the AI based on the new content provided in the request body. The response will include Chunks first on the stream if the topic is using RAG. The structure will look like [chunks]||mesage. See docs.trieve.ai for more information. Auth'ed user or api key must have an admin or owner role for the specified dataset's organization.

put/api/message

Headers

TR-Datasetstring uuid required

The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid.

Request body

audio_inputstring nullable

The base64 encoded audio input of the user message to attach to the topic and then generate an assistant message in response to.

concat_user_messages_queryboolean nullable

If concat user messages query is set to true, all of the user messages in the topic will be concatenated together and used as the search query. If not specified, this defaults to false. Default is false.

currencystring nullable

The currency symbol to use for the completion. If not specified, this defaults to "$".

image_urlsstring[] nullable

The URL of the image(s) to attach to the message.

message_sort_orderinteger required

The sort order of the message to edit.

{"stackTrail":"components:schemas:EditMessageReqPayload:properties:metadata","oasType":"schema","type":"unknown","description":"Metadata is any metadata you want to associate w/ the event that is created from this request","nullable":true}
modelstring nullable

Model name to use for the completion. If not specified, this defaults to the dataset's model.

new_message_contentstring nullable

The new content of the message to replace the old content with.

no_result_messagestring nullable

No result message for when there are no chunks found above the score threshold.

number_of_messages_to_includeinteger nullable

Number of messages to include in the context window. If not specified, this defaults to 10.

only_include_docs_usedboolean nullable

Only include docs used is a boolean that indicates whether or not to only include the docs that were used in the completion. If true, the completion will only include the docs that were used in the completion. If false, the completion will include all of the docs.

page_sizeinteger nullable

Page size is the number of chunks to fetch during RAG. If 0, then no search will be performed. If specified, this will override the N retrievals to include in the dataset configuration. Default is None.

rag_contextstring nullable

Overrides what the way chunks are placed into the context window

remove_stop_wordsboolean nullable

If true, stop words (specified in server/src/stop-words.txt in the git repo) will be removed. Queries that are entirely stop words will be preserved.

score_thresholdnumber float nullable

Set score_threshold to a float to filter out chunks with a score below the threshold. This threshold applies before weight and bias modifications. If not specified, this defaults to 0.0.

search_querystring nullable

Query is the search query. This can be any string. The search_query will be used to create a dense embedding vector and/or sparse vector which will be used to find the result set. If not specified, will default to the last user message or HyDE if HyDE is enabled in the dataset configuration. Default is None.

search_type'fulltext' | 'semantic' | 'hybrid' | 'bm25'
topic_idstring uuid required

The id of the topic to edit the message at the given sort order for.

use_agentic_searchboolean nullable

If true, the search will be conducted using llm tool calling. If not specified, this defaults to false.

use_group_searchboolean nullable
use_quote_negated_termsboolean nullable

If true, quoted and - prefixed words will be parsed from the queries and used as required and negated words respectively. Default is false.

user_idstring nullable

The user_id is the id of the user who is making the request. This is used to track user interactions with the RAG results.

Example request

{
  "filters": {
    "must": [
      {
        "field": "tag_set",
        "match_all": [
          "A",
          "B"
        ]
      },
      {
        "field": "num_value",
        "range": {
          "gte": 10,
          "lte": 25
        }
      }
    ]
  },
  "llm_options": {
    "image_config": {
      "images_per_chunk": 1,
      "use_images": true
    }
  }
}

Response

This will be a HTTP stream, check the chat or search UI for an example how to process this