curl -X POST https://app.drime.cloud/api/v1/file-entries/hash/check \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"fileHash": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
"workspaceId": 0
}'
// Compute SHA-256 of a File in the browser
const buffer = await file.arrayBuffer();
const digest = await crypto.subtle.digest('SHA-256', buffer);
const fileHash = [...new Uint8Array(digest)]
.map(b => b.toString(16).padStart(2, '0'))
.join('');
const response = await fetch(
'https://app.drime.cloud/api/v1/file-entries/hash/check',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({ fileHash, workspaceId: 0 })
}
);
const { exists, entry } = await response.json();
if (exists) {
console.log(`Already uploaded as entry ${entry.id}, skipping upload`);
}
import hashlib
import requests
with open('/path/to/file.pdf', 'rb') as f:
file_hash = hashlib.sha256(f.read()).hexdigest()
response = requests.post(
'https://app.drime.cloud/api/v1/file-entries/hash/check',
headers={'Authorization': 'Bearer YOUR_ACCESS_TOKEN'},
json={'fileHash': file_hash, 'workspaceId': 0}
)
data = response.json()
if data['exists']:
print(f"Already uploaded as entry {data['entry']['id']}")
{
"status": "success",
"exists": true,
"entry": {
"id": 485529678,
"name": "document.pdf",
"type": "pdf",
"file_size": 1048576,
"file_hash": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
"workspace_id": 0
}
}
{
"status": "success",
"exists": false
}
Files & Folders
Check File Hash
Check whether a file with a given content hash already exists (deduplication)
POST
/
file-entries
/
hash
/
check
curl -X POST https://app.drime.cloud/api/v1/file-entries/hash/check \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"fileHash": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
"workspaceId": 0
}'
// Compute SHA-256 of a File in the browser
const buffer = await file.arrayBuffer();
const digest = await crypto.subtle.digest('SHA-256', buffer);
const fileHash = [...new Uint8Array(digest)]
.map(b => b.toString(16).padStart(2, '0'))
.join('');
const response = await fetch(
'https://app.drime.cloud/api/v1/file-entries/hash/check',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({ fileHash, workspaceId: 0 })
}
);
const { exists, entry } = await response.json();
if (exists) {
console.log(`Already uploaded as entry ${entry.id}, skipping upload`);
}
import hashlib
import requests
with open('/path/to/file.pdf', 'rb') as f:
file_hash = hashlib.sha256(f.read()).hexdigest()
response = requests.post(
'https://app.drime.cloud/api/v1/file-entries/hash/check',
headers={'Authorization': 'Bearer YOUR_ACCESS_TOKEN'},
json={'fileHash': file_hash, 'workspaceId': 0}
)
data = response.json()
if data['exists']:
print(f"Already uploaded as entry {data['entry']['id']}")
{
"status": "success",
"exists": true,
"entry": {
"id": 485529678,
"name": "document.pdf",
"type": "pdf",
"file_size": 1048576,
"file_hash": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
"workspace_id": 0
}
}
{
"status": "success",
"exists": false
}
Overview
Checks whether the authenticated user already owns a file with the given content hash in a workspace. Use this before uploading to implement instant uploads / deduplication: if the content already exists, you can skip the upload entirely and reuse the existing entry.Drime stores a SHA-256 hex digest of the file content in the
file_hash field. The official
clients compute it at upload time and send it as fileHash, so the lookup only matches files
uploaded with a hash.Request Body
string
required
SHA-256 hex digest of the file content (64 lowercase hex characters)
integer
Workspace to search in. Defaults to
0 (personal space).Response
string
Request status (
success)boolean
Whether a file with this content hash already exists for the current user in the workspace
object
The matching file entry object. Only present when
exists is true.curl -X POST https://app.drime.cloud/api/v1/file-entries/hash/check \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"fileHash": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
"workspaceId": 0
}'
// Compute SHA-256 of a File in the browser
const buffer = await file.arrayBuffer();
const digest = await crypto.subtle.digest('SHA-256', buffer);
const fileHash = [...new Uint8Array(digest)]
.map(b => b.toString(16).padStart(2, '0'))
.join('');
const response = await fetch(
'https://app.drime.cloud/api/v1/file-entries/hash/check',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({ fileHash, workspaceId: 0 })
}
);
const { exists, entry } = await response.json();
if (exists) {
console.log(`Already uploaded as entry ${entry.id}, skipping upload`);
}
import hashlib
import requests
with open('/path/to/file.pdf', 'rb') as f:
file_hash = hashlib.sha256(f.read()).hexdigest()
response = requests.post(
'https://app.drime.cloud/api/v1/file-entries/hash/check',
headers={'Authorization': 'Bearer YOUR_ACCESS_TOKEN'},
json={'fileHash': file_hash, 'workspaceId': 0}
)
data = response.json()
if data['exists']:
print(f"Already uploaded as entry {data['entry']['id']}")
{
"status": "success",
"exists": true,
"entry": {
"id": 485529678,
"name": "document.pdf",
"type": "pdf",
"file_size": 1048576,
"file_hash": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
"workspace_id": 0
}
}
{
"status": "success",
"exists": false
}