Conversation API
Introduction
The Conversation API allows external access to delete and tag conversations within Rasa Studio.
Requirements
- Required API Role
Manage Conversations
. See Authorization page to learn how to access configuration. - Assistant API ID. See guide for user configuration for more details.
- Tag IDs. To see how to access page from screenshot see guide for conversation review.
Available APIs
rawConversations
Query: Schema:
RawConversationsInput
Input: Field | Description |
---|---|
assistantId | The unique identifier of the assistant. |
fromTime | Optional start time filter for the conversation retrieval in ISO 8601 UTC format (YYYY-MM-DDTHH:MM:SS.sssZ ). |
toTime | Optional end time filter for the conversation retrieval in ISO 8601 UTC format (YYYY-MM-DDTHH:MM:SS.sssZ ). |
limit | Limits the number of conversations returned. Default is 10 . |
offset | Skips a specified number of conversations for pagination. Default is 0 . |
RawConversationsOutput
Output: Field | Description |
---|---|
conversations | A list of raw conversation objects. Each conversation contains an id and a list of conversationEvents in JSON format. |
count | Total count of conversations matching the query criteria. Count is not affected by paging arguments limit and offset . |
conversationEvents
JSON Structure for The conversationEvents
field contains a list of events that occur within a conversation. These events follow a specific structure that can vary depending on the type of event. For a full description of all possible events, please refer to the Rasa Events Documentation.
Here are a few examples:
Example 1: User Uttered Event
Example 2: Bot Uttered Event
Example 3: Action Executed Event
curl
Request
Example Here's an example cURL request to the rawConversations
endpoint:
addConversationTagToConversation
Mutation: Schema:
AddConversationTagToConversationInput
Input: Field | Description |
---|---|
conversationId | The unique identifier of the conversation to which the tag will be added. |
tagId | The unique identifier of the tag to be added to the conversation. |
Output
Returns true
if the tag was successfully added.
Note: If the tag already exists, the endpoint will also return true. If a non-existent conversation, tag, or resource mismatch occurs, a descriptive error message with an appropriate error code is returned.
curl
Request
Example removeConversationTagFromConversation
Mutation: Schema:
RemoveConversationTagFromConversationInput
Input: Field | Description |
---|---|
conversationId | Unique identifier of the conversation from which the tag should be removed. |
tagId | Unique identifier of the tag to be removed from the conversation. |
Output
Returns true
if the tag was successfully removed.
Note: If the provided tagId
is not linked to the conversationId
, or if the provided conversationId
or tagId
is not present in the system, the endpoint will still return true
.
curl
Request
Example deleteConversations
Mutation: Schema:
DeleteConversationsInput
Input: Field | Description |
---|---|
conversationIds | List of conversation IDs to be deleted. |
Output
Returns the count of deleted conversations.
Note: Count
only counts conversations that were actually deleted. If all IDs passed to API were invalid count
will be zero.