Skip to main content
PATCH
cURL
Sets the start and end offsets (in milliseconds) that training uses from this sample — it does not re-encode or replace the uploaded file. Trimming only takes effect the next time you train the voice. The updateMask query parameter is required and uses snake_case field paths (for example: ?updateMask=trim_start_ms,trim_end_ms). To clear an existing trim and use the full sample again, include the field in updateMask and send null in the body:
Trimmed-out audio still counts toward the voice’s 5 GB storage cap, but not toward the 600-second minimum required to train — that minimum is computed on trimmed duration.

Authorizations

Authorization
string
header
required

Your API key. Read permissions are required for GET endpoints. Write permissions are required for POST, PATCH, and DELETE endpoints.

For Basic authentication, please populate Basic $INWORLD_API_KEY. You can create a key in one command with the Inworld CLI: inworld workspace add-key.

Path Parameters

voiceId
string
required

Voice ID that owns the sample.

sampleId
string
required

Sample ID to trim, from the sampleId field returned by Upload PVC voice samples or Get a PVC voice.

Query Parameters

updateMask
string
required

Comma-separated list of fields to update. Mask paths use snake_case field names, even though the request body uses camelCase: trim_start_ms, trim_end_ms. To clear an existing trim, include the field in the mask and send null (or omit it from the body).

Example:

"trim_start_ms,trim_end_ms"

Body

application/json

Request message for UpdatePvcVoiceSample. updateMask is required.

trimStartMs
integer<int32> | null

Offset in milliseconds, from the start of the sample, where the audio used for training begins. Include trim_start_ms (snake_case) in updateMask to apply this field; send null to clear it.

trimEndMs
integer<int32> | null

Offset in milliseconds, from the start of the sample, where the audio used for training ends. Include trim_end_ms (snake_case) in updateMask to apply this field; send null to clear it.

Response

A successful response.

A single uploaded audio sample belonging to a PVC voice.

sampleId
string
read-only

Sample ID. Use this value as {sampleId} when trimming or deleting the sample.

name
string
read-only

Resource name. Format: workspaces/{workspace}/pvcVoices/{voice}/samples/{sample}.

sizeBytes
integer<int64>
read-only

Size of the uploaded file, in bytes.

durationSecs
number<float>
read-only

Analyzed duration of the sample, in seconds, before any trim is applied.

mimeType
enum<string>
read-only

Detected audio format, sniffed from the file's byte content.

Available options:
audio/wav,
audio/webm,
audio/mpeg
hash
string
read-only

Base64-encoded MD5 of the stored object, for verifying upload integrity against the source file.

trimStartMs
integer<int32> | null

Trim start offset in milliseconds, if set.

trimEndMs
integer<int32> | null

Trim end offset in milliseconds, if set.