Create Artifact (Machine Auth)
Creates a new artifact using machine authentication. This endpoint is designed for automated systems to upload documents via OAuth2 client credentials.Authentication
Required: Bearer token from OAuth2 token endpointartifacts:write
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
dockId | string | Required | Target dock ID (must match machine client’s dock scope) |
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
filename | string | Required | Original filename with extension |
contentType | string | Optional | MIME type (auto-detected if not provided) |
size | integer | Optional | File size in bytes (for validation) |
metadata | object | Optional | Custom JSON metadata |
hash | string | Optional | Pre-computed SHA-256 hash for deduplication |
Example Request
- Healthcare (EHR)
- Financial Services
- Real Estate
Response
Response Fields
| Field | Type | Description |
|---|---|---|
id | string | Unique artifact identifier (prefix: art_) |
dockId | string | Owning dock |
filename | string | Original filename |
contentType | string | MIME type |
size | integer | File size in bytes |
hash | string | SHA-256 hash for integrity verification |
storageKey | string | Internal storage location |
metadata | object | Custom JSON attributes |
isDuplicate | boolean | Whether this was a duplicate upload |
createdAt | string | ISO 8601 timestamp |
updatedAt | string | ISO 8601 timestamp |
uploadUrl | string | Presigned URL for direct S3 upload |
uploadId | string | Upload job ID for tracking |
Deduplication
If you upload content with the same SHA-256 hash, the existing artifact is returned withisDuplicate: true:
Upload Process
The response includes a presigned S3 URL for direct file upload:Error Handling
| Status | Condition |
|---|---|
400 | Invalid request body or missing required fields |
401 | Missing, invalid, or expired token |
403 | Insufficient scope (need artifacts:write) |
403 | Dock access denied (client scoped to different dock) |
404 | Dock not found |
409 | File size exceeds limit |
Best Practices
Metadata: Include identifiers that help recipients route and process documents:- Healthcare: Patient ID, MRN, encounter ID, document type
- Financial: Loan ID, borrower name, closing date
- Real Estate: Order ID, property address, parties involved
Related Endpoints
- List Artifacts (Machine) — List artifacts via machine auth
- Issue Token — Get access token
- Standard Artifacts API — User-driven artifact creation