# Get a factory agent

> Fetch a single factory agent fully rendered: the function files to scaffold (an index.ts that declares the agent with defineAgent and its skills with defineTool) plus the secrets it needs. This is what npx zavudev agents pull <id> writes to disk before npx zavudev deploy.

`GET https://api.zavu.dev/v1/agent-templates/{templateId}`

Fetch a single factory agent fully rendered: the function files to scaffold (an `index.ts` that declares the agent with `defineAgent` and its skills with `defineTool`) plus the secrets it needs. This is what `npx zavudev agents pull <id>` writes to disk before `npx zavudev deploy`.

## Parameters

- `templateId` (path, string, required)

## Responses

### 200

Rendered factory agent.

- `template` (object, required): A fully rendered factory agent: the function files to scaffold plus the secrets it needs. Returned by GET /v1/agent-templates/{templateId} and consumed by `npx zavudev agents pull`.
  - `id` (string, required)
  - `name` (string, required)
  - `summary` (string, required)
  - `category` (string, required) One of: `sales`, `support`, `frontDesk`, `ops`.
  - `voice` (boolean, required)
  - `defaultSlug` (string, required)
  - `files` (object[], required)
    - `path` (string, required)
    - `content` (string, required): File contents to write verbatim.
  - `dependencies` (object, required): npm dependencies for the scaffolded function.
    - `{key}` (string)
  - `requiredSecrets` (object[], required)
    - `key` (string, required)
    - `hint` (string, required)

### 401

Unauthorized.

- `code` (string, required)
- `message` (string, required)
- `details` (object)

### 404

Template not found.

- `code` (string, required)
- `message` (string, required)
- `details` (object)

## Example

```bash
curl -X GET "https://api.zavu.dev/v1/agent-templates/fermi" \
  -H "Authorization: Bearer $ZAVUDEV_API_KEY"
```

```typescript
import Zavudev from "@zavudev/sdk";

const zavu = new Zavudev({ apiKey: process.env.ZAVUDEV_API_KEY });

const result = await zavu.agentTemplates.retrieve("fermi");

console.log(result);
```
