Skip to content

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

FieldTypeDescription
idstringUnique identifier for the artifact
keystringUser-defined key identifier for the artifact
typestringType of artifact ("json" or "file")
content_typestringMIME type of the artifact content
sizeintegerSize of the artifact content in bytes
metadataobjectOptional metadata associated with the artifact
created_atstringTimestamp when the artifact was created
updated_atstringTimestamp 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:

ParameterDescription
keyThe key identifier for the artifact (can include path segments)

Query Parameters:

ParameterRequiredDescription
metadataNoJSON string with metadata for the artifact

Request Body: JSON content to store as an artifact

Success Response:

  • Code: 200 OK
  • Content:
json
{
  "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"}

Upload File Artifact

Uploads a file as an artifact.

URL: /artifacts/file/{key}

Method: POST

URL Parameters:

ParameterDescription
keyThe key identifier for the artifact (can include path segments)

Query Parameters:

ParameterRequiredDescription
metadataNoJSON string with metadata for the artifact

Headers:

HeaderDescription
Content-TypeMIME type of the uploaded file

Request Body: Binary file content to store as an artifact

Success Response:

  • Code: 200 OK
  • Content:
json
{
  "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"}

Download Artifact

Downloads an artifact by its key.

URL: /artifacts/download/{key}

Method: GET

URL Parameters:

ParameterDescription
keyThe 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"}
  • Code: 400 Bad Request
    • Content: {"detail": "Error message"}

Get Artifact Metadata

Retrieves metadata for an artifact without downloading its content.

URL: /artifacts/metadata/{key}

Method: GET

URL Parameters:

ParameterDescription
keyThe key identifier for the artifact (can include path segments)

Success Response:

  • Code: 200 OK
  • Content:
json
{
  "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"}

List Artifacts

Retrieves a list of artifacts with optional filtering.

URL: /artifacts

Method: GET

Query Parameters:

ParameterRequiredDescription
typeNoFilter artifacts by type ("json" or "file")
limitNoMaximum number of artifacts to return
offsetNoNumber of artifacts to skip for pagination

Success Response:

  • Code: 200 OK
  • Content:
json
[
  {
    "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"}

Delete Artifact

Deletes an artifact by its key.

URL: /artifacts/{key}

Method: DELETE

URL Parameters:

ParameterDescription
keyThe key identifier for the artifact (can include path segments)

Success Response:

  • Code: 200 OK
  • Content:
json
{
  "message": "Artifact deleted successfully"
}

Error Responses:

  • Code: 404 Not Found
    • Content: {"detail": "Artifact with key {key} not found"}
    • Content: {"detail": "Artifact not found"}
  • Code: 400 Bad Request
    • Content: {"detail": "Error message"}