Files
Delete a file by ID
File API
Request to delete a file. This will delete the file and all historic versions.
Parameters
Returns
204
The file has been deleted.
Endpoint
Request
curl -X DELETE 'https://{service_host}/file/v2/orgs/{organisation_id}/workspaces/{workspace_id}/files/{file_id}' \
-H 'Authorization: Bearer <ACCESS_TOKEN>'
Response
No response body.
Download a file by ID
File API
Request file metadata and a delegated download link for a specified file by ID. The download link should be followed to download the file contents from blob storage. This link is pre-signed and will expire after 30 minutes. Set the include_versions query parameter to true to get the complete list of available versions. Set the version query parameter to request a download link for that specific version of the specified file. If version is not set, the latest version of the file will be returned.
Parameters
Returns
200
An object containing file metadata and at least one download link. Optionally, the object will also contain a link for each file version.
Endpoint
Request
curl -X GET 'https://{service_host}/file/v2/orgs/{organisation_id}/workspaces/{workspace_id}/files/{file_id}' \
-H 'Authorization: Bearer <ACCESS_TOKEN>'
Response
{
"created_at": "2024-07-29T15:51:28.071Z",
"created_by": {
"email": "string",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"name": "string"
},
"deleted_at": "2024-07-29T15:51:28.071Z",
"deleted_by": {
"email": "string",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"name": "string"
},
"download": "string",
"etag": "string",
"file_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"modified_at": "2024-07-29T15:51:28.071Z",
"modified_by": {
"email": "string",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"name": "string"
},
"name": "string",
"path": "string",
"self": "string",
"size": 0,
"version_id": "string",
"versions": [
{
"created_at": "2024-07-29T15:51:28.071Z",
"created_by": {
"email": "string",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"name": "string"
},
"file_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"link": "string",
"name": "string",
"path": "string",
"size": 0,
"version_id": "string"
}
]
}
Update a file
Request an upload link for a new version of the specified file.
If the file does not exist an error will be returned.
Follow up a successful request with a call to the returned pre-signed upload link.
Specify a binary body containing the file to upload, with the addition of header key-value pair
x-ms-blob-type: BlockBlob.
The upload link is pre-signed and will expire after 30 minutes.
Including a version_id parameter allows creating a link to a blob with uncommitted blocks, i.e. the upload has not
been completed properly, or the original pre-signed link has expired.
Uncommitted blocks are valid for up to one week, after which they are automatically deleted.
Including a deleted parameter with a value of false will restore a deleted file.
Parameters
Returns
200
An object containing a pre-signed upload link. Submit the file content to the link.
Endpoint
Request
curl -X PUT 'https://{service_host}/file/v2/orgs/{organisation_id}/workspaces/{workspace_id}/files/{file_id}' \
-H 'Authorization: Bearer <ACCESS_TOKEN>'
Response
{
"file_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"upload": "string",
"version_id": "string"
}
Delete a file by path
File API
Request to delete a file. This will delete the file and all historic versions.
Parameters
Returns
204
The file has been deleted.
Endpoint
Request
curl -X DELETE 'https://{service_host}/file/v2/orgs/{organisation_id}/workspaces/{workspace_id}/files/path/{file_path}' \
-H 'Authorization: Bearer <ACCESS_TOKEN>'
Response
No response body.
Download a file by path
File API
Request file metadata and a delegated download link for a specified file by path. The download link should be followed to download the file contents. This link is pre-signed and will expire after 30 minutes. Set the include_versions query parameter to true to get the complete list of available versions. Set the version query parameter to request a download link for that specific version of the specified file. If version is not set, the latest version of the file will be returned.
Parameters
Returns
200
An object containing file metadata and at least one download link. Optionally, the object will also contain a link for each file version.
Endpoint
Request
curl -X GET 'https://{service_host}/file/v2/orgs/{organisation_id}/workspaces/{workspace_id}/files/path/{file_path}' \
-H 'Authorization: Bearer <ACCESS_TOKEN>'
Response
{
"created_at": "2024-07-29T15:51:28.071Z",
"created_by": {
"email": "string",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"name": "string"
},
"deleted_at": "2024-07-29T15:51:28.071Z",
"deleted_by": {
"email": "string",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"name": "string"
},
"download": "string",
"etag": "string",
"file_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"modified_at": "2024-07-29T15:51:28.071Z",
"modified_by": {
"email": "string",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"name": "string"
},
"name": "string",
"path": "string",
"self": "string",
"size": 0,
"version_id": "string",
"versions": [
{
"created_at": "2024-07-29T15:51:28.071Z",
"created_by": {
"email": "string",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"name": "string"
},
"file_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"link": "string",
"name": "string",
"path": "string",
"size": 0,
"version_id": "string"
}
]
}
Upload a file
Request an upload link for a new version of the specified file.
If the folders in the file path do not exist, they will be created.
If the file already exists, a new version will be created with the updated file content.
Follow up a successful request with a call to the returned pre-signed upload link.
Specify a binary body containing the file to upload, with the addition of header key-value pair
x-ms-blob-type: BlockBlob.
The upload link is pre-signed and will expire after 30 minutes.
Including a version_id parameter allows creating a link to data with uncommitted blocks, i.e. the upload has not
been completed properly, or the original pre-signed link has expired.
Uncommitted blocks are valid for up to one week, after which they are automatically deleted.
Parameters
Returns
200
An object containing a pre-signed upload link. Submit the file content to the link.
Endpoint
Request
curl -X PUT 'https://{service_host}/file/v2/orgs/{organisation_id}/workspaces/{workspace_id}/files/path/{file_path}' \
-H 'Authorization: Bearer <ACCESS_TOKEN>'
Response
{
"file_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"upload": "string",
"version_id": "string"
}
List folder contents
File API
Request to list files. The maximum number of results returned is limited to 5000.
Parameters
Returns
200
A list of files
Endpoint
Request
curl -X GET 'https://{service_host}/file/v2/orgs/{organisation_id}/workspaces/{workspace_id}/files' \
-H 'Authorization: Bearer <ACCESS_TOKEN>'
Response
{
"count": 0,
"files": [
{
"created_at": "2024-07-29T15:51:28.071Z",
"created_by": {
"email": "string",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"name": "string"
},
"deleted_at": "2024-07-29T15:51:28.071Z",
"deleted_by": {
"email": "string",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"name": "string"
},
"etag": "string",
"file_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"links": {
"self": "string"
},
"modified_at": "2024-07-29T15:51:28.071Z",
"modified_by": {
"email": "string",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"name": "string"
},
"name": "string",
"path": "string",
"size": 0,
"version_id": "string"
}
],
"limit": 0,
"links": {
"next": "string",
"prev": "string",
"self": "string"
},
"offset": 0,
"total": 0
}