PATCH/templates/:id
Echo-all update of a manual email agent. GET the agent, change what you need, and PATCH the full writable set. A sparse body is rejected (400) so a typo cannot blank a field.
0 credits. Rate class: campaign_control (default 20/min).
Request
PATCH /templates/tpl_abc
X-API-Key: sk_live_...
Content-Type: application/json
Every key below is required (shapes as in POST /templates):
name, prompt, yourPitch, messageType, sendWhen, selectedAccounts, outboundSendMode, agentCanReply, agentMaxReplies, followUps, emailSubjectType, emailSubjectTemplate, emailSubjectPrompt, signatureBlock, useGmailAccountSignature, messageBodyFormat, autoExcludePolicy
selectedAccountsmust stay non-empty and connected.- Full Auto agents → 400 — edit them in the dashboard.
- Follow-ups are replaced wholesale by the array you send.
Side effects
- Changing
sendWhenoroutboundSendModeresets dispatch timing on campaigns using the agent. - Renaming syncs the assigned template name on those campaigns.
- Removing an account from
selectedAccountsreleases queued leads that were bound to it. - Changing subject/body configuration invalidates pending drafts.
Response
Refreshed GET /templates/:id detail.
Errors
| Code | When |
|---|---|
validation_error | Missing echo-all field, bad value, Full Auto, rejected key |
account_disconnected | A selected account is inactive or disconnected |
not_found | Unknown template id |
rate_limited | campaign_control RPM exceeded |
upstream_unavailable | Write failed — retry |
MCP
Tool: update_template. Always call get_template first.