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

# 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`.



## OpenAPI

````yaml /openapi.json get /v1/agent-templates/{templateId}
openapi: 3.0.3
info:
  title: Zavu Unified Messaging Layer API
  version: 0.2.0
  description: >
    Unified multi-channel messaging API for Zavu.


    Supported channels:

    - **SMS**: Simple text messages

    - **WhatsApp**: Rich messaging with media, buttons, lists, CTA URL buttons,
    and templates

    - **Telegram**: Bot messaging with text, media, and interactive elements

    - **Email**: Transactional emails via Amazon SES


    Design goals:

    - Simple `send()` entrypoint for developers

    - Project-level authentication via Bearer token

    - Support for all WhatsApp message types (text, image, video, audio,
    document, sticker, location, contact, buttons, list, cta_url, reaction,
    template)

    - If a non-text message type is sent, WhatsApp channel is used automatically

    - 24-hour WhatsApp conversation window enforcement

    - Universal `to` field accepts phone numbers (E.164), email addresses, or
    numeric chat IDs (Telegram/Instagram/Messenger)
servers:
  - url: https://api.zavu.dev
security:
  - bearerAuth: []
paths:
  /v1/agent-templates/{templateId}:
    get:
      tags:
        - Agents
      summary: Get a factory agent
      description: >-
        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`.
      operationId: getAgentTemplate
      parameters:
        - name: templateId
          in: path
          required: true
          schema:
            type: string
          example: fermi
      responses:
        '200':
          description: Rendered factory agent.
          content:
            application/json:
              schema:
                type: object
                required:
                  - template
                properties:
                  template:
                    $ref: '#/components/schemas/AgentTemplate'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Template not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    AgentTemplate:
      type: object
      description: >-
        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`.
      required:
        - id
        - name
        - summary
        - category
        - voice
        - defaultSlug
        - files
        - dependencies
        - requiredSecrets
      properties:
        id:
          type: string
          example: fermi
        name:
          type: string
        summary:
          type: string
        category:
          type: string
          enum:
            - sales
            - support
            - frontDesk
            - ops
        voice:
          type: boolean
        defaultSlug:
          type: string
          example: fermi
        files:
          type: array
          items:
            $ref: '#/components/schemas/AgentTemplateFile'
        dependencies:
          type: object
          additionalProperties:
            type: string
          description: npm dependencies for the scaffolded function.
        requiredSecrets:
          type: array
          items:
            type: object
            required:
              - key
              - hint
            properties:
              key:
                type: string
                example: SENDER_ID
              hint:
                type: string
    Error:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          example: invalid_request
        message:
          type: string
          example: Phone number is invalid
        details:
          type: object
          additionalProperties: true
    AgentTemplateFile:
      type: object
      required:
        - path
        - content
      properties:
        path:
          type: string
          example: index.ts
        content:
          type: string
          description: File contents to write verbatim.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````