clock-rotate-leftConversation History

Retrieve conversation history, messages, audio sources, tags, response recommendations, and insights.

Retrieve and analyze historical conversation data for users and services.

circle-info

Data Access Access conversation history for analytics, quality assurance, and user experience improvements.

List Conversations

Get conversations

get
/v1/{organization}/conversation/

Retrieve conversations in an organization based on supplied filters.

Permissions

This endpoint may be impacted by the following permissions:

  • The final_message field in the response is only non-empty if the authenticated user has the Conversation.GetMessage permission on the final message.
  • The version_set_info field in the response is only non-empty if the authenticated user has the Service.GetVersionSet permission on the version set.
  • Only conversations for which the user has the Conversation.GetConversation permission are returned.
Authorizations
AuthorizationstringRequired

The username should be set to {org_id}_{user_id}, and the password should be the Amigo issued JWT token that identifies the user.

AuthorizationstringRequired

Amigo issued JWT token that identifies an user. It's issued either after logging in through the frontend, or manually through the SignInWithAPIKey endpoint.

X-ORG-IDstringRequired

An optional organization identifier that indicates from which organization the token is issued. This is used in rare cases where the user to authenticate is making a request for resources in another organization.

Path parameters
organizationstringRequired
Query parameters
user_idstring[]Optional

The identifier of the user whose conversations to retrieve.

Default: []
service_idstring[]Optional

The identifier of the service whose conversation to retrieve.

Default: []
is_finishedany ofOptional

Whether the conversation is finished.

booleanOptional
or
nullOptional
idstring[]Optional

The ID of the conversation to retrieve.

Default: []
limitinteger · max: 150Optional

The maximum number of conversations to retrieve.

Default: 150
continuation_tokenintegerOptional

The continuation token returned from the previous response to retrieve the next set of conversations.

Default: 0
sort_bystring[]Optional

The field to sort the conversations by. Supported fields are created_at. Specify a + before the field name to indicate ascending sorting and - for descending sorting. Multiple fields can be specified to break ties.

Default: []
tagstring[]Optional

The tags of the dynamic behavior sets. Must be specified using the syntax key:value, which means to match all sets with the given key and value pair among its tags. If value is *, it means the value does not matter. If value is empty, it matches against when the value is None.

Default: []
Header parameters
x-mongo-cluster-nameany ofOptional

The Mongo cluster name to perform this request in. This is usually not needed unless the organization does not exist yet in the Amigo organization infra config database.

stringOptional
or
nullOptional
Sec-WebSocket-Protocolstring[]OptionalDefault: []
Responses
chevron-right
200

Succeeded.

application/json
has_morebooleanRequired

Whether there are more conversations to retrieve.

continuation_tokenany ofRequired

A token to supply to the next request to retrieve the next page of conversations. Only populated if has_more is True.

integerOptional
or
nullOptional
get
/v1/{organization}/conversation/

Query Parameters

Parameter
Type
Description

user_id

string

Filter by specific user

service_id

string

Filter by specific service

is_finished

boolean

Filter by conversation state

limit

integer

Results per page (max 100)

continuation_token

string

Pagination token

Get Conversation Messages

Retrieve all messages from a specific conversation.

circle-info

Message Order Messages are returned in chronological order, preserving the conversation flow.

Get conversation messages

get
/v1/{organization}/conversation/{conversation_id}/messages/

Retrieve messages in a conversation, sorted in the specified order, up to the specified limit.

Permissions

This endpoint is impacted by the following permissions:

  • Only messages that the authenticated user has Conversation.GetMessage permission on will be returned.
Authorizations
AuthorizationstringRequired

The username should be set to {org_id}_{user_id}, and the password should be the Amigo issued JWT token that identifies the user.

AuthorizationstringRequired

Amigo issued JWT token that identifies an user. It's issued either after logging in through the frontend, or manually through the SignInWithAPIKey endpoint.

X-ORG-IDstringRequired

An optional organization identifier that indicates from which organization the token is issued. This is used in rare cases where the user to authenticate is making a request for resources in another organization.

Path parameters
organizationstringRequired
conversation_idstringRequired

The identifier of the conversation.

Pattern: ^[a-f0-9]{24}$
Query parameters
idstring[]Optional

The IDs of the messages to retrieve.

Default: []
interaction_idstring[]Optional

The IDs of the interactions to retrieve messages for.

Default: []
limitinteger · max: 500Optional

The maximum number of messages to return. At most 500 messages can be returned in one request.

Default: 500
continuation_tokenintegerOptional

The continuation token to use to retrieve the next set of messages.

Default: 0
sort_bystring[]Optional

The field to sort the messages by. Supported fields are interaction_id and created_at. Specify a + before the field name to indicate ascending sorting and - for descending sorting. Multiple fields can be specified to break ties.

