Is there a way to delete artifacts from a specific...
# ask-community
s
Is there a way to delete artifacts from a specific task run? I am seeing a
delete_artifact
method here: https://docs.prefect.io/api/latest/artifacts/artifacts.html#functions but it is not clear to me how I would obtain the
task_run_artifact_id
to use it?
m
Hello Soren! The easiest way to retrieve task_run_artifact_id is from interactive API in UI. You can use a query like this:
Copy code
query {
  task_run_artifact {
    id
    kind
    created
    data
  }
}
Also I believe you can use client, which will be similar to this:
Copy code
from prefect import Client

query = """
query {
  task_run_artifact {
    id
  }
}
"""

client = Client()
result = client.graphql(query)
👍 1
upvote 1