Skip to main content

Upload Metadata to Ender Turing for analysis using the API

Upload CRM data, CSI/NPS, and other metadata can be uploaded through the API endpoint

Updated over a week ago

Upload Metadata

The metadata can be uploaded/updated through an API endpoint (using PUT https://{fqdn}/api/v1/sessions/{session_id}/metadata).

Due to compliance and security concerns, API documentation is only accessible to users who are logged in. Please log in to the Ender Turing platform to read the API documentation

Upload Metadata Flow

Upload Metadata Flow consists of 3 steps:

  1. Step 1. Log in to ET

  2. Step 2. Search the ET session ID by

    1. The contact center call ID, chat/email/ticket ID, or audio filename;

    2. ET filter params like date, agent, queue, etc;

  3. Step 3. Update metadata to ET by ET session ID.

An important notice! You should know the ID of the call/chat/ticket/email/etc or the filename of audiofile to find the relevant session ID in Ender Turing using option 2.a.

API Upload (recommended method)

Python example

Please install the Ender Turing Python SDK using

pip install enderturing

Minimalistic code snippet example to upload a chat to the API

import getpass
from enderturing import Config, EnderTuring

# --- Set your parameters (Manual step) ---
et_api_user = "[email protected]"
et_domain = "company.enderturing.com"

# --- Create configuration (Auto) ---
et_api_password = getpass.getpass(f"Provide Password for user {et_api_user} at domain {et_domain}:")
config = Config.from_url(f"https://{et_api_user}:{et_api_password}@{et_domain}")
# Step 1. Log in to ET
et = EnderTuring(config)

# Step 2.a. Search the ET session ID by the contact center call ID. Will return session_id (UUID) as a result OR Error
contact_center_system_id = "some.external-id-badb"
filters = f'search_query,{contact_center_system_id}'

# Search the conversation in ET
et_response = et.http_client.get("/sessions", params={"filters": filters})
# Get first ET session ID from results.
if not et_response:
print("No conversations found matching filters")
exit(-1)
else:
session = et_response["items"][0]
session_id = session["id"]
print("Recognized in session_id: ", session_id)
# Out[N]: Recognized in session_id: '5ef1ce61-f10a-4c18-badb-5b0f71a75c98'}

# Step 3. Update metadata to ET by ET session ID. Will return updated metadata
new_metadata = {
"fcr": 1,
"csi": 3,
"nps": 5,
"customer_id": "176196",
"crm_statuses": ["CSI not resolved / not accepted"],
"campaign_name": "Some Campaign"
}

# Merge the lists with existing values "crm_statuses" to append, not override
new_metadata["crm_statuses"].extend(session["crm_statuses"])

response = et.http_client.put(f"/sessions/{session_id}/metadata", json=new_metadata)
print("Updated metadata for session_id: ", session_id, response)

Uploaded metadata will reflect immediately for the relevant session on the "All Conversations" after upload.

Additional search options

Additionally, you can search by filename or by Ender Turing filters to find relevant conversations.

# Step 2.a. Search the ET session ID by the audio filename. Will return session_id (UUID) as a result OR Error
audio_filename = "20250629_1348_cdarwin_37250987916_IN_1.mp3"
audio_filename_no_ext = audio_filename.rsplit(".", 1)[0] # remove extension
filters = f'search_query,{audio_filename_no_ext}'

# Step 2.b. Search the ET Filter params like date, agent, queue, etc. Will return session_id (UUID) as a result OR Error
filters = 'date_range,2025-06-01||±queue_name,["Rejection"]±types,call'
Did this answer your question?