Artifacts API
The Artifacts API allows you to store, retrieve, and manage data artifacts from your workflows on the Lumea platform.
Overview
Artifacts are data objects or files that are produced or used by workflows. They can be used to store results, model files, or any other data that needs to be persisted across workflow runs. This API enables you to programmatically manage artifacts, including uploading, downloading, and retrieving metadata.
Note: Each customer receives a custom deployment with a unique API endpoint. The endpoints described in this documentation should be prefixed with your organization's specific API URL provided during onboarding.
Data Models
Artifact Object
Field | Type | Description |
---|---|---|
id | string | Unique identifier for the artifact |
key | string | User-defined key identifier for the artifact |
type | string | Type of artifact ("json" or "file") |
content_type | string | MIME type of the artifact content |
size | integer | Size of the artifact content in bytes |
metadata | object | Optional metadata associated with the artifact |
created_at | string | Timestamp when the artifact was created |
updated_at | string | Timestamp when the artifact was last updated |
Endpoints
Create JSON Artifact
Creates a new artifact from JSON data.
URL: /artifacts/json/{key}
Method: POST
URL Parameters:
Parameter | Description |
---|---|
key | The key identifier for the artifact (can include path segments) |
Query Parameters:
Parameter | Required | Description |
---|---|---|
metadata | No | JSON string with metadata for the artifact |
Request Body: JSON content to store as an artifact
Success Response:
- Code: 200 OK
- Content:
{
"id": "artifact123",
"key": "results/evaluation/metrics",
"type": "json",
"content_type": "application/json",
"size": 256,
"metadata": {
"source": "model-evaluation",
"version": "1.0"
},
"created_at": "2023-06-01T12:00:00Z",
"updated_at": "2023-06-01T12:00:00Z"
}
Error Responses:
- Code: 400 Bad Request
- Content:
{"detail": "Invalid JSON content"}
- Content:
{"detail": "Error message"}
- Content:
Upload File Artifact
Uploads a file as an artifact.
URL: /artifacts/file/{key}
Method: POST
URL Parameters:
Parameter | Description |
---|---|
key | The key identifier for the artifact (can include path segments) |
Query Parameters:
Parameter | Required | Description |
---|---|---|
metadata | No | JSON string with metadata for the artifact |
Headers:
Header | Description |
---|---|
Content-Type | MIME type of the uploaded file |
Request Body: Binary file content to store as an artifact
Success Response:
- Code: 200 OK
- Content:
{
"id": "artifact456",
"key": "models/classifier/weights.h5",
"type": "file",
"content_type": "application/octet-stream",
"size": 1048576,
"metadata": {
"model_version": "1.2.0",
"accuracy": 0.95
},
"created_at": "2023-06-01T14:00:00Z",
"updated_at": "2023-06-01T14:00:00Z"
}
Error Responses:
- Code: 400 Bad Request
- Content:
{"detail": "Invalid metadata JSON"}
- Content:
{"detail": "Error message"}
- Content:
Download Artifact
Downloads an artifact by its key.
URL: /artifacts/download/{key}
Method: GET
URL Parameters:
Parameter | Description |
---|---|
key | The key identifier for the artifact (can include path segments) |
Success Response:
- Code: 200 OK
- Content:
- For JSON artifacts: JSON content
- For file artifacts: Binary file content with appropriate Content-Type and Content-Disposition headers
Error Responses:
- Code: 404 Not Found
- Content:
{"detail": "Artifact with key {key} not found"}
- Content:
- Code: 400 Bad Request
- Content:
{"detail": "Error message"}
- Content:
Get Artifact Metadata
Retrieves metadata for an artifact without downloading its content.
URL: /artifacts/metadata/{key}
Method: GET
URL Parameters:
Parameter | Description |
---|---|
key | The key identifier for the artifact (can include path segments) |
Success Response:
- Code: 200 OK
- Content:
{
"id": "artifact123",
"key": "results/evaluation/metrics",
"type": "json",
"content_type": "application/json",
"size": 256,
"metadata": {
"source": "model-evaluation",
"version": "1.0"
},
"created_at": "2023-06-01T12:00:00Z",
"updated_at": "2023-06-01T12:00:00Z"
}
Error Response:
- Code: 404 Not Found
- Content:
{"detail": "Artifact with key {key} not found"}
- Content:
List Artifacts
Retrieves a list of artifacts with optional filtering.
URL: /artifacts
Method: GET
Query Parameters:
Parameter | Required | Description |
---|---|---|
type | No | Filter artifacts by type ("json" or "file") |
limit | No | Maximum number of artifacts to return |
offset | No | Number of artifacts to skip for pagination |
Success Response:
- Code: 200 OK
- Content:
[
{
"id": "artifact123",
"key": "results/evaluation/metrics",
"type": "json",
"content_type": "application/json",
"size": 256,
"metadata": {
"source": "model-evaluation",
"version": "1.0"
},
"created_at": "2023-06-01T12:00:00Z",
"updated_at": "2023-06-01T12:00:00Z"
},
{
"id": "artifact456",
"key": "models/classifier/weights.h5",
"type": "file",
"content_type": "application/octet-stream",
"size": 1048576,
"metadata": {
"model_version": "1.2.0",
"accuracy": 0.95
},
"created_at": "2023-06-01T14:00:00Z",
"updated_at": "2023-06-01T14:00:00Z"
}
]
Error Response:
- Code: 400 Bad Request
- Content:
{"detail": "Error message"}
- Content:
Delete Artifact
Deletes an artifact by its key.
URL: /artifacts/{key}
Method: DELETE
URL Parameters:
Parameter | Description |
---|---|
key | The key identifier for the artifact (can include path segments) |
Success Response:
- Code: 200 OK
- Content:
{
"message": "Artifact deleted successfully"
}
Error Responses:
- Code: 404 Not Found
- Content:
{"detail": "Artifact with key {key} not found"}
- Content:
{"detail": "Artifact not found"}
- Content:
- Code: 400 Bad Request
- Content:
{"detail": "Error message"}
- Content: