Media
The media endpoints allow you to upload, retrieve, and delete files within the media gallery associated with your workspace.
Get Upload URL
Generates a pre-signed URL that can be used to upload audio or video files to the media gallery.
Method: POST
Endpoint: https://api.revoiceit.com/media/upload-url
Request Body:
{
"fileName": "string",
"contentType": "string"
}
| Field | Type | Description | Required |
| fileName | string | File name with optional path. For example: - myAudio.wav- files/video/myVideo.mp4 | Required |
| contentType | string | Must start with audio/ or video/Supported audio formats: wav, mp3, ogg, mpeg, m4a Supported video formats: mp4, mov, avi, mkv, webm, flv | Required |
Response:
{
/* a URL string
e.g.
"https://upload-url.com/path/to/file"
*/
}
After obtaining the
uploadUrl, send aPUTrequest to it with the file in the body to upload your media.
Maximum file size: 5 GB.
EachuploadUrlis valid for 15 minutes.
Returned HTTP Codes
| Http Code | Description |
| 200 | Upload URL generated |
| 400 | Invalid file name or content type |
| 500 | Internal server error |
Multipart Media Upload
Generates pre-signed URLs for multipart uploads to the media gallery. Multipart upload is recommended for large files because it allows uploading in smaller chunks (parts).
Method: POST
Endpoint: https://api.revoiceit.com/media/upload-url/multipart
Case 1: Generate Pre-signed URL (action = "presign")
Request Body:
{
"action": "presign",
"fileName": "string",
"contentType": "string",
"partNumber": "number",
"uploadId": "string"
}
| Field | Type | Description | Required |
| action | string | Must be "presign" | Required |
| fileName | string | File name with optional path. Example: - myAudio.wav - files/video/myVideo.mp4 | Required |
| contentType | string | Must start with audio/ or video/.Supported audio formats: wav, mp3, ogg, mpeg, m4a Supported video formats: mp4, mov, avi, mkv, webm, flv | Required |
| partNumber | number | The part index in the upload (1, 2, 3...). Defaults to 1 for the first request. | Optional for part 1, Required otherwise |
| uploadId | string | The multipart upload ID returned by the first request. Required for part 2+. | Required for part 2+, must be omitted for part 1 |
Response:
{
"uploadId": "string",
"uploadUrl": "string"
}
Each uploadUrl is valid for 15 minutes.
Each uploadUrl is valid for a single PUT request with one file part.
Each part must be between 5 MB and 5 GB (except the final part, which may be smaller).
The same uploadId must be reused for all parts of the same file.
Case 2: Complete Multipart Upload (action = "complete")
Request Body:
{
"action": "complete",
"fileName": "string",
"contentType": "string",
"uploadId": "string",
"parts": [
{
"ETag": "string",
"PartNumber": "number"
}
]
}
| Field | Type | Description | Required |
| action | string | Must be "complete" | Required |
| fileName | string | Same fileName used in the presign requests. | Required |
| contentType | string | Same content type used in the presign requests. | Required |
| uploadId | string | The upload ID returned from presign requests. | Required |
| parts | array<object> | An array of uploaded parts, each containing: - ETag: Returned in the response header after uploading each part.- PartNumber: The part number associated with that upload URL. | Required |
Response:
{
"message": "string"
}
Returned HTTP Codes
| Http Code | Description |
| 200 | Upload URL generated / Upload completed successfully |
| 400 | Invalid parameters, unsupported type, part size out of bounds, or invalid multipart sequence |
| 404 | Upload ID not found or already completed/aborted |
| 500 | Internal server error |
Get Media Files
Returns a list of all media files uploaded to the media gallery of your workspace.
Method: GET
Endpoint: https://api.revoiceit.com/media/files
Response:
[
"audioFile.mp3",
"files/audio/myAudio.wav",
"files/video/myVideo.mp4",
...
]
Returned HTTP Codes
| Http Code | Description |
| 200 | Success |
| 500 | Internal server error |
Delete Media Files
Deletes one or more files, or an entire directory, from the media gallery.
Method: POST
Endpoint: https://api.revoiceit.com/media/files/delete
Request Body:
{
"paths": ["files/audio/myAudio.wav", "files/video/"]
}
| Field | Type | Description | Required |
| paths | array<string> | A list of file paths or directory paths in the media gallery to be deleted. | Required |
Returned HTTP Codes
| Http Code | Description |
| 204 | Deleted successfully |
| 400 | Invalid input |
| 500 | Internal server error |