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

# Blueprint API guidance

> Workflow guidance for the generated Blueprint API endpoints.

The generated API Reference includes every supported Blueprint endpoint. This page ties those endpoints into the usual validate, save, run, and bake workflow.

## Validate before saving

`POST /api/app/blueprints/validate` checks a recipe without saving it. When no `blueprintId` is supplied, both ordinary validation and `adapt: true` requests are unauthenticated; adaptation returns a compatible source plus its changes.

Supplying `blueprintId` requires a bearer token because the server must inspect a saved Blueprint, including its attached bundle when applicable. Treat public adaptation as a preview tool and authenticate requests that operate on saved resources.

## Save or import a recipe

Use `POST /api/app/blueprints` to save JSON `source`; `sourceJson` remains a legacy alias. A saved Blueprint records its compatibility findings and increments its revision when you replace source with `PATCH /api/app/blueprints/:id`.

`POST /api/app/blueprints/import` fetches a JSON recipe from a URL without saving it. For a ZIP bundle, use `POST /api/app/blueprints/upload`; upload one archive containing exactly one `blueprint.json` at its root or in one top-level directory.

## Run or bake

| Goal                              | Endpoint                             | What to poll                               |
| --------------------------------- | ------------------------------------ | ------------------------------------------ |
| Create a sandbox from a recipe    | `POST /api/app/blueprints/:id/sites` | The returned run and Site.                 |
| Apply a recipe to a ready sandbox | `POST /api/app/sites/:id/blueprint`  | `GET /api/app/blueprints/:id/runs/:runId`. |
| Create or rebake a Template       | `POST /api/app/blueprints/:id/bake`  | The returned run and Template.             |

All run-starting requests are asynchronous. A run reaches `succeeded` or `failed`; use its step details and log to diagnose a failed recipe.

Pass an existing Blueprint-backed `templateId` to the bake endpoint to rebake it in place, keeping its slug and public launch URL stable.

For Blueprint concepts and source bundles, see [Blueprints](/guides/blueprints).
