Agent templates

Browse the built-in prompt and flow templates, fetch one, and use it as the starting point for a new agent.

Templates are ready-made starting points for an agent. Dialgem ships two catalogues: prompt templates for prompt agents (a system prompt, a first message and default variables) and flow templates for flow agents (a complete conversation graph).

The catalogues are read-only and the same for every account. You can list them and fetch one, but you cannot create, update or delete a template. To customise one, create an ordinary agent from it and edit that agent.

Templates supply content only. They never set the voice, the model or other settings, so you choose those when you create the agent.

List templates

curl "https://api.dialgem.com/v1/prompt-templates?category=healthcare" \
  -H "X-API-Key: $DIALGEM_API_KEY"

The response is a plain array. Each entry has id, name, description, setup_note, category, tags, use_case, icon and variable_names, the variables you are expected to fill in. Prompt template entries also carry system_prompt_chars, the length of the prompt, so you can tell a full prompt from a stub without downloading it.

category is optional and filters by one of receptionist, support, healthcare, sales or survey. An unknown category returns an empty array, not an error.

Flow templates work the same way at GET /v1/flow-templates. Their summaries add node_count, node_types and runnable, and leave out the flow itself.

Get one template

curl https://api.dialgem.com/v1/prompt-templates/TEMPLATE_ID \
  -H "X-API-Key: $DIALGEM_API_KEY"

A prompt template's detail adds system_prompt, first_message and default_dynamic_variables. A flow template's detail adds flow_config, the full flow, plus the reasons if a template cannot run yet.

An id that does not exist returns 404 with the error code prompt_template_not_found (or flow_template_not_found for flows).

Create an agent from a template

There is no separate "create from template" call. Fetch the template, then send its content to Create agent like any other agent. It goes through the same validation as an agent you wrote by hand.

Pick a template

List the catalogue, then read setup_note and variable_names to see what you need to change, such as the business name and opening hours.

Fetch it

Call the get endpoint and keep system_prompt, first_message and default_dynamic_variables.

Create the agent

Post those fields with your own name and a voice_id from Voices. Replace the default variable values with yours.

curl https://api.dialgem.com/v1/agents \
  -H "X-API-Key: $DIALGEM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Bright Smile front desk",
    "agent_type": "llm",
    "system_prompt": "SYSTEM_PROMPT_FROM_TEMPLATE",
    "voice_id": "VOICE_ID",
    "default_dynamic_variables": { "agent_name": "Jamie", "business_type": "dental clinic" }
  }'

For a flow template, create the agent with agent_type set to flow and send the template's flow_config as the agent's flow_config.

You can also pick a template in the dashboard when you create an agent.

Read setup_note before going live. Some templates, such as the healthcare ones, contain safety wording you should keep and review against your own guidance.