Files
Files are PDF documents uploaded to DokStamp before being attached to certificates or documents. Each file can only be used by one certificate — once attached, it is marked as used and cannot be reused.
The file object
{
"uuid": "h8i9j0k1-l2m3-4567-nopq-678901234567",
"original_name": "diploma-maria-silva.pdf",
"mime_type": "application/pdf",
"extension": "pdf",
"size": 245760,
"used_at": null,
"file": "https://storage.dokstamp.eu/files/h8i9j0k1.pdf"
}
| Field | Type | Description |
|---|
uuid | string | Unique identifier — use as file_uuid when creating certificates |
original_name | string | Original filename |
mime_type | string | MIME type (e.g., application/pdf) |
extension | string | File extension |
size | integer | File size in bytes |
used_at | datetime|null | Null = available. Non-null = already attached to a certificate. |
file | string | Direct download URL |
Upload files
Accepts multipart/form-data. You can upload multiple files in a single request.
| Parameter | Type | Required | Description |
|---|
files[] | file | Yes | One or more PDF files |
# Upload a single file
curl -X POST https://api.dokstamp.eu/files \
-H "Authorization: Bearer {TOKEN}" \
-H "Accept: application/json" \
-H "X-Tenant: {TENANT}" \
-F "files[]=@/path/to/diploma-maria-silva.pdf"
# Upload multiple files at once
curl -X POST https://api.dokstamp.eu/files \
-H "Authorization: Bearer {TOKEN}" \
-H "Accept: application/json" \
-H "X-Tenant: {TENANT}" \
-F "files[]=@diploma-1.pdf" \
-F "files[]=@diploma-2.pdf" \
-F "files[]=@diploma-3.pdf"
Response 201:
{
"data": [
{
"uuid": "h8i9j0k1-l2m3-4567-nopq-678901234567",
"original_name": "diploma-maria-silva.pdf",
"mime_type": "application/pdf",
"size": 245760,
"used_at": null
}
]
}
List files
Filter for unused files (available to attach to new certificates):
GET /files?where[used_at]=null
Download a file
GET /files/{uuid}/download
This endpoint is public — no Authorization header required. Share this URL directly with signers, students, or employers.
curl "https://api.dokstamp.eu/files/h8i9j0k1-l2m3-4567-nopq-678901234567/download" \
--output diploma.pdf
PATCH /files/{uuid}
PUT /files/{uuid}
Delete a file
You cannot delete a file that is already attached to a certificate (used_at is not null). Delete or revoke the certificate first.
Deduplication
The API computes a hash for each uploaded file. If you upload the same file content twice, the second upload returns the existing file record instead of creating a duplicate. This prevents storage bloat in batch upload workflows.