Agent templates: build once, start every client from it
Save an agency's agent as a template, start client agents from it with each client's own business settings, and push improvements to every linked agent as drafts with a diff.
By the Ladoo team · Updated
An agent template is one of your agency's agents saved so you can reuse it: build a great HVAC receptionist once, start each HVAC client's agent from it, then push your improvements to all of them. Templates live in the agency workspace. Your client workspaces can see their agency's templates and start agents from them.
What a template keeps
- The agent's prompt, greetings, voice, language, call length, pronunciations and AI notice.
- Its published workflow: every step, its tools and the fields it collects.
- Its success criteria.
- The names of the business settings each client fills in. That's every business setting the agent has, plus any
{{name}}its prompts and steps use.business_nameis filled from the client workspace's name if you don't give one.
A template never holds a secret, knowledge or a client's details:
- Webhook header values are left empty, and the header stays as a reference that each client fills in.
- Literal transfer numbers and teams, knowledge bases, CRM fields and pipeline stages are left out and listed in
needs_setup. - Business settings keep their names, never their values. The values in your agency's own agent stay there.
- Only agents in the agency workspace itself can be saved. A client's agent can't become a template.
Webhook URLs and bodies, code steps and prompts go into the template as they are, and into every agent started from it, so keep secrets in webhook headers. A client workspace reading a template sees its settings, what it fills in and the list of steps, but not the steps' contents.
Save a template
curl https://api.tryladoo.com/v1/agent-templates \
-H "Authorization: Bearer $LADOO_AGENCY_KEY" \
-H "Content-Type: application/json" \
-d '{ "agent_id": "3e1d2c4b-5a6f-4b7c-8d9e-0f1a2b3c4d5e", "name": "HVAC receptionist" }'
The answer has the template, its versions, and content: what it saved, including variables (each with required) and workflow.needs_setup. This needs agents:write.
When you improve the agent, save the next version with POST /v1/agent-templates/{id}/versions ({ "changelog": "Warmer greeting" }). By default it saves the agent the template was last saved from; send agent_id to save another one of your agency's agents. Versions never change once saved. GET /v1/agent-templates/{id}/versions/{a}/diff/{b} shows what changed between two of them: steps, the flow, fields, agent settings and business settings.
Start a client agent from it
From the agency, name the client workspace:
curl https://api.tryladoo.com/v1/agent-templates/$TEMPLATE_ID/agents \
-H "Authorization: Bearer $LADOO_AGENCY_KEY" \
-H "Content-Type: application/json" \
-d '{
"client_id": "0f8f6d0e-2b1a-4c3d-9e8f-7a6b5c4d3e2f",
"name": "Ava",
"variables": { "office_number": "+15125550111", "business_hours": "Mon-Fri 8am-5pm" }
}'
From the agency, this needs agents:write and clients:write. A key made in the client workspace needs only agents:write, and leaves out client_id. To add a client and its agent in one go, use from_template on POST /v1/clients.
The new agent gets the template's settings and the client's business settings. Its workflow goes live straight away only when nothing needs setting up. Otherwise published is false, the workflow waits as a draft, and needs_setup lists what's missing: a business setting with no value, a webhook header to fill in, a transfer number to choose. Set those up in the client workspace, then publish the draft there.
A template made from an agent without a workflow (one prompt, no steps) has no draft to wait in, so its agent is live from the start. Its required business settings must come with the request, or it answers 422 template_settings_missing.
Push an update to client agents
curl https://api.tryladoo.com/v1/agent-templates/$TEMPLATE_ID/push \
-H "Authorization: Bearer $LADOO_AGENCY_KEY" \
-H "Content-Type: application/json" \
-d '{}'
This opens a draft of the latest version (or version) in every client agent started from the template, or only the agents in agent_ids. It never publishes anything: someone in each client workspace reviews the draft and publishes it. When they do, the template's prompt, voice and call settings go live with the workflow, and the client's business settings stay as they are.
If the version uses a business setting the client's agent doesn't have yet, needs_setup asks for it, and publishing the draft answers 422 template_settings_missing until it's filled in.
The client's own setup carries over. Each step the template shares with the client's live workflow (same id and type) keeps the client's transfer target, knowledge bases, pipeline stage and webhook header values. Header values carry over only while the webhook still goes to the same host. Steps the update adds still need setting up.
Each result has status, a diff of what the draft changes against what the agent runs now, and needs_setup, which lists what the client still sets up before publishing:
drafted: the draft is waiting in that client's agent.skipped: nothing was changed, andreasonsays why. A push never overwrites work in progress: an agent with unpublished changes of its own is skipped, and so is a draft from an earlier push that someone has edited since. A draft from an earlier push that nobody touched is replaced.
Pushing needs agents:write and clients:write. GET /v1/agent-templates/{id}/agents lists the linked agents, with the template version each one runs.
Related guides: Agencies: client workspaces through the API, API versions and safe retries and Webhook and Custom Code steps for developers.
Still stuck?
Ask our support agent (it runs on Ladoo), or email the team.