# Build and install a blueprint

import { Steps } from "@astrojs/starlight/components"
import Prereqs from "@docs/Prereqs.astro"
import UiWalkthrough from "@docs/UiWalkthrough.astro"
import ClientTabs from "@docs/ClientTabs.astro"

A blueprint is a portable deployment package: a snapshot of projects, agents, skills, MCPs, and cron triggers that can be installed into any pod. Build one from your existing resources, then install it from the registry to recreate that setup in a new environment.

<Prereqs>
  - A Ren account with at least one project, agent, or skill you want to package - A personal access token for the API
  and TypeScript calls
</Prereqs>

## How blueprints work

A blueprint template contains:

- **Projects**: names, descriptions, permissions, and agent assignments
- **Agents**: references (or forks) with their skill and MCP dependencies
- **Skills**: references (or forks) with version pins
- **MCPs**: references (or forks)
- **Cron triggers**: schedules, prompts, and timezones (installed disabled by default)

When you install, Ren resolves each resource: if you can reference the original (same org or public), it links; otherwise it forks a copy into your pod. See [Blueprints](/docs/deep-dives/concepts/sharing/blueprints/) for the full concept.

## In the UI

<UiWalkthrough>
  {/* TODO(demo): screen recording – creating a blueprint and installing one from the registry, ~12s loop */}
</UiWalkthrough>

<Steps>

1. Open **Blueprints** in the sidebar and click **New blueprint**.

2. Select the projects, agents, skills, and MCPs to include.

3. Click **Create**. The blueprint is saved as a draft.

4. To share it, click **Publish to registry**.

5. To install, browse the registry, pick a blueprint, and click **Install**.

</Steps>

## Programmatically

<ClientTabs clients={["api", "typescript"]}>

<Fragment slot="api">
  **Create a blueprint**

```bash
curl -X POST https://api.renai.build/api/blueprints \
  -H "Authorization: Bearer $REN_PAT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Customer support",
    "description": "Support agent with knowledge base",
    "selection": {
      "projectIds": ["prj_def456"],
      "agentIds": ["agt_abc123"],
      "skillIds": ["skl_abc123"]
    }
  }'
```

**Publish a blueprint**

```bash
curl -X POST "https://api.renai.build/api/blueprints/blt_abc123/publish" \
  -H "Authorization: Bearer $REN_PAT_TOKEN"
```

**Install a blueprint** into a pod. `source` is the blueprint's id or slug:

```bash
curl -X POST "https://api.renai.build/api/blueprints/install" \
  -H "Authorization: Bearer $REN_PAT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "source": "blt_abc123", "podId": "pod_abc123" }'
```

</Fragment>

<Fragment slot="typescript">
  ```ts
  import { createRenClient, pat } from "@renai-labs/sdk"

const client = createRenClient({
baseUrl: "https://api.renai.build",
auth: pat(process.env.REN_PAT_TOKEN!),
})

// Create a blueprint
const { data: blueprint, error } = await client.blueprint.create({
body: {
name: "Customer support",
description: "Support agent with knowledge base",
selection: {
projectIds: ["prj_def456"],
agentIds: ["agt_abc123"],
skillIds: ["skl_abc123"],
},
},
})
if (error) throw error
console.log(blueprint.id) // "blt_abc123"

// Publish it to the registry
await client.blueprint.publish({ path: { id: blueprint.id } })

// Install it into a pod
await client.blueprint.install({
body: { source: blueprint.id, podId: "pod_abc123" },
})

```
</Fragment>

</ClientTabs>
```