v1

latestOpenAPI 3.0.3BSL2026-07-17133415718.8 KB
Topic

Create Topic

Create a new chat topic. Topics are attached to a owner_id's and act as a coordinator for conversation message history of gen-AI chat sessions. Auth'ed user or api key must have an admin or owner role for the specified dataset's organization.

post/api/topic

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

first_user_messagestring nullable

The first message which will belong to the topic. The topic name is generated based on this message similar to how it works in the OpenAI chat UX if a name is not explicitly provided on the name request body key.

{"stackTrail":"components:schemas:CreateTopicReqPayload: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}
namestring nullable

The name of the topic. If this is not provided, the topic name is generated from the first_user_message.

owner_idstring required

The owner_id of the topic. This is typically a browser fingerprint or your user's id. It is used to group topics together for a user.

Response

The JSON response payload containing the created topic

created_atstring date-time required
dataset_idstring uuid required
deletedboolean required
idstring uuid required
namestring required
owner_idstring required
updated_atstring date-time required

Example response

{
  "created_at": "2021-01-01 00:00:00.000",
  "dataset_id": "e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3",
  "deleted": false,
  "id": "e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3",
  "name": "Trieve",
  "owner_id": "e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3",
  "updated_at": "2021-01-01 00:00:00.000"
}