Skip to main content
POST
/
api
/
artifacts
/
latest
/
filter
Read Latest Artifacts
curl --request POST \
  --url https://api.example.com/api/artifacts/latest/filter \
  --header 'Content-Type: application/json' \
  --data '
{
  "sort": "ID_DESC",
  "offset": 0,
  "artifacts": {
    "operator": "and_",
    "latest_id": {
      "any_": [
        "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      ]
    },
    "key": {
      "any_": [
        "<string>"
      ],
      "like_": "my-artifact-%",
      "exists_": true
    },
    "flow_run_id": {
      "any_": [
        "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      ]
    },
    "task_run_id": {
      "any_": [
        "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      ]
    },
    "type": {
      "any_": [
        "<string>"
      ],
      "not_any_": [
        "<string>"
      ]
    }
  },
  "flow_runs": {
    "operator": "and_",
    "id": {
      "any_": [
        "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      ],
      "not_any_": [
        "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      ]
    },
    "name": {
      "any_": [
        "my-flow-run-1",
        "my-flow-run-2"
      ],
      "like_": "marvin"
    },
    "tags": {
      "operator": "and_",
      "all_": [
        "tag-1",
        "tag-2"
      ],
      "any_": [
        "tag-1",
        "tag-2"
      ],
      "is_null_": true
    },
    "deployment_id": {
      "operator": "and_",
      "any_": [
        "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      ],
      "is_null_": true
    },
    "work_queue_name": {
      "operator": "and_",
      "any_": [
        "work_queue_1",
        "work_queue_2"
      ],
      "is_null_": true
    },
    "state": {
      "operator": "and_",
      "type": {
        "any_": [
          "SCHEDULED"
        ],
        "not_any_": [
          "SCHEDULED"
        ]
      },
      "name": {
        "any_": [
          "<string>"
        ],
        "not_any_": [
          "<string>"
        ]
      }
    },
    "flow_version": {
      "any_": [
        "<string>"
      ]
    },
    "start_time": {
      "before_": "2023-11-07T05:31:56Z",
      "after_": "2023-11-07T05:31:56Z",
      "is_null_": true
    },
    "end_time": {
      "before_": "2023-11-07T05:31:56Z",
      "after_": "2023-11-07T05:31:56Z",
      "is_null_": true
    },
    "expected_start_time": {
      "before_": "2023-11-07T05:31:56Z",
      "after_": "2023-11-07T05:31:56Z"
    },
    "next_scheduled_start_time": {
      "before_": "2023-11-07T05:31:56Z",
      "after_": "2023-11-07T05:31:56Z"
    },
    "parent_flow_run_id": {
      "operator": "and_",
      "any_": [
        "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      ]
    },
    "parent_task_run_id": {
      "operator": "and_",
      "any_": [
        "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      ],
      "is_null_": true
    },
    "idempotency_key": {
      "any_": [
        "<string>"
      ],
      "not_any_": [
        "<string>"
      ]
    }
  },
  "task_runs": {
    "operator": "and_",
    "id": {
      "any_": [
        "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      ]
    },
    "name": {
      "any_": [
        "my-task-run-1",
        "my-task-run-2"
      ],
      "like_": "marvin"
    },
    "tags": {
      "operator": "and_",
      "all_": [
        "tag-1",
        "tag-2"
      ],
      "is_null_": true
    },
    "state": {
      "operator": "and_",
      "type": {
        "any_": [
          "SCHEDULED"
        ]
      },
      "name": {
        "any_": [
          "<string>"
        ]
      }
    },
    "start_time": {
      "before_": "2023-11-07T05:31:56Z",
      "after_": "2023-11-07T05:31:56Z",
      "is_null_": true
    },
    "expected_start_time": {
      "before_": "2023-11-07T05:31:56Z",
      "after_": "2023-11-07T05:31:56Z"
    },
    "subflow_runs": {
      "exists_": true
    },
    "flow_run_id": {
      "operator": "and_",
      "any_": [
        "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      ],
      "is_null_": false
    }
  },
  "flows": {
    "operator": "and_",
    "id": {
      "any_": [
        "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      ]
    },
    "deployment": {
      "operator": "and_",
      "is_null_": true
    },
    "name": {
      "any_": [
        "my-flow-1",
        "my-flow-2"
      ],
      "like_": "marvin"
    },
    "tags": {
      "operator": "and_",
      "all_": [
        "tag-1",
        "tag-2"
      ],
      "is_null_": true
    }
  },
  "deployments": {
    "operator": "and_",
    "id": {
      "any_": [
        "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      ],
      "not_any_": [
        "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      ]
    },
    "name": {
      "any_": [
        "my-deployment-1",
        "my-deployment-2"
      ],
      "like_": "marvin"
    },
    "flow_or_deployment_name": {
      "like_": "<string>"
    },
    "paused": {
      "eq_": true
    },
    "tags": {
      "operator": "and_",
      "all_": [
        "tag-1",
        "tag-2"
      ],
      "any_": [
        "tag-1",
        "tag-2"
      ],
      "is_null_": true
    },
    "work_queue_name": {
      "any_": [
        "work_queue_1",
        "work_queue_2"
      ]
    },
    "concurrency_limit": {
      "ge_": 123,
      "le_": 123,
      "is_null_": true
    }
  },
  "limit": 123
}
'
[
  {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "created": "2023-11-07T05:31:56Z",
    "updated": "2023-11-07T05:31:56Z",
    "key": "<string>",
    "latest_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "type": "<string>",
    "description": "<string>",
    "data": {},
    "metadata_": {},
    "flow_run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "task_run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
  }
]

Headers

x-prefect-api-version
string

Body

application/json
sort
enum<string>
default:ID_DESC

Defines artifact collection sorting options.

Available options:
CREATED_DESC,
UPDATED_DESC,
ID_DESC,
KEY_DESC,
KEY_ASC
offset
integer
default:0
Required range: x >= 0
artifacts
ArtifactCollectionFilter · object

Filter artifact collections. Only artifact collections matching all criteria will be returned

flow_runs
FlowRunFilter · object

Filter flow runs. Only flow runs matching all criteria will be returned

task_runs
TaskRunFilter · object

Filter task runs. Only task runs matching all criteria will be returned

flows
FlowFilter · object

Filter for flows. Only flows matching all criteria will be returned.

deployments
DeploymentFilter · object

Filter for deployments. Only deployments matching all criteria will be returned.

limit
integer

Defaults to PREFECT_API_DEFAULT_LIMIT if not provided.

Response

Successful Response

id
string<uuid>
required
created
string<date-time> | null
required
updated
string<date-time> | null
required
key
string
required

An optional unique reference key for this artifact.

latest_id
string<uuid>
required

The latest artifact ID associated with the key.

type
string | null

An identifier that describes the shape of the data field. e.g. 'result', 'table', 'markdown'

description
string | null

A markdown-enabled description of the artifact.

data

Data associated with the artifact, e.g. a result.; structure depends on the artifact type.

metadata_
Metadata · object

User-defined artifact metadata. Content must be string key and value pairs.

flow_run_id
string<uuid> | null

The flow run associated with the artifact.

task_run_id
string<uuid> | null

The task run associated with the artifact.