Templates · Published 2026-09-28 · AgentiSend team
Approval request
Tell the person on call that an agent’s send is held and waiting for them to approve or reject it.
A handler for agent.approval_requested is the place this mail usually goes out.
Tell the person on call that an agent’s send is held and waiting for them to approve or reject it.
Variables
Every placeholder is required. A send that omits one is refused with that name, rather than going out with a blank.
agent_name(string, required). The name you gave the agent or its API key.held_to(string, required). Who the held email is addressed to.held_subject(string, required). The held email’s subject line.hold_reason(string, required). Why it was held, in a sentence. The event carries a reason; phrase it for a person.review_url(string, required). An https link to where a person approves or rejects it.
Rendered with the example values
These values are samples. They are not an account on AgentiSend.
Subject: Billing agent is waiting for your approval
<p>Billing agent tried to send an email, and it is held until a person approves it.</p>
<p>To: finance@example.com<br>
Subject: Your September statement<br>
Held because: The agent asked for a person to check it first.</p>
<p><a href="https://app.example.com/approvals/act_42">Approve or reject it</a></p>
<p>Nothing is sent while it waits.</p>Billing agent tried to send an email, and it is held until a person approves it.
To: finance@example.com
Subject: Your September statement
Held because: The agent asked for a person to check it first.
Approve or reject it (https://app.example.com/approvals/act_42)
Nothing is sent while it waits.Create the draft
POST /templates and the create_template tool take this body. The draft does not send until it is published.
{
"name": "Approval request",
"subject": "{{agent_name}} is waiting for your approval",
"content": {
"mode": "markdown",
"source": "{{agent_name}} tried to send an email, and it is held until a person approves it.\n\nTo: {{held_to}}\nSubject: {{held_subject}}\nHeld because: {{hold_reason}}\n\n[Approve or reject it]({{review_url}})\n\nNothing is sent while it waits."
},
"variables": [
{
"name": "agent_name",
"type": "string",
"required": true
},
{
"name": "held_to",
"type": "string",
"required": true
},
{
"name": "held_subject",
"type": "string",
"required": true
},
{
"name": "hold_reason",
"type": "string",
"required": true
},
{
"name": "review_url",
"type": "string",
"required": true
}
]
}Publish it
Call publish_template with the id POST /templates returned. Publishing again makes the next version. A version that already went out does not change.
{
"name": "publish_template",
"arguments": {
"template_id": "<the id POST /templates returned>"
}
}Send it
Create the draft with the body above, publish it, then send with template_id and template_values. The rules are in Templates. The three calls, including a render that does not send, are in How do I send an email from a template. The next starter is Budget warning.