Skip to main content

File Management

Run in Postman

A lot of NeuralSpace APIs work on files. E.g., to transcribe an audio file, or to extract voice audio from an audio, or identify speakers in an audio file. You can also generate audio files from text in batches. Because of this we have file management APIs which gives you a unique ID for every file you upload. File IDs can be reused for multiple APIs.

Upload a File

curl --location --request POST 'https://platform.neuralspace.ai/api/file/upload' \
--header 'Authorization: <ACCESS-TOKEN>' \
--form 'files=@"<PATH-TO-YOUR-FILE>"'

This API returns a file ID:

{
"success": true,
"message": "File uploaded successfully",
"data": {
"fileId": "<SOME-FILE-ID>"
}
}

Access your file from anywhere

You can use the following public URL to access your file

https://largefilestoreprod.blob.core.windows.net/common/uploads/<YOUR-FILE-ID>

Download a File

curl --location --request GET 'https://platform.neuralspace.ai/api/file/download?fileId=<FILE-ID>' \
--header 'Authorization: <ACCESS-TOKEN>'

The file content is returned.

Get Single File Details

curl --location --request GET 'https://platform.neuralspace.ai/api/file?fileId=<FILE-ID>' \
--header 'Authorization: <ACCESS-TOKEN>' \
--data-raw ''

You get the following as response:

{
"success": true,
"message": "Data fetched succssfully",
"data": {
"fileId": "<FILE-ID>",
"fileName": "<FILE-NAME>",
"fileExt": "...",
"fileSize": ...,
"metadata": {
"audioDuration": ...
},
"apikey": "...",
"reference": "...",
"uploadedAt": ...
}
}

Delete File

This deletes a file permanently from our storage.

curl --location --request DELETE 'https://platform.neuralspace.ai/api/file?fileId=<FILE-ID>' \
--header 'authorization: <ACCESS-TOKEN>'