Chat History Delete API
API endpoint for deleting character sessions.
This API is available only to select customers.
Delete Sessions for a Character
POST https://api.convai.com/character/chatHistory/delete
Headers
Name
Type
Description
CONVAI-API-KEY*
String
The unique api-key provided for every user. Found under the Key icon when logged into your Convai account.
Request Body
Name
Type
Description
charID*
String
Id of your character.
sessionIDs*
list
list of session ids to be deleted.
{
"status": "SUCCESSFULLY DELETED"
}{
"ERROR": "Invalid API key provided."
}Here are some sample codes to demonstrate the request format for the endpoint -->
import requests
import json
url = "https://api.convai.com/character/chatHistory/delete"
headers = {
'CONVAI-API-KEY': '<Your-API-Key>',
'Content-Type': 'application/json'
}
# Create a dictionary for the JSON payload
payload = {
"charID": "<Your-Character-Id>",
"sessionIDs": ["<your-session-id-1>",]
}
# Convert the payload to JSON
json_payload = json.dumps(payload)
response = requests.post(url, headers=headers, data=json_payload)
print(response.json())Last updated
Was this helpful?