Reference
API reference
The integrations API: the one the CLI, the SDK and the MCP server use, with the same services and the same validation as the panel.
Base URL and authentication
Every route hangs off https://api-service.emotionalscoring.io/v1/integrations. Each request carries two headers: X-API-KEY, the key you create in the panel under API Keys, and X-TENANT-ID, your tenant.
printf 'X-API-KEY: %s\n' "$QI_API_KEY" | curl -H @- https://api-service.emotionalscoring.io/v1/integrations/usage \
-H "X-TENANT-ID: $QI_TENANT"The samples hand the key to curl on standard input (-H @-) with printf, a shell builtin, so it never shows up in the process list or in the command itself.
The company is not sent: the key already carries it. The key is shown once, when you create it; keep it like any secret, out of code and out of chats.
Responses and errors
A successful response wraps the result in data. An error answers with its HTTP status and a body with message and, nearly always, a stable code. Code against the code, not the text.
HTTP/1.1 200 OK
{ "data": ... }Uploads reject per file: the body says which file and why, with a code and its parameters.
HTTP/1.1 400 Bad Request
{
"message": "audioFileNameRejected",
"rejected": [
{
"file_name": "notas.mp3",
"errors": [{ "code": "missingFields", "params": { "found": 1, "expected": 7 } }]
}
]
}Plan and balance refusals also carry details.
HTTP/1.1 403 Forbidden
{
"message": "QI token balance cannot cover this work",
"code": "QUOTA_EXCEEDED",
"details": { "available": 12, "required": 72 }
}Pagination
GET /interactions pages with limit (10 by default, 200 at most) and page, which starts at 0. The response carries total_records, total_pages and has_next_page: keep asking for pages while has_next_page is true.
printf 'X-API-KEY: %s\n' "$QI_API_KEY" | curl -H @- -G https://api-service.emotionalscoring.io/v1/integrations/interactions \
-H "X-TENANT-ID: $QI_TENANT" \
--data-urlencode "limit=200" \
--data-urlencode "page=1"Endpoints
GET/interactions
Analysed interactions, newest first.
| Parameter | Description |
|---|---|
limit | Page size, 1 to 200. Defaults to 10. |
page | Page number, from 0. Defaults to 0. |
from, to | ISO dates. They go together: one alone answers INCOMPLETE_DATE_RANGE, and from must be before to (INVALID_DATE_RANGE). |
source_type | audio or text. Defaults to audio. |
agent_type | human or bot. Defaults to human. |
form | A form id: only interactions evaluated with it. |
printf 'X-API-KEY: %s\n' "$QI_API_KEY" | curl -H @- -G https://api-service.emotionalscoring.io/v1/integrations/interactions \
-H "X-TENANT-ID: $QI_TENANT" \
--data-urlencode "limit=25" \
--data-urlencode "from=2026-09-01" \
--data-urlencode "to=2026-09-08" \
--data-urlencode "source_type=audio"{
"data": {
"data": [{ "_id": "65f0a1b2c3d4e5f6a7b8c9d0", ... }],
"total_records": 37,
"total_pages": 2,
"has_next_page": true
}
}GET/interactions/:id
One interaction and the stage it is at. Another company's id answers 404, the same as one that does not exist.
printf 'X-API-KEY: %s\n' "$QI_API_KEY" | curl -H @- https://api-service.emotionalscoring.io/v1/integrations/interactions/65f0a1b2c3d4e5f6a7b8c9d0 \
-H "X-TENANT-ID: $QI_TENANT"{
"data": {
"id": "65f0a1b2c3d4e5f6a7b8c9d0",
"file_name": "...",
"display_name": "llamada-1.mp3",
"source_type": "audio",
"agent_type": "human",
"analysis_mode": "full",
"interaction_date": "...",
"duration": ...,
"status": {
"transcription": "completed",
"speech_analytics": "completed",
"nlp_analysis": "pending",
"bot_analysis": "not_queued"
},
"dialogue": [...],
"answered_form": [...],
"bot_answered_form": [],
"nlp": null,
"bot_id": null,
"bot_profile_id": null
}
}status carries each stage; dialogue, the conversation; answered_form, the form answers; analysis_mode, full or transcript. For a bot conversation, bot_answered_form, bot_id and bot_profile_id say how it was evaluated and with which profile.
GET/forms
The company's live forms, with the key that picks each one on upload.
| Parameter | Description |
|---|---|
type | audio, text or bot. Anything else answers 400 INVALID_FORM_TYPE. |
printf 'X-API-KEY: %s\n' "$QI_API_KEY" | curl -H @- https://api-service.emotionalscoring.io/v1/integrations/forms?type=audio \
-H "X-TENANT-ID: $QI_TENANT"{
"data": [
{ "id": "...", "title": "Ventas", "type": "audio", "enabledtoSA": true, "key": "VENTAS" }
]
}GET/bot-profiles
The company's bot profiles. Needs Bot Analytics in the plan: without the module, 403 MODULE_NOT_IN_PLAN.
printf 'X-API-KEY: %s\n' "$QI_API_KEY" | curl -H @- https://api-service.emotionalscoring.io/v1/integrations/bot-profiles \
-H "X-TENANT-ID: $QI_TENANT"{
"data": [{ "_id": "...", "bot_id": "asistente-web", "name": "Asistente", "channel": "..." }]
}GET/usage
The same summary as the panel's Usage page: plan, modules, QI token balance and rate card.
printf 'X-API-KEY: %s\n' "$QI_API_KEY" | curl -H @- https://api-service.emotionalscoring.io/v1/integrations/usage \
-H "X-TENANT-ID: $QI_TENANT"POST/uploads/audio
Uploads recordings in the files field: up to 10 per request and 200 MB per file, as mp3, wav or flac.
| Parameter | Description |
|---|---|
files | 1 to 10 files, as multipart/form-data. |
formKey | Optional. The form key, [A-Za-z0-9-], 1 to 32 characters. In an own tenant it is appended to the name as an extra segment when missing; in the shared one it wins over the key in the name. Malformed: 400 INVALID_FORM_KEY. |
analysis | Optional, shared tenant only: full (default) or transcript. Anything else: 400 INVALID_ANALYSIS_MODE. |
printf 'X-API-KEY: %s\n' "$QI_API_KEY" | curl -H @- https://api-service.emotionalscoring.io/v1/integrations/uploads/audio \
-H "X-TENANT-ID: $QI_TENANT" \
-F "files=@./llamada-1.mp3" \
-F "files=@./llamada-2.mp3" \
-F "formKey=VENTAS" \
-F "analysis=full"{
"data": {
"uploaded": 2,
"keys": ["...", "..."],
"processing": { ... },
"files": [
{ "key": "...", "display_name": "llamada-1.mp3" },
{ "key": "...", "display_name": "llamada-2.mp3" }
]
}
}uploaded and keys say how many files were queued and under which name they were stored. In the shared tenant, files maps each one to the name you sent.
POST/uploads/text
Uploads text conversations in the files field: up to 10 per request and 5 MB per file, as txt, csv, json, jsonl, ndjson, eml, mbox, xml, vtt, srt or html. With agentType=bot and botId, the conversation is evaluated as a bot's.
| Parameter | Description |
|---|---|
files | 1 to 10 files, as multipart/form-data. |
formKey | Optional. The form key, [A-Za-z0-9-], 1 to 32 characters. In an own tenant it is appended to the name as an extra segment when missing; in the shared one it wins over the key in the name. Malformed: 400 INVALID_FORM_KEY. |
agentType | Optional: human (default) or bot. Anything else: 400 INVALID_AGENT_TYPE. bot needs the module in the plan (403 MODULE_NOT_IN_PLAN). |
botId | With agentType=bot, the bot_id of one of your profiles. Unknown: 400 UNKNOWN_BOT_ID. |
printf 'X-API-KEY: %s\n' "$QI_API_KEY" | curl -H @- https://api-service.emotionalscoring.io/v1/integrations/uploads/text \
-H "X-TENANT-ID: $QI_TENANT" \
-F "files=@./chat-1.csv" \
-F "formKey=SOPORTE"printf 'X-API-KEY: %s\n' "$QI_API_KEY" | curl -H @- https://api-service.emotionalscoring.io/v1/integrations/uploads/text \
-H "X-TENANT-ID: $QI_TENANT" \
-F "files=@./chat-bot.json" \
-F "agentType=bot" \
-F "botId=asistente-web"Limits
| Limit | Value |
|---|---|
| Files per request | 10 |
| Size of a recording | 200 MB |
| Size of a text file | 5 MB |
| Interactions per page | 10 by default, 200 at most |
| Name in the shared tenant | 80 characters, not counting the key or the extension |
| Name in an own tenant | 255 characters, 7 fields and up to 3 extras |
| Form key | 1 to 32 characters: letters, digits and hyphens |
The CLI and the SDK retry 429 and 5xx responses with exponential backoff. If you call the API directly, do the same.
Error codes
Codes are stable and language-free: whoever reads them writes the message, in their own language.
Per file, inside rejected
| Code | HTTP | Meaning |
|---|---|---|
emptyFileName | 400 | The file has no name. |
emptySegments | 400 | Own tenant: a segment is empty (two underscores in a row, or a leading one). |
missingFields | 400 | Own tenant: fields are missing. params carries found and expected (7 required). |
tooManyFields | 400 | Own tenant: more than 3 extra segments. |
segmentHasDots | 400 | Own tenant: a segment contains a dot. |
segmentCharset | 400 | A segment has characters other than letters, digits and hyphens. params names it. |
invalidDate | 400 | The date is not a real one or is not YYYYMMDD. |
invalidDateLooksLikeTime | 400 | The date slot holds something shaped like a time: date and time are swapped. |
invalidTime | 400 | The time is not a real one or is not HHMMSS. |
invalidTimeLooksLikeDate | 400 | The time slot holds something shaped like a date: date and time are swapped. |
tenantMismatch | 400 | The first segment is not your tenant. |
companyMismatch | 400 | The second segment is not the API key's company. |
fileNameTooLong | 400 | The name is longer than 255 characters. |
sharedNameInvalid | 400 | Shared tenant: the name is not Name[_KEY].ext, is longer than 80 characters or contains a slash. |
durationOutOfRange | 400 | Audio: the duration is outside the range your company configured. |
unsupportedExtension | 400 | Text: the extension is not a supported conversation format. |
emptyFile | 400 | Text: the file is empty. |
notUtf8 | 400 | Text: the file is not UTF-8. |
malformedJson | 400 | Text: the JSON cannot be parsed. |
jsonNotArray | 400 | Text: the JSON does not hold a list of turns. |
noTurnsFound | 400 | Text: the file was read but no conversation turn was found. |
Request parameters
| Code | HTTP | Meaning |
|---|---|---|
INVALID_FORM_KEY | 400 | formKey does not match [A-Za-z0-9-], 1 to 32 characters. |
INVALID_ANALYSIS_MODE | 400 | analysis is neither full nor transcript. |
INVALID_AGENT_TYPE | 400 | agentType is neither human nor bot. |
UNKNOWN_BOT_ID | 400 | botId is not one of your company's bot profiles. |
INVALID_FORM_TYPE | 400 | type is not audio, text or bot. |
INCOMPLETE_DATE_RANGE | 400 | from arrived without to, or the other way round. They go together. |
INVALID_DATE_RANGE | 400 | from is not before to. |
Plan, balance and permissions
| Code | HTTP | Meaning |
|---|---|---|
QUOTA_EXCEEDED | 403 | The QI token balance cannot cover the upload. No file was queued; details carries available and required. |
PLAN_EXPIRED | 403 | The plan has expired: data stays readable, new work is not accepted. |
CHANNEL_NOT_ALLOWED | 403 | The plan does not accept uploads through this channel. |
MODULE_NOT_IN_PLAN | 403 | The module the route needs (Bot Analytics, for example) is not in your plan. |
SCOPE_NOT_ALLOWED | 403 | The API key may only upload files. |
QI_WALLET_BUSY | 503 | The balance was busy with another operation. Temporary: retry. |
ENTITLEMENTS_UNAVAILABLE | 503 | What the plan includes could not be read. Temporary: retry. |
No code of their own
| Code | HTTP | Meaning |
|---|---|---|
| — | 401 | X-API-KEY is missing, or the key does not exist, was revoked or expired. |
| — | 404 | The interaction does not exist or belongs to another company. |
| — | 406 | No file arrived, or its type is not one of the supported ones. |
| — | 413 | A file is over the endpoint's maximum size. |
| — | 422 | The interaction id is not well formed. |
| — | 429 | Too many requests. Retry with exponential backoff. |