API – Data storage¶
Paths are under https://api.innovanet.com. Header Authorization: Bearer inv_mcp_…. The innovanet() helper is in API.
Creating a folder or a file needs the storage permission. Reading needs a signed-in token.
GET /api/data-storage¶
Contents of a folder. Without folder_id this is the root.
| Parameter | Type | Required | Description |
|---|---|---|---|
folder_id |
integer | no | folder |
$res = innovanet('GET', '/api/data-storage?folder_id=2');
Response 200 – data holds the folders and files in that folder.
The whole tree: GET /api/data-storage/folders.
POST /api/data-storage/folders¶
| Field | Type | Required | Description |
|---|---|---|---|
name |
string | yes | at most 500 |
parent_id |
integer | no | parent folder; without it the folder is in the root |
Request
{ "name": "Contracts", "parent_id": null }
PHP
$res = innovanet('POST', '/api/data-storage/folders', [
'name' => 'Contracts',
]);
Response 201 – data is the new folder. Without write permission the status is 403.
POST /api/data-storage/folders/{folderId}/files¶
Send multipart/form-data with the required file field and optional name. The response is JSON. The introductory JSON helper does not upload files; use multipart cURL:
curl -sS -X POST "https://api.innovanet.com/api/data-storage/folders/2/files" \
-H "Authorization: Bearer inv_mcp_…" \
-F "file=@contract.pdf" \
-F "name=Contract 2026"
Response 201 – data is the file record (id, name, folder_id, size, mime_type, size_formatted).
{
"success": true,
"data": {
"id": 9,
"name": "Contract 2026",
"folder_id": 2,
"size": 48211,
"mime_type": "application/pdf"
}
}
The same name in the folder returns 409. Download: GET /api/data-storage/files/9/download.
Other paths¶
Each path below belongs to this module. Field names are the ones the API reads. A downloaded file is not JSON.
POST /api/data-storage/files/{id}/version¶
A storage administrator uploads a new version as multipart/form-data. The file is required; the URL identifier must refer to an existing file.
| Field | Type | Required | Description |
|---|---|---|---|
file |
file | yes | new file contents |
curl -sS -X POST "https://api.innovanet.com/api/data-storage/files/9/version" -H "Authorization: Bearer inv_mcp_…" -H "Accept: application/json" -F "file=@contract-v2.pdf"
Response 200 is JSON with success and data containing the updated file record (id, name, folder_id, size, mime_type, modified_by, size_formatted). A missing file returns 422; missing management permission returns 403. Older versions remain available through the version list.
GET /api/data-storage/files/{id}/log¶
No body.
Response 200 – Envelope { "success": true, "data": ... }.
GET /api/data-storage/files/{id}/versions¶
No body.
Response 200 – Envelope { "success": true, "data": ... }.
GET /api/data-storage/files/{id}/versions/{versionNumber}/download¶
No body.
Response – The response is a file, not JSON.
Want to try this feature? Start your innovanet trial →