#api to list the conversation history
1 messages · Page 1 of 1 (latest)
To list the conversation history, you can use the Get Conversations API endpoint. This endpoint allows you to fetch all conversations of agents that you own, with the option to restrict to a specific agent.
Here is an example of how to use this endpoint:
from elevenlabs import ElevenLabs
client = ElevenLabs(
api_key="YOUR_API_KEY",
)
client.conversational_ai.get_conversations(
agent_id="21m00Tcm4TlvDq8ikWAM",
)
This will return a list of conversations, including the conversation ID, start time, call duration, and other metadata.
You can also use query parameters to filter the results, such as cursor to fetch the next page of results, agent_id to restrict to a specific agent, and call_successful to filter by the success evaluation of the conversation.
For example:
client.conversational_ai.get_conversations(
agent_id="21m00Tcm4TlvDq8ikWAM",
cursor="next_cursor",
call_successful="success",
)
This will return the next page of conversations for the specified agent, with only conversations that were successful.
The response will be in JSON format, with the following structure:
{
"conversations": [
{
"agent_id": "<string>",
"agent_name": "<string>",
"conversation_id": "<string>",
"start_time_unix_secs": 123,
"call_duration_secs": 123,
"message_count": 123,
"status": "processing",
"call_successful": "success"
}
],
"next_cursor": "<string>",
"has_more": true
}
I want the list of all the conversations
To list all the conversations, you can use our API. Specifically, you can explore the ../api-reference/history/get-all endpoint, which allows you to fetch all past text-to-speech generations. This will provide you with a JSON response that you can convert to a more readable format, such as CSV, using tools like codebeautify.org/json-to-csv.
For detailed instructions on using the API, please refer to our API documentation. If you need further assistance, feel free to ask!
send me the endpoint for the same
To list all conversations, you can use the following API endpoint:
Endpoint:
GET /v1/convai/conversations
Parameters:
- Headers:
xi-api-key(string): Your API key, required to access the API.
- Query Parameters (optional):
cursor(string): Used for fetching the next page. The cursor is returned in the response.agent_id(string): The ID of the agent whose conversations you want to retrieve.call_successful(enum<string>): Filter by call success status (success,failure,unknown).page_size(integer): Maximum number of conversations to return (default is 30, max is 100).
Example Code:
from elevenlabs import ElevenLabs
client = ElevenLabs(
api_key="YOUR_API_KEY",
)
response = client.conversational_ai.get_conversations(
agent_id="YOUR_AGENT_ID",
page_size=30
)
print(response)
Response Example:
{
"conversations": [
{
"agent_id": "<string>",
"agent_name": "<string>",
"conversation_id": "<string>",
"start_time_unix_secs": 123,
"call_duration_secs": 123,
"message_count": 123,
"status": "processing",
"call_successful": "success"
}
],
"next_cursor": "<string>",
"has_more": true
}
This will return a list of conversations along with details like conversation_id, start_time, status, and more. Use the next_cursor value to fetch additional pages if has_more is true.
I also want the call id
I apologize, but I don't have enough information to provide you with a specific Call ID. To assist you better, could you please provide more context about which call you're referring to? If you're experiencing an issue with a particular call, it would be helpful if you could share more details about when this call occurred and any other relevant information. This will allow me to better understand your situation and provide more accurate assistance.
I want it in the respone