# Delete an artifact Explicitly delete a local artifact when it is no longer referenced by a retained run. `DELETE /v1/artifacts/{artifact_id}` ## Remove an input you no longer need Delete retained runs that reference this artifact, then send DELETE with an idempotency key. ## What to do next A conflict can mean a retained run still references the artifact. [Read the step-by-step guide →](https://www.security.run/docs/chain-tools.html) Send an `Idempotency-Key`. Keep the same key and body when retrying this operation. ### Parameters #### `artifact_id` · `path · string` · required #### `authorization` · `header · string | null` · required #### `idempotency-key` · `header · string | null` · required ### Responses - `200` Successful Response - `422` Validation Error ## Request ```bash curl -X DELETE "$SECURITY_RUN_URL/v1/artifacts/artifact_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \ -H "Authorization: Bearer $SECURITY_RUN_API_KEY" \ -H "Idempotency-Key: unique-request-key" ``` ## Request ```python import os, httpx headers = {'Idempotency-Key': 'unique-request-key'} headers["Authorization"] = "Bearer " + os.environ["SECURITY_RUN_API_KEY"] response = httpx.request('DELETE', os.environ["SECURITY_RUN_URL"].rstrip("/") + '/v1/artifacts/artifact_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', headers=headers) response.raise_for_status() print(response.text) ``` ## Request ```javascript const base = process.env.SECURITY_RUN_URL.replace(/\/$/, ""); const headers = { "Idempotency-Key": "unique-request-key" }; headers.Authorization = `Bearer ${process.env.SECURITY_RUN_API_KEY}`; const response = await fetch(base + "/v1/artifacts/artifact_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", { method: "DELETE", headers }); if (!response.ok) throw new Error(`HTTP ${response.status}`); console.log(await response.text()); ```