Skip to main content
Templates are pre-built training packages that bundle workflows for common use cases. Instead of building training from scratch, apply a template to get a working agent quickly—then customize from there. Use templates for:
  • Getting started quickly with a new bot
  • Replicating training across multiple locations
  • Applying best-practice workflows without building them manually

Listing Templates

const response = await fetch("https://api.helloannie.com/v1/templates", {
  headers: { "Authorization": "Bearer YOUR_API_KEY" }
})

const { data } = await response.json()
// data.templates contains an array of available templates

Applying a Template

Templates may contain variables (placeholders) that must be filled in when applying. Check the template’s variables array to see what values are required.
const response = await fetch(
  "https://api.helloannie.com/v1/templates/TEMPLATE_ID/apply",
  {
    method: "POST",
    headers: {
      "Authorization": "Bearer YOUR_API_KEY",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      botId: "YOUR_BOT_ID",
      variables: {
        "office_name": "Downtown Dental",
        "office_phone": "+15551234567"
      }
    })
  }
)

const { data } = await response.json()
// data.workflowId contains the created workflow ID
The variables field is required, even if the template has no variables. Pass an empty object {} if the template doesn’t require any variables.More documentation on template variables is coming soon.

Batch Applying Templates

Apply multiple templates to a bot in a single operation. Each template requires its own variables object:
const response = await fetch(
  "https://api.helloannie.com/v1/templates/batch/apply",
  {
    method: "POST",
    headers: {
      "Authorization": "Bearer YOUR_API_KEY",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      botId: "YOUR_BOT_ID",
      templates: [
        {
          templateId: "TEMPLATE_1_ID",
          variables: { "office_name": "Downtown Dental" }
        },
        {
          templateId: "TEMPLATE_2_ID",
          variables: {}
        }
      ]
    })
  }
)

const { data } = await response.json()
// data.jobId can be used to track progress

Templates API

See the full API reference for template endpoints.