Training Sets - Upload Data

Uploads data to the specified training set.

POST {endpoint}/customvoice/trainingsets/{id}:upload?api-version=2026-01-01

URI Parameters

Name In Required Type Description
endpoint
path True

string (uri)

Supported Cognitive Services endpoints (protocol and hostname, for example: https://eastus.api.cognitive.microsoft.com).

id
path True

string

minLength: 3
maxLength: 64
pattern: ^[a-zA-Z0-9][a-zA-Z0-9._-]{1,62}[a-zA-Z0-9]$

The ID of the resource.

api-version
query True

string

minLength: 1

The API version to use for this operation.

Request Header

Name Required Type Description
Operation-Id

string

minLength: 3
maxLength: 64
pattern: ^[a-zA-Z0-9][a-zA-Z0-9._-]{1,62}[a-zA-Z0-9]$

ID of the status monitor for the operation. If the Operation-Id header matches an existing operation and the request is not identical to the prior request, it will fail with a 400 Bad Request.

Request Body

Name Required Type Description
audios True

AzureBlobContentSource

Azure Blob Storage content. With the examples below, it represents files https://contoso.blob.core.windows.net/voicecontainer/jessica/*.wav

kind True

DatasetKind

Dataset kind

description

string

Optional description of this dataset.

displayName

string

The name of this dataset.

processAs

DatasetProcessAs

Dataset processing method. If not specified, the default processing method will be used.

scripts

AzureBlobContentSource

Azure Blob Storage content. With the examples below, it represents files https://contoso.blob.core.windows.net/voicecontainer/jessica/*.wav

Responses

Name Type Description
202 Accepted

The request has been accepted for processing, but processing has not yet completed.

Headers

  • Operation-Id: string
  • Operation-Location: string
Other Status Codes

Azure.Core.Foundations.ErrorResponse

An unexpected error response.

Headers

x-ms-error-code: string

Security

Ocp-Apim-Subscription-Key

Type: apiKey
In: header

OAuth2Auth

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
https://cognitiveservices.azure.com/.default

Examples

Upload data to a training set

Sample request

POST {endpoint}/customvoice/trainingsets/d6916a55-2cbc-4ed4-bd19-739e9a13b0ab:upload?api-version=2026-01-01


{
  "audios": {
    "containerUrl": "https://contoso.blob.core.windows.net/voicecontainer?mySasToken",
    "prefix": "jessica300/",
    "extensions": [
      ".wav"
    ]
  },
  "kind": "AudioAndScript",
  "processAs": "Segmented",
  "scripts": {
    "containerUrl": "https://contoso.blob.core.windows.net/voicecontainer?mySasToken",
    "prefix": "jessica300/",
    "extensions": [
      ".txt"
    ]
  }
}

Sample response

Operation-Id: 284b7e37-f42d-4054-8fa9-08523c3de345
Operation-Location: https://eastus.api.cognitive.microsoft.com/customvoice/operations/284b7e37-f42d-4054-8fa9-08523c3de345?api-version=2026-01-01

Definitions

Name Description
Azure.Core.Foundations.Error

The error object.

Azure.Core.Foundations.ErrorResponse

A response containing error details.

Azure.Core.Foundations.InnerError

An object containing more specific information about the error. As per Azure REST API guidelines - https://aka.ms/AzureRestApiGuidelines#handling-errors.

AzureBlobContentSource

Azure Blob Storage content. With the examples below, it represents files https://contoso.blob.core.windows.net/voicecontainer/jessica/*.wav

Dataset

Dataset object

DatasetKind

Dataset kind

DatasetProcessAs

Dataset processing method. If not specified, the default processing method will be used.

Azure.Core.Foundations.Error

The error object.

Name Type Description
code

string

One of a server-defined set of error codes.

details

Azure.Core.Foundations.Error[]

An array of details about specific errors that led to this reported error.

innererror

Azure.Core.Foundations.InnerError

An object containing more specific information than the current object about the error.

message

string

A human-readable representation of the error.

target

string

The target of the error.

Azure.Core.Foundations.ErrorResponse

A response containing error details.

Name Type Description
error

Azure.Core.Foundations.Error

The error object.

Azure.Core.Foundations.InnerError

An object containing more specific information about the error. As per Azure REST API guidelines - https://aka.ms/AzureRestApiGuidelines#handling-errors.

Name Type Description
code

string

One of a server-defined set of error codes.

innererror

Azure.Core.Foundations.InnerError

Inner error.

AzureBlobContentSource

Azure Blob Storage content. With the examples below, it represents files https://contoso.blob.core.windows.net/voicecontainer/jessica/*.wav

Name Type Description
containerUrl

string (uri)

Azure Blob Storage container URL with SAS. Need both read and list permissions.

extensions

string[]

File name extensions.

prefix

string

Blob name prefix.

Dataset

Dataset object

Name Type Description
audios

AzureBlobContentSource

Azure Blob Storage content. With the examples below, it represents files https://contoso.blob.core.windows.net/voicecontainer/jessica/*.wav

description

string

Optional description of this dataset.

displayName

string

The name of this dataset.

kind

DatasetKind

Dataset kind

processAs

DatasetProcessAs

Dataset processing method. If not specified, the default processing method will be used.

scripts

AzureBlobContentSource

Azure Blob Storage content. With the examples below, it represents files https://contoso.blob.core.windows.net/voicecontainer/jessica/*.wav

DatasetKind

Dataset kind

Value Description
AudioAndScript

AudioAndScript

LongAudio

LongAudio

AudioOnly

AudioOnly

DatasetProcessAs

Dataset processing method. If not specified, the default processing method will be used.

Value Description
Segmented

The default processing mode that works with all supported languages.

Contextual

An enhanced mode that retains the audio as a whole to keep the contextual information for more natural intonations.