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

> ## Agent Instructions
> Start with /introduction/getting-started. Use the Direct Query API (POST /query) with the Newton Fusion model (text, image, and video reasoning) or the Newton Omega encoder (time-series embeddings). ATAI_API_ENDPOINT must include the version path: /v0.5 for most APIs, /v0.6 for the Fine-Tuning Service. Pages whose descriptions are marked (Archived) document the legacy Lens runtime — do not use them for new projects.

# Delete Blueprint

> Delete a blueprint by id or key

<Callout icon="clock" color="#3064E3" iconType="solid">
  Requires [version 1.1.9](/release-notes/1.1.x#v1-1-9) or later of the Archetype platform.
</Callout>

## Overview

This endpoint deletes a blueprint, addressed either by its `blp_` id or by its key.

A blueprint that is still pinned by a bundle cannot be deleted — delete the referencing bundles first.

## Request

<ParamField path="reference" type="string" required>
  Blueprint `blp_` id or key (e.g. `osm`).
</ParamField>

## Response

Returns `204 No Content` with an empty body on success.

<RequestExample>
  ```bash cURL theme={"system"}
  curl -X DELETE "$ATAI_API_URL/agents/blueprints/blp_01jc9n7k3xf8mbq2v5t0ary6de" \
    -H "Authorization: Bearer $ATAI_API_KEY"
  ```

  ```python Python theme={"system"}
  import os
  import requests

  base_url = os.environ["ATAI_API_URL"]
  api_key = os.environ["ATAI_API_KEY"]

  response = requests.delete(
      f"{base_url}/agents/blueprints/blp_01jc9n7k3xf8mbq2v5t0ary6de",
      headers={"Authorization": f"Bearer {api_key}"},
  )

  if response.status_code == 204:
      print("Blueprint deleted")
  else:
      print(f"Error: {response.json()['errors']}")
  ```

  ```javascript JavaScript theme={"system"}
  const response = await fetch(
    `${process.env.ATAI_API_URL}/agents/blueprints/blp_01jc9n7k3xf8mbq2v5t0ary6de`,
    {
      method: 'DELETE',
      headers: {
        'Authorization': `Bearer ${process.env.ATAI_API_KEY}`
      }
    }
  );

  if (response.status === 204) {
    console.log('Blueprint deleted');
  } else {
    const body = await response.json();
    console.error('Error:', body.errors);
  }
  ```
</RequestExample>

<ResponseExample>
  ```json 204 - Blueprint deleted theme={"system"}
  ```

  ```json 400 - Invalid reference theme={"system"}
  {
    "errors": [
      {
        "code": "<error_code>",
        "message": "Invalid reference.",
        "suggestion": null,
        "error_uid": "err-xxxxxxxx"
      }
    ]
  }
  ```

  ```json 403 - Admin role required theme={"system"}
  {
    "errors": [
      {
        "code": "<error_code>",
        "message": "Admin role required (super-admin required for canonical blueprints).",
        "suggestion": null,
        "error_uid": "err-xxxxxxxx"
      }
    ]
  }
  ```

  ```json 404 - Blueprint not found theme={"system"}
  {
    "errors": [
      {
        "code": "<error_code>",
        "message": "Blueprint not found.",
        "suggestion": null,
        "error_uid": "err-xxxxxxxx"
      }
    ]
  }
  ```

  ```json 409 - Still referenced by a bundle theme={"system"}
  {
    "errors": [
      {
        "code": "<error_code>",
        "message": "Blueprint is still referenced by a bundle.",
        "suggestion": null,
        "error_uid": "err-xxxxxxxx"
      }
    ]
  }
  ```
</ResponseExample>

## Important Notes

<Note>
  * Deleting a blueprint requires the admin role; deleting a canonical blueprint requires super-admin.
  * A `409` means at least one bundle still pins this blueprint. Delete those bundles first.
  * Success returns `204` with no body — check the status code rather than parsing a response.
</Note>
