curl -X POST https://app.drime.cloud/api/v1/file-entries/485529678/verify-integrity \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"sha256": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
}'
const entryId = 485529678;
const response = await fetch(
`https://app.drime.cloud/api/v1/file-entries/${entryId}/verify-integrity`,
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
sha256: localFileHash // computed before upload
})
}
);
const { verified, serverHash } = await response.json();
if (!verified) {
console.error(`Integrity check failed, server has ${serverHash}`);
}
import hashlib
import requests
entry_id = 485529678
with open('/path/to/file.pdf', 'rb') as f:
local_hash = hashlib.sha256(f.read()).hexdigest()
response = requests.post(
f'https://app.drime.cloud/api/v1/file-entries/{entry_id}/verify-integrity',
headers={'Authorization': 'Bearer YOUR_ACCESS_TOKEN'},
json={'sha256': local_hash}
)
result = response.json()
print('OK' if result['verified'] else f"MISMATCH: server={result['serverHash']}")
{
"status": "success",
"verified": true,
"serverHash": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
}
{
"status": "success",
"verified": false,
"serverHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
}
{
"message": "This action is unauthorized."
}
Files & Folders
Verify File Integrity
Verify that the stored file content matches a SHA-256 hash
POST
/
file-entries
/
{entryId}
/
verify-integrity
curl -X POST https://app.drime.cloud/api/v1/file-entries/485529678/verify-integrity \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"sha256": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
}'
const entryId = 485529678;
const response = await fetch(
`https://app.drime.cloud/api/v1/file-entries/${entryId}/verify-integrity`,
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
sha256: localFileHash // computed before upload
})
}
);
const { verified, serverHash } = await response.json();
if (!verified) {
console.error(`Integrity check failed, server has ${serverHash}`);
}
import hashlib
import requests
entry_id = 485529678
with open('/path/to/file.pdf', 'rb') as f:
local_hash = hashlib.sha256(f.read()).hexdigest()
response = requests.post(
f'https://app.drime.cloud/api/v1/file-entries/{entry_id}/verify-integrity',
headers={'Authorization': 'Bearer YOUR_ACCESS_TOKEN'},
json={'sha256': local_hash}
)
result = response.json()
print('OK' if result['verified'] else f"MISMATCH: server={result['serverHash']}")
{
"status": "success",
"verified": true,
"serverHash": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
}
{
"status": "success",
"verified": false,
"serverHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
}
{
"message": "This action is unauthorized."
}
Overview
Asks the server to recompute the SHA-256 hash of the stored file content and compare it against the hash you provide. Use this after an upload to confirm the file was stored without corruption, end to end. The server streams the stored object in 2 MB chunks, so this works for large files without loading them in memory. When verification succeeds and the entry has no stored hash yet, the computed SHA-256 is saved to the entry’sfile_hash field for future lookups.
Only the owner of the file can call this endpoint. Other users receive a
403 error.Path Parameters
integer
required
The numeric file entry ID
Request Body
string
required
Expected SHA-256 hex digest of the file content (exactly 64 characters, case-insensitive)
Response
string
Request status (
success)boolean
true when the stored content matches the provided hashstring
SHA-256 computed by the server from the stored content. Omitted when the file could not be read.
string
Only present on failure to read the file:
file_not_found or read_failedcurl -X POST https://app.drime.cloud/api/v1/file-entries/485529678/verify-integrity \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"sha256": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
}'
const entryId = 485529678;
const response = await fetch(
`https://app.drime.cloud/api/v1/file-entries/${entryId}/verify-integrity`,
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
sha256: localFileHash // computed before upload
})
}
);
const { verified, serverHash } = await response.json();
if (!verified) {
console.error(`Integrity check failed, server has ${serverHash}`);
}
import hashlib
import requests
entry_id = 485529678
with open('/path/to/file.pdf', 'rb') as f:
local_hash = hashlib.sha256(f.read()).hexdigest()
response = requests.post(
f'https://app.drime.cloud/api/v1/file-entries/{entry_id}/verify-integrity',
headers={'Authorization': 'Bearer YOUR_ACCESS_TOKEN'},
json={'sha256': local_hash}
)
result = response.json()
print('OK' if result['verified'] else f"MISMATCH: server={result['serverHash']}")
{
"status": "success",
"verified": true,
"serverHash": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
}
{
"status": "success",
"verified": false,
"serverHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
}
{
"message": "This action is unauthorized."
}
For large files, computing the SHA-256 on the server means reading the whole object from storage.
Prefer calling this once after upload rather than on every sync pass; afterwards you can rely on
the
file_hash field returned by Get File Entry.