File System
The File System API lets you create, read, update, move, copy, delete, download, and list files and folders in an Egnyte domain. This is one of Egnyte's core APIs, as most integrations require basic file system operations.
Base URL
https://{domain}.egnyte.com/pubapi/v1/fs
https://{domain}.egnyte.com/pubapi/v1/fs-content
Authentication
All requests require an OAuth 2.0 Bearer token in the Authorization header:
Authorization: Bearer {access_token}
See Authentication for details on obtaining a token.
Important Notes
Note: File and folder paths must be URL-encoded segment by segment. Do not encode forward slashes (/). For example, Shared/example?path/$file.txt should be encoded as Shared/example%3Fpath/%24file.txt. See Path Encoding for details.
Note: You can reference files and folders using either paths or persistent IDs. See ID-Based References for details.
Note: For file uploads larger than 100 MB, use the Chunked Upload flow.
Path Encoding
Each segment of a file or folder path must be URL-encoded separately. Forward slashes (/) separating path segments must not be encoded.
Example:
- Original path:
Shared/example?path/$file.txt - Encoded path:
Shared/example%3Fpath/%24file.txt
ID-Based References
You can reference files and folders using persistent IDs instead of paths.
Files
- Get file details:
/pubapi/v1/fs/ids/file/{GROUP_ID} - Download file:
/pubapi/v1/fs-content/ids/file/{GROUP_ID} - Download specific version:
/pubapi/v1/fs-content/ids/file/{GROUP_ID}?entry_id={ENTRY_ID} - Delete file:
/pubapi/v1/fs/ids/file/{GROUP_ID} - Delete specific version:
/pubapi/v1/fs/ids/file/{GROUP_ID}?entry_id={ENTRY_ID}
Folders
- Get folder details:
/pubapi/v1/fs/ids/folder/{FOLDER_ID}
Note: In the Event API response, entry_id is called target_id and group_id is called target_group_id.
Create a Folder
Creates a new folder at the specified path.
Request
POST /pubapi/v1/fs/{Full Path to Folder}
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
Full Path to Folder | string | Yes | Full path where the folder will be created (e.g., Shared/test) |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
action | string | Yes | Must be add_folder |
Example Request
curl -i -X POST "https://{domain}.egnyte.com/pubapi/v1/fs/Shared/test" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -d '{ "action": "add_folder" }'
Response
200 OK or 201 Created
| Field | Type | Description |
|---|---|---|
path | string | Full path of the created folder |
folder_id | string | Unique ID of the created folder |
Example Response
{
"path": "/Shared/test",
"folder_id": "4abfdc36-2a1b-44b4-8792-01bf43c0d0f9"
}
Upload a File
Creates or updates a file at the specified path.
Note: For files larger than 100 MB, use the Chunked Upload flow.
Request
POST /pubapi/v1/fs-content/{Full Path to File}
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
Full Path to File | string | Yes | Full path where the file will be uploaded (e.g., Shared/Documents/test.txt) |
Request Headers
| Header | Type | Required | Description |
|---|---|---|---|
X-Sha512-Checksum | string | No | SHA512 hash of the entire file for validating upload integrity |
Last-Modified | string | No | Last modified date for the file (e.g., Sun, 26 Aug 2012 03:55:29 GMT). If omitted, the current time is used. |
Example Request
curl -i -X POST "https://{domain}.egnyte.com/pubapi/v1/fs-content/Shared/Documents/test.txt" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Response
200 OK or 201 Created
Returns file metadata upon successful upload.
Move File or Folder
Moves a file or folder to a new location.
Request
By Path:
POST /pubapi/v1/fs/{Full Path to File/Folder}
By ID:
POST /pubapi/v1/fs/ids/{file or folder}/{ID}
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
Full Path to File/Folder | string | Yes (by path) | Full path of the file or folder to move |
file or folder | string | Yes (by ID) | Literal string file or folder |
ID | string | Yes (by ID) | group_id for files or folder_id for folders |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
action | string | Yes | Must be move |
destination | string | Yes (by path) | Full absolute destination path |
destination_id | string | No | Destination ID |
name | string | No | May be used with the destination ID in the ID based calls to provide the destination entity name. |
permissions | string | No | How permissions are derived: keep_original or inherit_from_parent. If omitted, uses workgroup settings. |
folder_options_mode | string | No | How folder options are handled: keep_source or apply_destination. If omitted, uses workgroup settings. |
Example Request (File)
curl -i -X POST "https://{domain}.egnyte.com/pubapi/v1/fs/Shared/fromFolder/test.txt" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -d '{ "action": "move", "destination": "/Shared/toFolder/test.txt" }'
Example Request (Folder)
curl -i -X POST "https://{domain}.egnyte.com/pubapi/v1/fs/Shared/fromFolder" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -d '{ "action": "move", "destination": "/Shared/toFolder" }'
Response
200 OK
When moving a folder:
{
"path": "/Shared/toFolder",
"folder_id": "5919b927-13ef-4f74-a735-4dac2c4c6302"
}
When moving a file:
{
"path": "/Shared/toFolder/sample.txt",
"group_id": "8163f6a1-09e7-488c-b95f-094c9d75ff1b"
}
Copy File or Folder
Copies a file or folder to a new location.
Request
By Path:
POST /pubapi/v1/fs/{Full Path to File/Folder}
By ID:
POST /pubapi/v1/fs/ids/{file or folder}/{ID}
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
Full Path to File/Folder | string | Yes (by path) | Full path of the file or folder to copy |
file or folder | string | Yes (by ID) | Literal string file or folder |
ID | string | Yes (by ID) | group_id for files or folder_id for folders |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
action | string | Yes | Must be copy |
destination | string | Yes (by path) | Full absolute destination path. If the destination does not include the original folder name, only the contents are copied. |
destination_id | string | No | Destination ID |
name | string | No | May be used with the destination ID in the ID based calls to provide the destination entity name. |
permissions | string | No | How permissions are derived: keep_original or inherit_from_parent. If the destination folder already exists, its permissions are preserved. If omitted, uses workgroup settings. |
folder_options_mode | string | No | How folder options are handled: keep_source or apply_destination. If omitted, uses workgroup settings. |
Example Request (File)
curl -i -X POST "https://{domain}.egnyte.com/pubapi/v1/fs/Shared/fromFolder/test.txt" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -d '{ "action": "copy", "destination": "/Shared/toFolder/test.txt" }'
Example Request (Folder)
curl -i -X POST "https://{domain}.egnyte.com/pubapi/v1/fs/Shared/fromFolder" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -d '{ "action": "copy", "destination": "/Shared/toFolder", "permissions": "inherit_from_parent" }'
Response
200 OK
When copying a file:
{
"path": "/Shared/toFolder/test.txt",
"group_id": "ac086094-d21f-44d7-9e54-ba7c7066542f"
}
When copying a folder:
{
"path": "/Shared/toFolder",
"folder_id": "5919b927-13ef-4f74-a735-4dac2c4c6302"
}
Delete a File or Folder
Deletes a file or folder (moves it to trash).
Request
By Path:
DELETE /pubapi/v1/fs/{Full Path to File/Folder}
By ID:
DELETE /pubapi/v1/fs/ids/{file or folder}/{ID}
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
Full Path to File/Folder | string | Yes (by path) | Full path of the file or folder to delete |
file or folder | string | Yes (by ID) | Literal string file or folder |
ID | string | Yes (by ID) | group_id for files or folder_id for folders |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
entry_id | string | No | Entry ID of a specific file version to delete |
Example Request (File)
curl -i -X DELETE "https://{domain}.egnyte.com/pubapi/v1/fs/Shared/test/mydocument.docx" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Example Request (Folder)
curl -i -X DELETE "https://{domain}.egnyte.com/pubapi/v1/fs/Shared/test" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Response
200 OK
{
"parent_folder_path": "/Shared/test"
}
Download File
Downloads a file. Supports range downloads for partial file retrieval.
Request
By Path:
GET /pubapi/v1/fs-content/{Full Path to File}
By ID:
GET /pubapi/v1/fs-content/ids/file/{ID}
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
Full Path to File | string | Yes (by path) | Full path of the file to download |
ID | string | Yes (by ID) | group_id of the file |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
entry_id | string | No | Entry ID of a specific file version to download |
Request Headers
| Header | Type | Required | Description |
|---|---|---|---|
Range | string | No | Byte range to download (e.g., bytes=0-999). Recommended for large files or unstable connections. See RFC 2068, section 14.36.1. |
If-None-Match | string | No | When provided with a value that matches the ID of the latest version of the file, a response with HTTP 304 status is returned to indicate that the server content hasn't changed. This is used to prevent downloading the version that the client has already downloaded. See RFC 9110, section 13.1.2 |
Example Request
curl -i -X GET "https://{domain}.egnyte.com/pubapi/v1/fs-content/Shared/Documents/test.txt" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Response
200 OK or 206 Partial Content (for range requests)
Response Headers
| Header | Type | Description |
|---|---|---|
X-Sha512-Checksum | string | SHA512 hash of the entire file |
Last-Modified | string | Last modified date of the file |
ETag | string | Entity tag for version comparison |
Content-Type | string | MIME type of the file |
Content-Length | integer | Size of the response body in bytes |
Example Response
Binary file data.
List File or Folder
Lists information about a file or folder, including folder contents and file versions.
Request
By Path:
GET /pubapi/v1/fs/{Full Path to File/Folder}
By ID:
GET /pubapi/v1/fs/ids/{file or folder}/{ID}
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
Full Path to File/Folder | string | Yes (by path) | Full path of the file or folder |
file or folder | string | Yes (by ID) | Literal string file or folder |
ID | string | Yes (by ID) | group_id for files or folder_id for folders |
Query Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
list_content | boolean | No | false | If true, includes folder contents (files and subfolders) or file versions |
allowed_link_types | boolean | No | false | If true, includes allowed_file_link_types, allowed_folder_link_types, and allow_upload_links fields |
count | integer | No | — | Maximum number of items to return (for pagination) |
offset | integer | No | 0 | Zero-based index to start returning items (for pagination) |
sort_by | string | No | — | Field to sort by: name, last_modified, uploaded_by, or custom_metadata |
key | string | No | — | Custom metadata field to sort by (format: namespace.key). Required if sort_by=custom_metadata. |
sort_direction | string | No | — | Sort direction: ascending or descending |
perms | boolean | No | false | If true, includes a permissions key listing users/groups and their permission levels |
include_perm | boolean | No | false | If true, includes the current user's permission level on the folder and subfolders |
list_custom_metadata | boolean | No | false | If true, includes custom metadata for each item |
include_locks | boolean | No | false | If true, includes lock information (user who locked the file) |
include_collaboration | boolean | No | false | If true, includes collaboration app/integration information. Requires include_locks=true. |
Example Request (Folder)
curl -i -X GET "https://{domain}.egnyte.com/pubapi/v1/fs/Shared/MyDocuments/MyFolder" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Example Request (File)
curl -i -X GET "https://{domain}.egnyte.com/pubapi/v1/fs/Shared/MyDocuments/example.txt" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Response
200 OK
Folder Response
| Field | Type | Description |
|---|---|---|
name | string | Name of the folder |
uploaded | integer | Epoch timestamp (milliseconds) when the folder was created |
lastModified | integer | Epoch timestamp (milliseconds) of the latest file modification in the folder (not subfolders) |
count | integer | Number of items returned in this response |
offset | integer | Zero-based index of the first item returned |
path | string | Full path of the folder |
folder_id | string | Unique ID of the folder |
parent_id | string | Unique ID of the parent folder |
total_count | integer | Total number of items available |
is_folder | boolean | Always true for folders |
permission | string | Permission level. One of Owner, Full, Editor, Viewer, Viewer Only (if include_perm=true) |
permissions | object | Contains users and groups specific permissions applicable to this folder (if perms=true) |
folder_description | string | Description set for the folder using the web interface or the folder options API |
public_links | string | Public link setting: files_folders, folders, files, or disabled |
allow_links | boolean | Whether users can share links from this folder |
allow_upload_links | boolean | Whether users can share upload links to this folder |
allowed_file_link_types | array | List of links that are allowed for files: anyone, password, domain, recipients |
allowed_folder_link_types | array | List of links that are allowed for folders: anyone, password, domain, recipients |
restrict_move_delete | boolean | true if only admins and owners can delete/move; false if users with full permissions can also delete/move |
move_delete_folder_restriction | string | A value indicating who can move or delete this folder. - ADMINS_OWNERS_OR_FULL_ACCESS_USERS Admin users or users with owner or full permission - ADMINS_OR_OWNERS Admin users or users with owner permission - ADMINS_ONLY Admin users - FORBIDDEN Not permitted for any user |
custom_metadata | array | List of objects (each object's key is the name of the metadata section, value is an object of {metadata key, value}). Also included for folders and files. (if list_custom_metadata=true) |
folders | array | List of subfolders (each contains name, lastModified, uploaded, path, folder_id, parent_id, is_folder) |
files | array | List of files (see File Response below) |
Example Response (Folder)
{
"name": "MyFolder",
"lastModified": 1554182069000,
"uploaded": 1554178564015,
"count": 0,
"offset": 0,
"path": "/Shared/MyDocuments/MyFolder",
"folder_id": "d7d56ebc-ce31-4ba8-a6b3-292ffb43f215",
"parent_id": "b0sceebc-2edl-ab56-lapq-fb11def11123",
"total_count": 2,
"is_folder": true,
"folder_description": "Sample documents related to G & A",
"permission": "Owner",
"permissions": {
"users": [
{
"subject": "admin",
"permission": "Owner"
}
]
},
"public_links": "files_folders",
"allowed_file_link_types": [
"anyone",
"password",
"domain",
"recipients"
],
"allowed_folder_link_types": [
"anyone",
"password",
"domain",
"recipients"
],
"allow_upload_links": true,
"allow_links": true,
"restrict_move_delete": false,
"custom_metadata": [
{
"smart tags": {
"aec image tags": "[\"Concrete\"]",
"document topics": "[\"data center\"]"
}
}
],
"folders": [
{
"name": "subfolder1",
"lastModified": 1554185307000,
"uploaded": 1554185307326,
"path": "/Shared/MyDocuments/MyFolder/subfolder1",
"folder_id": "fc8cf940-1097-491e-bb9d-b55b5797331c",
"is_folder": true,
"parent_id": "d7d56ebc-ce31-4ba8-a6b3-292ffb43f215"
}
],
"files": [
{
"checksum": "244b99790dcc91ebc5862eb547c8179515b2369bb6db5aaa1ddd46bf0035e7ba3849ba1494b294b20b7c2a055a52d3a65ccab8a090f06cf40106528f6e23a91e",
"size": 238428,
"path": "/Shared/MyDocuments/MyFolder/info.pdf",
"name": "info.pdf",
"locked": false,
"is_folder": false,
"entry_id": "b563a343-184b-4bce-8331-25d2dfb8125a",
"group_id": "01dd4abd-983b-4104-bff6-e2ad44bff357",
"parent_id": "d7d56ebc-ce31-4ba8-a6b3-292ffb43f215",
"last_modified": "Tue, 02 Apr 2019 05:12:44 GMT",
"uploaded_by": "jsmith",
"uploaded": 1554182069464,
"num_versions": 1
}
]
}
File Response
| Field | Type | Description |
|---|---|---|
checksum | string | SHA512 checksum of the current file version |
size | integer | Size of the file in bytes |
path | string | Full path of the file |
name | string | Name of the file |
locked | boolean | true if the file is locked; false otherwise |
is_folder | boolean | Always false for files |
entry_id | string | Unique ID of the current file version |
group_id | string | Unique ID of the file (across all versions) |
parent_id | string | Unique ID of the parent folder |
last_modified | string | Last modified date of the current version |
uploaded_by | string | Username of the user who uploaded the current version |
uploaded | integer | Epoch timestamp (milliseconds) when the current version was uploaded |
permission | string | Permission level. One of Owner, Full, Editor, Viewer, Viewer Only (if include_perm=true) |
num_versions | integer | Total number of versions of this file |
versions | array | List of previous file versions (excludes current version) |
lock_info | object | Lock information (if include_locks=true) |
custom_metadata | array | List of objects (each object's key is the name of the metadata section, value is an object of {metadata key, value}). Also included for versions. (if list_custom_metadata=true) |
Example Response (File)
{
"checksum": "32d919f9f96d6f8e92889e68eb2c9eb8079b2327d80a70e247a9c426f9fc5049a7a7978eb6f0ab6d129720b871637d8175e047199bcf77fe36d23d15e81886a8",
"size": 1023,
"path": "/Shared/MyDocuments/example.txt",
"name": "example.txt",
"locked": false,
"is_folder": false,
"entry_id": "a4e2857e-9cf4-492f-9087-0a8cee324e4c",
"group_id": "765f70fd-122f-47ed-b50d-b5e80662596b",
"parent_id": "b0sceebc-2edl-ab56-lapq-fb11def11123",
"last_modified": "Tue, 02 Apr 2019 05:12:44 GMT",
"uploaded_by": "jsmith",
"uploaded": 1554182069464,
"num_versions": 3,
"custom_metadata": [
{
"document labels": {
"policy labels": "important"
}
}
],
"versions": [
{
"is_folder": false,
"entry_id": "0ee550e4-854a-4ebc-a2d1-0de17714957f",
"checksum": "2aca968ceb5452f797810a67ff283eb0b72dc334868c11f16e8cb9b8ab713e30f49a30245d16a9f187293b4971fd8a1d6c588d981799283ec1fbcc84c9fe44cb",
"last_modified": "Fri, 29 Mar 2019 16:31:53 GMT",
"uploaded_by": "mjohnson",
"uploaded": 1554180282161,
"size": 1378
},
{
"is_folder": false,
"entry_id": "1eb75cc1-af4f-4331-8e56-b2f7d1ebebe5",
"checksum": "0a6a7ba5048971d4718da58ec0f9ba51a4bfc5691f11da4c0afa38244f474f7076bb6edf48d8bfb55bbbcf128c55918fbe96485ac1178e78ac2686a6fb4a0785",
"last_modified": "Tue, 02 Apr 2019 04:50:14 GMT",
"uploaded_by": "jsmith",
"uploaded": 1554180634999,
"size": 1108
}
]
}
Get Folder Statistics
Retrieves folder size and item counts, including all files and subfolders.
Request
GET /pubapi/v1/fs/ids/folder/{FOLDER_ID}/stats
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
FOLDER_ID | string | Yes | Unique ID of the folder |
Example Request
curl -i -X GET "https://{domain}.egnyte.com/pubapi/v1/fs/ids/folder/{folderId}/stats" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Response
200 OK
| Field | Type | Description |
|---|---|---|
allVersionsSize | integer | Total size of all file versions in bytes |
allFilesSize | integer | Total size of all current file versions in bytes |
filesCount | integer | Total number of files |
fileVersionsCount | integer | Total number of file versions |
foldersCount | integer | Total number of subfolders |
allVersionsSizeInKB | integer | Total size of all file versions in kilobytes |
allFilesSizeInKB | integer | Total size of all current file versions in kilobytes |
Example Response
{
"allVersionsSize": 1732505,
"allFilesSize": 1721488,
"filesCount": 10,
"fileVersionsCount": 12,
"foldersCount": 9,
"allVersionsSizeInKB": 1691
}
Lock a File
Locks a file to prevent modifications by other users.
Request
By Path:
POST /pubapi/v1/fs/{Full Path to File}
By ID:
POST /pubapi/v1/fs/ids/file/{GROUP_ID}
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
Full Path to File | string | Yes (by path) | Full path of the file to lock |
GROUP_ID | string | Yes (by ID) | group_id of the file |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
action | string | Yes | Must be lock |
lock_token | string | No | Token required to unlock the file. If omitted, a random token is generated and returned. |
lock_timeout | integer | No | Lock duration in seconds. Default is 3600 (1 hour). Maximum is 604800 (7 days). |
collaboration | string | No | Collaboration token for UI Integration Framework apps (Base64-encoded) |
Example Request
curl -i -X POST "https://{domain}.egnyte.com/pubapi/v1/fs/Shared/Documents/test.txt" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -d '{ "action": "lock", "lock_token": "my lock token", "lock_timeout": 7200 }'
Response
200 OK
Returns confirmation of the lock.
Unlock a File
Unlocks a previously locked file.
Request
By Path:
POST /pubapi/v1/fs/{Full Path to File}
By ID:
POST /pubapi/v1/fs/ids/file/{GROUP_ID}
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
Full Path to File | string | Yes (by path) | Full path of the file to unlock |
GROUP_ID | string | Yes (by ID) | group_id of the file |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
action | string | Yes | Must be unlock |
lock_token | string | Yes | Token used when locking the file |
Example Request
curl -i -X POST "https://{domain}.egnyte.com/pubapi/v1/fs/Shared/Documents/test.txt" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -d '{ "action": "unlock", "lock_token": "my lock token" }'
Response
200 OK
Returns confirmation of the unlock.
Chunked Upload
Uploads large files in chunks. Recommended for files larger than 100 MB.
Chunked uploads use a dedicated fs-content-chunked endpoint, and each
chunk is sent as the raw request body — not as multipart/form-data
(unlike the simple upload endpoint above).
Request
By Path:
POST /pubapi/v1/fs-content-chunked/{Full Path to File}
By ID:
POST /pubapi/v1/fs-content-chunked/ids/file/{ID}
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
Full Path to File | string | Yes (by path) | Full path where the file will be uploaded |
ID | string | Yes (by ID) | group_id of the file |
Chunked Upload Process
-
Split the file into chunks:
- Recommended chunk size: 104857600 bytes (100 MB)
- Minimum chunk size: 10485760 bytes (10 MB)
- Maximum chunk size: 1073741824 bytes (1 GB)
- All chunks must be the same size, except the last chunk
-
Upload the first chunk:
- Include the
X-Egnyte-Chunk-Num: 1header - Include the
X-Egnyte-Chunk-Sha512-Checksumheader with the SHA512 hash of the chunk - Save the
X-Egnyte-Upload-Idfrom the response
- Include the
-
Upload remaining chunks (except the last):
- Include the
X-Egnyte-Upload-Idheader from step 2 - Include the
X-Egnyte-Chunk-Numheader with the chunk number - Include the
X-Egnyte-Chunk-Sha512-Checksumheader - Upload chunks in parallel for maximum throughput
- Include the
-
Upload the final chunk:
- Include the
X-Egnyte-Last-Chunk: trueheader - Include the
X-Sha512-Checksumheader with the composite whole-file checksum in the format{Version}-{NumChunks}-{ChunkSize}-{SHA512(Concatenated Chunk Checksums)}(see Calculating the Final Checksum). A plain SHA512 of the file bytes is rejected with a checksum mismatch. - Optionally include the
Last-Modifiedheader
- Include the
-
Chunks expire after 24 hours from the first chunk upload.
Request Headers
Common Headers (All Chunks)
| Header | Type | Required | Description |
|---|---|---|---|
X-Egnyte-Chunk-Num | integer | Yes | Chunk number (starts at 1) |
X-Egnyte-Chunk-Sha512-Checksum | string | Yes | SHA512 hash of the chunk data |
First Chunk Only
No additional headers required.
Subsequent Chunks (Not Last)
| Header | Type | Required | Description |
|---|---|---|---|
X-Egnyte-Upload-Id | string | Yes | Upload ID returned from the first chunk |
Last Chunk Only
| Header | Type | Required | Description |
|---|---|---|---|
X-Egnyte-Upload-Id | string | Yes | Upload ID returned from the first chunk |
X-Egnyte-Last-Chunk | boolean | Yes | Must be true |
X-Sha512-Checksum | string | No | Composite whole-file checksum: {Version}-{NumChunks}-{ChunkSize}-{SHA512(Concatenated Chunk Checksums)} — not a plain SHA512 of the file bytes |
Last-Modified | string | No | Last modified date (e.g., Sun, 26 Aug 2012 03:55:29 GMT) |
Response Headers
| Header | Type | Description |
|---|---|---|
X-Egnyte-Upload-Id | string | Upload ID (returned after first chunk) |
X-Egnyte-Chunk-Num | integer | Chunk number that was uploaded |
X-Egnyte-Chunk-Sha512-Checksum | string | SHA512 hash of the chunk (for validation) |
Final Response (After Last Chunk)
200 OK
Returns a checksum in the format:
{Version}-{NumChunks}-{ChunkSize}-{SHA512(Concatenated Chunk Checksums)}
Example:
2-3-10485761-41e3a616682407fd721ef2843ac5f3966c73ae2ef0bc00fc3d8c27d69327fc3d326ce64b13163cbc7664be3e1bc1a9f8bf4c1d257fdfdab20919edbc6813f30f
- Version: Checksum format version (currently
2) - NumChunks: Total number of chunks
- ChunkSize: Size of each chunk (except the last)
- SHA512(Concatenated Chunk Checksums): SHA512 hash of the concatenated chunk checksums
Calculating the Final Checksum
To verify the upload, compute the SHA512 hash of the concatenated chunk checksums.
Example (Bash):
CHECKSUM1="886a81ec5f9e4f66aaa77d95ccb58dc6ca4000bfb12d13351adf8cd6fb09933e0e16d057983eb8a81fffc71d71f6fc5c1649d08b20b0dc30d64ea449850b4f41"
CHECKSUM2="8ae7b487d9ad803e0ad85dee9320a1c3203f021e2fffe07573588e2869f097589eaa97923d75ada6f84a5eaeb7ad63f7f0a0ddc1e78053f570b8a6363abcd9f3"
CHECKSUM3="eef77c3e9fef9277e0a3bbc8a4faaf2727481296b3d6e0143c5c661d2cd1441eeccc54d4bc086c29ea3ee918a79dcba122bd077fe3232f30f54afc7ed452cc8d"
echo -n $CHECKSUM1$CHECKSUM2$CHECKSUM3 | openssl dgst -sha512
Example (Python):
import hashlib
m = hashlib.sha512()
m.update("886a81ec5f9e4f66aaa77d95ccb58dc6ca4000bfb12d13351adf8cd6fb09933e0e16d057983eb8a81fffc71d71f6fc5c1649d08b20b0dc30d64ea449850b4f41")
m.update("8ae7b487d9ad803e0ad85dee9320a1c3203f021e2fffe07573588e2869f097589eaa97923d75ada6f84a5eaeb7ad63f7f0a0ddc1e78053f570b8a6363abcd9f3")
m.update("eef77c3e9fef9277e0a3bbc8a4faaf2727481296b3d6e0143c5c661d2cd1441eeccc54d4bc086c29ea3ee918a79dcba122bd077fe3232f30f54afc7ed452cc8d")
print(m.hexdigest())
Expected Result:
41e3a616682407fd721ef2843ac5f3966c73ae2ef0bc00fc3d8c27d69327fc3d326ce64b13163cbc7664be3e1bc1a9f8bf4c1d257fdfdab20919edbc6813f30f
Error Codes
| Status | Error | Description | Resolution |
|---|---|---|---|
| 400 | Bad Request | Missing parameters, file filtered out (e.g., .tmp file), or file exceeds plan size limit | Verify request parameters and file type; check account storage quota |
| 401 | Unauthorized | Invalid or expired OAuth token | Refresh your OAuth token |
| 403 | Forbidden | Insufficient permissions or forbidden upload location (e.g., /, /Shared, /Private) | Ensure the user has the required permissions; verify the upload path is valid |
| 404 | Not Found | File or folder does not exist | Verify the file or folder path or ID |
| 409 | Conflict | File or folder with the same name already exists, or forbidden upload location | Choose a different name or location |
| 413 | Payload Too Large | File size exceeds account limit or storage quota exceeded | Reduce file size or upgrade account storage |
| 429 | Rate Limited | Too many requests | Implement exponential backoff; check Retry-After header |
Related Resources
- Authentication — How to obtain and refresh OAuth tokens
- Metadata API — Manage custom metadata on files and folders
- Event API — Track file system events
- Best Practices — Rate limiting, pagination, and error handling
