Speech Insights API
Speech Insights API lets another application send a call recording and its metadata to WinnerWare with one HTTP request.
Overview
Use this module when a system cannot drop files on a file system, FTP, or SFTP location, for example a phone system, a recording platform, or an integration of your own. You do not add an ingestion source. Enable the feature, give the application a token, and the application sends each recording with its values. After an upload, the recording goes through the same steps as a recording from an ingestion source.
Key Features
- Accepts a recording and its metadata in one
multipart/form-datarequest. - Uses bearer tokens from the OpenID Connect features of the site.
- Is described in the OpenAPI documents of the site, so developers can read it, try it, and generate a client.
- Starts to process a recording right after the upload.
Set up the API
1. Enable the features
Enable Speech Insights API. This also enables Speech Insights, OpenApi, and OpenID Connect Token Validation.
To let developers open the documentation pages, also enable one or more of OpenApi Swagger UI, OpenApi ReDoc UI, and OpenApi Scalar UI.
To transcribe the calls, also enable Speech Transcriptions Store (Azure) and set up Speech Azure. Without a transcription provider, the API still answers 202 Accepted. WinnerWare then creates a call with the status Not started and removes the recording, so that call has no audio and no transcript.
2. Let applications get a token
An application signs in with its client ID and client secret (the client credentials flow).
- Enable OpenID Connect Authorization Server.
- Go to Settings -> OpenID Connect -> Authorization Server. Turn on Enable Token Endpoint and Allow Client Credentials Flow. Keep the settings that the site already uses.
- Go to Settings -> OpenID Connect -> Token Validation. Make sure that Authorization server tenant has the name of this tenant, and save.
- Go to Access Control -> Roles and add a role, for example
Recording Uploader. Give it only the Upload call recordings using the API permission. - Go to Access Control -> OpenID Connect -> Applications and add an application. Set the type to confidential, set a client secret, turn on Allow Client Credentials Flow, and select the role.
The OpenIdServerSettings recipe step replaces all the server settings. A flow or endpoint that the step leaves out is turned off. On a site that already uses OpenID Connect, change the settings on the settings screen instead.
Another tenant or another authority can issue the tokens. In that case, set the Token Validation settings to that server, and skip the first two steps.
Send a recording
Get a token
curl -X POST "https://example.com/connect/token" -d "grant_type=client_credentials" -d "client_id=<client id>" -d "client_secret=<client secret>"
The access_token value of the response is the bearer token.
Upload the recording
curl -X POST "https://example.com/api/speech-insights/recordings" -H "Authorization: Bearer <access token>" -F "File=@call-1001.wav" -F "CallDate=2026-08-10T16:00:00Z" -F "CallId=call-1001" -F "AgentName=Ann Lee" -F "TalkTime=480" -F "Metadata={\"Campaign\":\"Renewals\"}"
Form fields
The names of the fields are not case sensitive, so CallDate and callDate are the same field.
| Field | Required | What it holds |
|---|---|---|
File | Yes | The recording. Use a .wav, .mp3, .m4a, .mp4, .opus, .flac, .alaw, .ulaw, or .amr file. For an .mp4 file, only the audio is used. To send a call that is recorded as several files, repeat this field once for each file, in the order of the call. See Send a call as several files. |
CallDate | Yes | The date and time of the call, for example 2026-08-10T16:00:00Z. WinnerWare reads a value with no offset as UTC. |
CallId | No | The ID of the call in the system that sends it, at most 255 characters. WinnerWare stores it as the External ID of the call. An upload with a CallId and a file name that WinnerWare already has is rejected. An upload with the same CallId and another file name is a new part of the call: see Send a call as several files. When the phone system splits a call into segments, send the segment ID here. |
ParentCallId | No | The ID of the whole customer call when the phone system splits it into segments, for example one segment for each agent after a transfer. Send each segment as its own upload with its own CallId and the same ParentCallId. |
PartCount | No | The number of files that have this CallId, when you send one call as several files. The call is processed when this number of files is transcribed. |
SegmentSequence | No | The position of the segment in the parent call, as a whole number. |
ANI | No | The phone number of the caller. |
DNIS | No | The phone number that the caller dialed. |
AgentName | No | The name of the agent. |
AgentId | No | The ID of the agent. |
Disposition | No | The outcome of the call. |
SiteName | No | The name of the site of the agent. |
CustomerId | No | The ID of the customer. |
Direction | No | The direction of the call, for example Inbound. |
QueueName | No | The name of the queue of the call. |
Language | No | The language of the call, as the system that sends it names it. WinnerWare stores this value with the call. To set the language of the transcription, use Locale. |
TalkTime | No | The talk time, as a number of seconds (480) or a clock value (00:08:00). |
HoldTime | No | The hold time, as a number of seconds or a clock value. |
AfterCallWorkTime | No | The after-call work time, as a number of seconds or a clock value. |
Locale | No | The locale to transcribe the call with, for example en-US. The default is the default culture of the site. |
ClientId | When the Clients feature is enabled | The ID of the client of the call. To find it, open the client in Content -> Clients. The ID is the last part of the address of the page. WinnerWare ignores this field when the feature is not enabled. |
Metadata | No | Other data of the call, as a JSON object, for example {"Campaign":"Renewals","Score":91.5}. The values must be text, a number, true, false, or null. WinnerWare keeps them as custom metadata of the call. A property of this object cannot have the name of a field in this table. |
Read the response
The response to an accepted upload has the status 202 Accepted:
{
"fileName": "call-1001_4qv9d2k8n1m5x7t3b6r0c8w2za.wav",
"fileNames": ["call-1001_4qv9d2k8n1m5x7t3b6r0c8w2za.wav"],
"callId": "call-1001"
}
fileName is the file name of the call in Speech Insights. WinnerWare adds a unique ID, so two recordings with the same name do not replace each other. fileNames has the names of all the files of the upload, in the order of the call. With one file, it has only fileName.
| Status | Meaning | What to do |
|---|---|---|
202 | The recording is stored and waits for processing. | Nothing. |
400 | The file or a field is not valid, or a file handler such as the antivirus scan rejected the file. The errors property of the response has a message for each field. | Correct the request. |
401 | The token is missing or is not valid. | Get a new token. |
403 | The application or the user does not have the Upload call recordings using the API permission. | Give the permission to a role of the application or the user. |
409 | WinnerWare already has a call with this call ID and file name from this API, or the call is complete and cannot take more files. | Nothing. A file that was already ingested does not need another upload. |
413 | The upload is larger than the limit. | Send a smaller file. |
415 | The request is not multipart/form-data. | Correct the request. |
503 | The recording could not be stored, for example because the antivirus scan or the storage cannot be reached. Nothing is kept. | Send the upload again later. |
A request that fails with 409 is safe to repeat. So when an application does not know if an upload arrived, it can send the upload again.
Send a call as several files
When the system that sends the call has it as several files, you can send them in one upload or in several uploads.
In one upload: repeat the File field once for each file, in the order of the call, and send a CallId. The other fields apply to every file.
curl -X POST "https://example.com/api/speech-insights/recordings" -H "Authorization: Bearer <access token>" -F "File=@call-1001-a.wav" -F "File=@call-1001-b.wav" -F "File=@call-1001-c.wav" -F "CallDate=2026-08-10T16:00:00Z" -F "CallId=call-1001" -F "AgentName=Ann Lee"
CallIdis required, so that the files become one call.- The order of the files in the form is their order in the call. Leave out
SegmentSequence. PartCountis the number of files of the upload. Send a larger number only when more files of the call will come in a later upload.- Each file must have its own name. When one file is not valid or a file handler rejects it, the API stores no file of the upload, so you can correct the request and send all the files again.
- The size limit applies to all the files of the upload together.
In several uploads: send each file as its own upload with the same CallId and the file's own name. Send SegmentSequence to give the order of the file, and PartCount when you know the number of files.
Either way, WinnerWare transcribes each file, joins them in the order of SegmentSequence (then CallDate, then the time they came), and processes the call once. With PartCount, the call is processed only when all of its files are transcribed. A file that comes after the call was processed is added, and the call is processed again. A file that comes more than 24 hours after that is rejected with 409. For the details, see Calls that are split into several audio files.
The server stops reading an upload that is larger than the limit and closes the connection. So a client that sends the whole file at once can report a closed connection instead of 413. To get the status, send the Expect: 100-continue header. curl does this for large files.
What happens after the upload
- A background job starts right after the response. It handles the upload with the same steps as a recording from an ingestion source: the duplicate check, the transcript, and the transcription.
- The recording and its metadata are removed from the storage after the transcription service accepts the recording.
- If a recording fails, for example because the transcription service cannot be reached, it stays in the storage. The next upload or the hourly Process recordings that were uploaded using the API background task tries it again.
- A recording that cannot be decoded moves to a
failedfolder with its metadata, and a failed transcript record is kept with the reason in its IngestionError metadata. To send a corrected recording, use a new call ID, because the failed record keeps the old one.
To see how many calls arrived through the API, and their status, open the Ingestion sources report. API calls show in the API row.
How API calls differ from ingestion source calls
- The source ID of each API call is
Api. No ingestion source has this ID, so rules that you scope to an ingestion source do not select API calls. Rules with no source scope, or with a client scope, select them. - A call ID must be unique across all the API uploads, also when two clients send them. A call from an ingestion source with the same call ID is not a duplicate.
- The API does not start the Ingestion Source Failed and Ingestion Source Succeeded workflow events, because they belong to a source.
- Each call has one locale, so the API does not use language identification.
Read the API documentation
The OpenAPI documents of the site describe the request, each form field, and all the responses, in the Speech Insights group:
| Page | Address | Feature needed |
|---|---|---|
| OpenAPI document | /swagger/v1/swagger.json and /openapi/v1.json | OpenApi |
| Swagger UI | /swagger | OpenApi Swagger UI |
| ReDoc | /redoc | OpenApi ReDoc UI |
| Scalar | /scalar/v1 | OpenApi Scalar UI |
These addresses need a user with the Access view content endpoints permission (ViewOpenApiContent). To use Try it out in Swagger UI or Scalar, run the OpenAPI Documentation — Bearer/PKCE recipe on the site.
Settings
The largest upload is 1 GB by default: the recording and the other form fields together. To change it, set MaximumUploadSize (in bytes) in appsettings.json or in the settings file of the tenant, and restart the tenant:
{
"OrchardCore": {
"CloudSolutions": {
"SpeechInsights": {
"Api": {
"MaximumUploadSize": 2147483648
}
}
}
}
}
Operational Notes
- The uploads wait in the shared recording storage, in the
api-uploadsfolder. This storage is Azure Blob Storage when the Speech Transcriptions Store (Azure) feature is enabled, and the tenant folderSharedRecordingsotherwise. A site with more than one server needs Azure Blob Storage or a shared disk. - If a reverse proxy or IIS is in front of the site, set its request limit too. IIS and IIS Express have a default limit of about 30 MB, and they reject a larger request before it reaches WinnerWare.
- The server buffers each upload in the folder of
ASPNETCORE_TEMPbefore it stores the file, so that folder needs free space for the uploads in progress. - The upload goes through the file handlers of the site, for example the Antivirus feature, before it is stored.