Default: []
Header parameters
x-mongo-cluster-nameany ofOptional

The Mongo cluster name to perform this request in. This is usually not needed unless the organization does not exist yet in the Amigo organization infra config database.

stringOptional
or
nullOptional
Sec-WebSocket-Protocolstring[]OptionalDefault: []
Responses
chevron-right
200

Succeeded.

application/json
has_morebooleanRequired

Whether there are more, earlier messages in the conversation to retrieve.

continuation_tokenany ofRequired

The continuation token to use to retrieve the next set of messages.

integerOptional
or
nullOptional
get
/v1/{organization}/conversation/{conversation_id}/messages/

Retrieve Message Source

For non-text messages (e.g., audio from voice channels), retrieve the original source data. Returns a signed URL to the raw message content.

circle-exclamation

Retrieve message source

get
/v1/{organization}/conversation/{conversation_id}/messages/{message_id}/source

Retrieve the raw source of the given message. It's only applicable to messages that did not originate as texts.

Permissions

This endpoint requires the following permissions:

  • Conversation:GetMessage on the the message.
Authorizations
AuthorizationstringRequired

The username should be set to {org_id}_{user_id}, and the password should be the Amigo issued JWT token that identifies the user.

AuthorizationstringRequired

Amigo issued JWT token that identifies an user. It's issued either after logging in through the frontend, or manually through the SignInWithAPIKey endpoint.

X-ORG-IDstringRequired

An optional organization identifier that indicates from which organization the token is issued. This is used in rare cases where the user to authenticate is making a request for resources in another organization.

Path parameters
organizationstringRequired
conversation_idstringRequired

The identifier of the conversation.

Pattern: ^[a-f0-9]{24}$
message_idstringRequired

The identifier of the message.

Pattern: ^[a-f0-9]{24}$
Query parameters
long_livedbooleanOptional

Whether to generate a long-lived URL which lasts 12 hours. For security purposes, it's recommended to set this to false as much as possible.

Default: false
Header parameters
x-mongo-cluster-nameany ofOptional

The Mongo cluster name to perform this request in. This is usually not needed unless the organization does not exist yet in the Amigo organization infra config database.

stringOptional
or
nullOptional
Sec-WebSocket-Protocolstring[]OptionalDefault: []
Responses
chevron-right
200

Succeeded.

application/json
anyOptional
get
/v1/{organization}/conversation/{conversation_id}/messages/{message_id}/source

No content

Query Parameters

Parameter
Type
Default
Description

long_lived

boolean

false

Generate a long-lived URL valid for 12 hours. Short-lived URLs are recommended for security.

Modify Conversation Tags

Add, update, or remove tags on a conversation. Tags are key-value pairs that can be used for categorization, filtering, and routing.

Permission required: Conversation:ModifyConversation

Modify tags of a conversation

post
/v1/{organization}/conversation/{conversation_id}/tags/

Modify the tags of a conversation.

Permissions

This endpoint requires the following permissions:

  • Conversation:ModifyConversation for the conversation to modify tags for.
Authorizations
AuthorizationstringRequired

The username should be set to {org_id}_{user_id}, and the password should be the Amigo issued JWT token that identifies the user.

AuthorizationstringRequired

Amigo issued JWT token that identifies an user. It's issued either after logging in through the frontend, or manually through the SignInWithAPIKey endpoint.

X-ORG-IDstringRequired

An optional organization identifier that indicates from which organization the token is issued. This is used in rare cases where the user to authenticate is making a request for resources in another organization.

Path parameters
organizationstringRequired
conversation_idstringRequiredPattern: ^[a-f0-9]{24}$
Header parameters
x-mongo-cluster-nameany ofOptional

The Mongo cluster name to perform this request in. This is usually not needed unless the organization does not exist yet in the Amigo organization infra config database.

stringOptional
or
nullOptional
Sec-WebSocket-Protocolstring[]OptionalDefault: []
Body
deletesstring[]Optional

A list of tags to remove from the conversation.

Default: []
Responses
post
/v1/{organization}/conversation/{conversation_id}/tags/

No content

The request body supports two operations:

Field
Type
Description

updates

object

A mapping of tags to add or update. Existing tags not included here remain unchanged.

deletes

array

A list of tag keys to remove from the conversation.

circle-info

Channel Tagging For guidance on using tags to implement channel-based routing and filtering, see Channel Tagging System.

Recommend Responses

Generate recommended responses for the user based on the conversation history. Call this when the most recent interaction has concluded but the user has not yet responded.

Permission required: Conversation:GetRecommendedResponses

Recommend responses for interaction

post
/v1/{organization}/conversation/{conversation_id}/interaction/{interaction_id}/recommend_responses

