Upload an Artifact
Uploads a single file to the specified dock. The file is stored with content-addressable deduplication — if a file with the same SHA-256 hash already exists, no additional storage is consumed.
POST /v1/docks/:dockId/artifacts/upload
Path Parameters
| Parameter | Type | Description |
|---|
dockId | string | The dock ID |
Request Body
Multipart form data with a single file field.
| Field | Type | Required | Description |
|---|
file | file | Required | The file to upload |
Example Request
curl -X POST https://api.docyard.io/v1/docks/dock_01HQ3K.../artifacts/upload \
-H "Authorization: Bearer dk_live_a1b2c3d4..." \
-F "[email protected]"
Response
{
"id": "art_01HQ3M...",
"filename": "declaration-page-2025.pdf",
"contentType": "application/pdf",
"size": 245760,
"hash": "sha256:a3f8c2d1e4b5a6f7...",
"checksum": "a3f8c2d1e4b5a6f7...",
"storageKey": "docks/dock_01HQ3K.../artifacts/f7a2b3c4.pdf",
"isDuplicate": false,
"metadata": {},
"createdAt": "2025-01-15T10:31:00.000Z"
}
Response Fields
| Field | Type | Description |
|---|
id | string | Unique artifact ID |
filename | string | Original filename |
contentType | string | MIME type detected from file content |
size | integer | File size in bytes |
hash | string | SHA-256 content hash prefixed with sha256: |
isDuplicate | boolean | true if the file already existed in this dock |
storageKey | string | Internal storage path |
createdAt | string | ISO 8601 timestamp |
Error Handling
| Status | Condition |
|---|
400 | No file provided in the request |
401 | Missing or invalid API key |
404 | Dock not found |
When isDuplicate is true, the response returns the existing artifact’s ID and metadata. No new storage is consumed. The original createdAt timestamp is preserved.