> ## Documentation Index
> Fetch the complete documentation index at: https://genui.sh/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete Artifact

Delete an artifact. This is a soft delete - the artifact is marked as deleted but can be restored within 30 days.

## Request

<ParamField path="id" type="string" required>
  The artifact ID to delete
</ParamField>

<ParamField query="permanent" type="boolean">
  Set to `true` for permanent deletion (cannot be undone)
</ParamField>

## Response

<ResponseExample>
  ```json 200 theme={null}
  {
    "id": "art_abc123",
    "status": "deleted",
    "deletedAt": "2024-01-16T14:30:00Z"
  }
  ```

  ```json 404 theme={null}
  {
    "error": {
      "code": "not_found",
      "message": "Artifact not found"
    }
  }
  ```
</ResponseExample>

## Code Examples

<CodeGroup>
  ```bash curl theme={null}
  curl -X DELETE https://genui.sh/api/artifacts/art_abc123 \
    -H "Authorization: Bearer $GENUI_API_KEY"
  ```

  ```python Python theme={null}
  import requests
  import os

  artifact_id = "art_abc123"
  response = requests.delete(
      f"https://genui.sh/api/artifacts/{artifact_id}",
      headers={"Authorization": f"Bearer {os.environ['GENUI_API_KEY']}"}
  )
  if response.status_code == 200:
      print(f"Deleted artifact: {artifact_id}")
  ```

  ```javascript JavaScript theme={null}
  const artifactId = 'art_abc123';
  const response = await fetch(`https://genui.sh/api/artifacts/${artifactId}`, {
    method: 'DELETE',
    headers: {
      'Authorization': `Bearer ${process.env.GENUI_API_KEY}`
    }
  });
  if (response.ok) {
    console.log(`Deleted artifact: ${artifactId}`);
  }
  ```

  ```go Go theme={null}
  artifactID := "art_abc123"
  req, _ := http.NewRequest("DELETE", "https://genui.sh/api/artifacts/"+artifactID, nil)
  req.Header.Set("Authorization", "Bearer "+os.Getenv("GENUI_API_KEY"))

  client := &http.Client{}
  resp, _ := client.Do(req)
  if resp.StatusCode == 200 {
      fmt.Printf("Deleted artifact: %s\n", artifactID)
  }
  ```

  ```ruby Ruby theme={null}
  artifact_id = 'art_abc123'
  uri = URI("https://genui.sh/api/artifacts/#{artifact_id}")

  request = Net::HTTP::Delete.new(uri)
  request['Authorization'] = "Bearer #{ENV['GENUI_API_KEY']}"

  response = http.request(request)
  puts "Deleted artifact: #{artifact_id}" if response.code == '200'
  ```

  ```rust Rust theme={null}
  let artifact_id = "art_abc123";
  let response = client
      .delete(format!("https://genui.sh/api/artifacts/{}", artifact_id))
      .header("Authorization", format!("Bearer {}", api_key))
      .send()
      .await?;

  if response.status().is_success() {
      println!("Deleted artifact: {}", artifact_id);
  }
  ```

  ```csharp .NET theme={null}
  var artifactId = "art_abc123";
  var response = await client.DeleteAsync($"https://genui.sh/api/artifacts/{artifactId}");
  if (response.IsSuccessStatusCode)
  {
      Console.WriteLine($"Deleted artifact: {artifactId}");
  }
  ```
</CodeGroup>

## Permanent Deletion

To permanently delete an artifact without the ability to restore:

```bash theme={null}
curl -X DELETE "https://genui.sh/api/artifacts/art_abc123?permanent=true" \
  -H "Authorization: Bearer $GENUI_API_KEY"
```

<Warning>
  Permanent deletion cannot be undone. The artifact and all associated data will be immediately removed.
</Warning>
