Consents - Create
Creates a new voice talent consent with the provided audio URL.
PUT {endpoint}/customvoice/consents/{id}?api-version=2024-02-01-preview
URI Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
|
endpoint
|
path | True |
string |
Supported Cognitive Services endpoints (protocol and hostname, for example: https://eastus.api.cognitive.microsoft.com). |
|
id
|
path | True |
string minLength: 3maxLength: 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 |
|---|---|---|---|
| Ocp-Apim-Subscription-Key | True |
string |
Provide your Speech resource key here. |
| Operation-Id |
string minLength: 3maxLength: 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 |
|---|---|---|---|
| companyName | True |
string minLength: 1 |
Company name. Must match the company name in the consent audio file. |
| locale | True |
string |
The locale of this consent. Locale code follows BCP-47. You can find the text to speech locale list here https://learn.microsoft.com/azure/ai-services/speech-service/language-support?tabs=tts. |
| projectId | True |
string minLength: 3maxLength: 64 pattern: ^[a-zA-Z0-9][a-zA-Z0-9._-]{1,62}[a-zA-Z0-9]$ |
Resource id |
| voiceTalentName | True |
string minLength: 1 |
Voice talent name. Must match the voice talent name in the consent audio file. |
| audioUrl |
string (uri) |
The public accessible URL of the consent audio file. It's recommended to be an Azure blob URL with SAS. This property is only available in request. |
|
| description |
string |
Description of consent. |
|
| displayName |
string minLength: 1 |
Name of consent. |
|
| id |
string minLength: 3maxLength: 64 pattern: ^[a-zA-Z0-9][a-zA-Z0-9._-]{1,62}[a-zA-Z0-9]$ |
Resource id |
|
| properties |
Consent properties |
||
| status |
Status of a resource. |
Responses
| Name | Type | Description |
|---|---|---|
| 201 Created |
Created Headers
|
|
| Other Status Codes |
An error occurred. Headers x-ms-error-code: string |
Security
Ocp-Apim-Subscription-Key
Provide your Speech resource key here.
Type:
apiKey
In:
header
Examples
Create a consent
Sample request
PUT {endpoint}/customvoice/consents/Jessica?api-version=2024-02-01-preview
{
"description": "Consent for Jessica voice",
"projectId": "Jessica",
"voiceTalentName": "Jessica Smith",
"companyName": "Contoso",
"audioUrl": "https://contoso.blob.core.windows.net/public/jessica-consent.wav?mySasToken",
"locale": "en-US"
}
Sample response
Operation-Location: https://eastus.api.cognitive.microsoft.com/customvoice/operations/070f7986-ef17-41d0-ba2b-907f0f28e314?api-version=2024-02-01-preview
Operation-Id: 070f7986-ef17-41d0-ba2b-907f0f28e314
{
"id": "Jessica",
"description": "Consent for Jessica voice",
"projectId": "Jessica",
"voiceTalentName": "Jessica Smith",
"companyName": "Contoso",
"locale": "en-US",
"status": "NotStarted",
"createdDateTime": "2023-04-01T05:30:00.000Z",
"lastActionDateTime": "2023-04-02T10:15:30.000Z"
}
Definitions
| Name | Description |
|---|---|
| Consent |
Consent object |
|
Consent |
Consent creation failure reason |
|
Consent |
Consent properties |
| Error |
Top-level error follows Microsoft Azure REST API Guidelines which is available at https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors. This contains an top-level error with error code, message, details, target and an inner error with more descriptive details. |
|
Error |
Top-level error code |
|
Error |
Error response follows Microsoft Azure REST API Guidelines which is available at https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors. |
|
Inner |
Inner error follows Microsoft Azure REST API Guidelines which is available at https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors. This contains required properties error code, message and optional properties target, inner error(this can be nested). |
| Status |
Status of a resource. |
Consent
Consent object
| Name | Type | Description |
|---|---|---|
| audioUrl |
string (uri) |
The public accessible URL of the consent audio file. It's recommended to be an Azure blob URL with SAS. This property is only available in request. |
| companyName |
string minLength: 1 |
Company name. Must match the company name in the consent audio file. |
| createdDateTime |
string (date-time) |
The timestamp when the object was created. The timestamp is encoded as ISO 8601 date and time format ("YYYY-MM-DDThh:mm:ssZ", see https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations) |
| description |
string |
Description of consent. |
| displayName |
string minLength: 1 |
Name of consent. |
| id |
string minLength: 3maxLength: 64 pattern: ^[a-zA-Z0-9][a-zA-Z0-9._-]{1,62}[a-zA-Z0-9]$ |
Resource id |
| lastActionDateTime |
string (date-time) |
The timestamp when the current status was entered. The timestamp is encoded as ISO 8601 date and time format ("YYYY-MM-DDThh:mm:ssZ", see https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations). |
| locale |
string |
The locale of this consent. Locale code follows BCP-47. You can find the text to speech locale list here https://learn.microsoft.com/azure/ai-services/speech-service/language-support?tabs=tts. |
| projectId |
string minLength: 3maxLength: 64 pattern: ^[a-zA-Z0-9][a-zA-Z0-9._-]{1,62}[a-zA-Z0-9]$ |
Resource id |
| properties |
Consent properties |
|
| status |
Status of a resource. |
|
| voiceTalentName |
string minLength: 1 |
Voice talent name. Must match the voice talent name in the consent audio file. |
ConsentFailureReason
Consent creation failure reason
| Value | Description |
|---|---|
| AudioAndScriptNotMatch |
The consent audio mismatch with verbal statement. Please check verbal-statement. |
| Internal |
Custom Voice Service error. |
ConsentProperties
Consent properties
| Name | Type | Description |
|---|---|---|
| failureReason |
Consent creation failure reason |
Error
Top-level error follows Microsoft Azure REST API Guidelines which is available at https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors. This contains an top-level error with error code, message, details, target and an inner error with more descriptive details.
| Name | Type | Description |
|---|---|---|
| code |
Top-level error code |
|
| details |
Error[] |
Additional supportive details regarding the error and/or expected policies. |
| innererror |
Inner error follows Microsoft Azure REST API Guidelines which is available at https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors. This contains required properties error code, message and optional properties target, inner error(this can be nested). |
|
| message |
string |
Top-level error message. |
| target |
string |
The source of the error. For example it would be "model" or "model id" in case of invalid model. |
ErrorCode
Top-level error code
| Value | Description |
|---|---|
| BadRequest | |
| BadArgument | |
| Unauthorized | |
| Forbidden | |
| NotFound | |
| UnsupportedMediaType | |
| TooManyRequests | |
| InternalServerError | |
| ServiceUnavailable |
ErrorResponse
Error response follows Microsoft Azure REST API Guidelines which is available at https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors.
| Name | Type | Description |
|---|---|---|
| error |
Top-level error follows Microsoft Azure REST API Guidelines which is available at https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors. This contains an top-level error with error code, message, details, target and an inner error with more descriptive details. |
InnerError
Inner error follows Microsoft Azure REST API Guidelines which is available at https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors. This contains required properties error code, message and optional properties target, inner error(this can be nested).
| Name | Type | Description |
|---|---|---|
| code |
string |
Detailed error code to help diagnostic. |
| innererror |
Inner error follows Microsoft Azure REST API Guidelines which is available at https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors. This contains required properties error code, message and optional properties target, inner error(this can be nested). |
|
| message |
string |
Detailed error message. |
| target |
string |
The source of the error. For example it would be "model" or "model id" in case of invalid model. |
Status
Status of a resource.
| Value | Description |
|---|---|
| NotStarted | |
| Running | |
| Succeeded | |
| Failed | |
| Disabling | |
| Disabled |