Generate a recommended response for the user to send based on the existing chat history. This should be called when the most recent interaction had concluded for a while but the user still hasn't responded.

Permissions:

This endpoint requires the following permissions:

  • Conversation:GetRecommendedResponses on this conversation.
Authorizations
AuthorizationstringRequired

The username should be set to {org_id}_{user_id}, and the password should be the Amigo issued JWT token that identifies the user.

AuthorizationstringRequired

Amigo issued JWT token that identifies an user. It's issued either after logging in through the frontend, or manually through the SignInWithAPIKey endpoint.

X-ORG-IDstringRequired

An optional organization identifier that indicates from which organization the token is issued. This is used in rare cases where the user to authenticate is making a request for resources in another organization.

Path parameters
conversation_idstringRequired

The identifier of the conversation.

Pattern: ^[a-f0-9]{24}$
interaction_idstringRequired

The identifier of the most recent interaction.

Pattern: ^[a-f0-9]{24}$
organizationstringRequired
Header parameters
x-mongo-cluster-nameany ofOptional

The Mongo cluster name to perform this request in. This is usually not needed unless the organization does not exist yet in the Amigo organization infra config database.

stringOptional
or
nullOptional
Sec-WebSocket-Protocolstring[]OptionalDefault: []
Body
contextstring · min: 1Optional

The context under which the recommended responses should be generated.

Default: PERSONA: Name: User Background: A typical person seeking this service. --- SCENARIO: Name: Complete Service Objective: Successfully complete the service interaction. Instructions: Engage naturally with the agent to achieve the service objective.
Responses
chevron-right
200

Succeeded.

application/json
recommended_responsesstring[]Required

The recommended responses to the user.

post
/v1/{organization}/conversation/{conversation_id}/interaction/{interaction_id}/recommend_responses

The optional context field in the request body provides additional context for generating the recommendations.

Get Interaction Insights

Retrieve insights about the agent's reasoning and behavior for a given interaction. This includes the current state, state transitions, working memory, reflections, and tool call logs.

Permissions required:

  • Conversation:GetInteractionInsights on the conversation

  • Organization:GetServiceHierarchicalStateMachine on the context graph used by the interaction

Get interaction insights

get
/v1/{organization}/conversation/{conversation_id}/interaction/{interaction_id}/insights

Retrieve insights about the agent's message for a given interaction.

Permissions:

This endpoint requires the following permissions:

  • Conversation:GetInteractionInsights on the conversation.
  • Organization:GetServiceHierarchicalStateMachine on the state machine that the current interaction is in.

This endpoint may be impacted by the following permissions:

  • Only reflection messages for which the authenticated user has the Conversation:GetMessage permission are included in the response.
Authorizations
AuthorizationstringRequired

The username should be set to {org_id}_{user_id}, and the password should be the Amigo issued JWT token that identifies the user.

AuthorizationstringRequired

Amigo issued JWT token that identifies an user. It's issued either after logging in through the frontend, or manually through the SignInWithAPIKey endpoint.

X-ORG-IDstringRequired

An optional organization identifier that indicates from which organization the token is issued. This is used in rare cases where the user to authenticate is making a request for resources in another organization.

Path parameters
conversation_idstringRequired

The identifier of the conversation.

Pattern: ^[a-f0-9]{24}$
interaction_idstringRequired

The identifier of the interaction.

Pattern: ^[a-f0-9]{24}$
organizationstringRequired
Header parameters
x-mongo-cluster-nameany ofOptional

The Mongo cluster name to perform this request in. This is usually not needed unless the organization does not exist yet in the Amigo organization infra config database.

stringOptional
or
nullOptional
Sec-WebSocket-Protocolstring[]OptionalDefault: []
Responses
chevron-right
200

Succeeded.

application/json
current_state_namestringRequired

The state the agent is in.

current_state_actionstringRequired

The action taken in the current state.

current_state_objectivestringRequired

The objective of the current state.

reflectionsstring[]Required

A list of reflections the agent made during the generation of this message.

triggered_dynamic_behavior_set_version_infoany ofRequired

The ID and version number of the dynamic behavior set that was activated during this interaction.

array · min: 2 · max: 2Optional
or
nullOptional
get
/v1/{organization}/conversation/{conversation_id}/interaction/{interaction_id}/insights

The response includes:

Field
Description

current_state_name

The state the agent is currently in

current_state_action

The action taken in the current state

current_state_objective

The objective of the current state

state_transition_logs

Log of state transitions during the interaction

working_memory

Active memories used to generate the message

reflections

Reflections the agent made during message generation

triggered_dynamic_behavior_set_version_info

Dynamic behavior that was activated, if any

select_next_action_tool_call_logs

Tool calls during the SelectNextAction step

engage_user_tool_call_logs

Tool calls during the EngageUser step

Last updated

Was this helpful?