Developers API reference Engagement Message templates API REST endpoints for message templates in ServFlo: 7 operations with parameters, request and response fields, permissions and curl examples.
Base URL: https://app.servflo.ai/api. Every call needs Authorization: Bearer sfk_… (Authentication ); {organizationId} ($ORGANIZATION_ID in the examples) is your business's id .
GET /organizations/{organizationId}/message-templates
Email and text templates, the presets' (system: editable, not deletable) first. Read-only.
Permission engagement.read (Owner, Admin, Dispatcher)Risk read, OAuth scope servflo.read. Read: reads only.MCP tool messageTemplates_list (toolset marketing)
Name In Type Required Description channelquery enum No One of EMAIL, SMS.
curl "https://app.servflo.ai/api/organizations/ $ORGANIZATION_ID /message-templates" \
-H "Authorization: Bearer $SERVFLO_API_KEY "
200: the answer's fields An array of objects:
Field Type Description idstring namestring descriptionstring or null channelenum One of EMAIL, SMS. purposeenum One of TRANSACTIONAL, MARKETING. subjectstring or null bodystring placeholdersarray of string variantsarray of object categorystring or null isSystemboolean systemKeystring or null updatedAtstring ISO 8601 time (UTC).
POST /organizations/{organizationId}/message-templates
A reusable email or text. Nothing is sent: automations and the send dialogs use templates. Email needs a subject.
Permission engagement.manage (Owner, Admin)Risk write, OAuth scope servflo.write. Write: creates or changes records inside the business; nothing leaves it.MCP tool messageTemplates_create (toolset marketing)
Field Type Required Description namestring Yes Up to 200 characters. descriptionstring or null No Up to 1000 characters. channelenum Yes One of EMAIL, SMS. purposeenum No One of TRANSACTIONAL, MARKETING. Default TRANSACTIONAL. subjectstring or null No Email only; merge fields allowed. Up to 200 characters. bodystring Yes Text with {{merge.fields}} (GET /message-templates/merge-fields). variantsarray of object No A/B variants: { id, label, weight, subject?, body }. Up to 10 items. Default []. variants[].idstring Yes Up to 64 characters. variants[].labelstring No Up to 100 characters. variants[].weightinteger No 0–1000. Default 1. variants[].subjectstring or null No Up to 200 characters. variants[].bodystring Yes categorystring or null No Up to 40 characters.
curl -X POST "https://app.servflo.ai/api/organizations/ $ORGANIZATION_ID /message-templates" \
-H "Authorization: Bearer $SERVFLO_API_KEY " \
-H "Content-Type: application/json" \
-d '{"name":"Dana Whitfield","channel":"EMAIL","body":"string"}'
201: the answer's fields Field Type Description idstring namestring descriptionstring or null channelenum One of EMAIL, SMS. purposeenum One of TRANSACTIONAL, MARKETING. subjectstring or null bodystring placeholdersarray of string variantsarray of object categorystring or null isSystemboolean systemKeystring or null updatedAtstring ISO 8601 time (UTC).
GET /organizations/{organizationId}/message-templates/merge-fields
Every {{merge.field}} a template can use (business, customer, property, job and visit, quote, invoice, payment, membership, links) with an example. Links are the real customer links, made when a message uses them. Read-only.
Permission engagement.read (Owner, Admin, Dispatcher)Risk read, OAuth scope servflo.read. Read: reads only.MCP tool messageTemplates_mergeFields (toolset marketing)
curl "https://app.servflo.ai/api/organizations/ $ORGANIZATION_ID /message-templates/merge-fields" \
-H "Authorization: Bearer $SERVFLO_API_KEY "
200: the answer's fields An array of objects:
Field Type Description groupstring tagsarray of object tags[].tokenstring tags[].labelstring tags[].helpstring tags[].examplestring
GET /organizations/{organizationId}/message-templates/{templateId}
One template with its subject, body, merge fields and A/B variants. Read-only.
Permission engagement.read (Owner, Admin, Dispatcher)Risk read, OAuth scope servflo.read. Read: reads only.MCP tool messageTemplates_get (toolset marketing)
Name In Type Required Description templateIdpath string Yes A message template id, from GET /message-templates.
curl "https://app.servflo.ai/api/organizations/ $ORGANIZATION_ID /message-templates/{templateId}" \
-H "Authorization: Bearer $SERVFLO_API_KEY "
200: the answer's fields Field Type Description idstring namestring descriptionstring or null channelenum One of EMAIL, SMS. purposeenum One of TRANSACTIONAL, MARKETING. subjectstring or null bodystring placeholdersarray of string variantsarray of object categorystring or null isSystemboolean systemKeystring or null updatedAtstring ISO 8601 time (UTC).
PATCH /organizations/{organizationId}/message-templates/{templateId}
Replaces the template's name, subject, body and variants (the channel cannot change). Automations using it send the new text from their next message.
Permission engagement.manage (Owner, Admin)Risk write, OAuth scope servflo.write. Write: creates or changes records inside the business; nothing leaves it.MCP tool messageTemplates_update (toolset marketing)
Name In Type Required Description templateIdpath string Yes A message template id, from GET /message-templates.
Field Type Required Description namestring Yes Up to 200 characters. descriptionstring or null No Up to 1000 characters. channelenum Yes One of EMAIL, SMS. purposeenum No One of TRANSACTIONAL, MARKETING. Default TRANSACTIONAL. subjectstring or null No Email only; merge fields allowed. Up to 200 characters. bodystring Yes Text with {{merge.fields}} (GET /message-templates/merge-fields). variantsarray of object No A/B variants: { id, label, weight, subject?, body }. Up to 10 items. Default []. variants[].idstring Yes Up to 64 characters. variants[].labelstring No Up to 100 characters. variants[].weightinteger No 0–1000. Default 1. variants[].subjectstring or null No Up to 200 characters. variants[].bodystring Yes categorystring or null No Up to 40 characters.
curl -X PATCH "https://app.servflo.ai/api/organizations/ $ORGANIZATION_ID /message-templates/{templateId}" \
-H "Authorization: Bearer $SERVFLO_API_KEY " \
-H "Content-Type: application/json" \
-d '{"name":"Dana Whitfield","channel":"EMAIL","body":"string"}'
200: the answer's fields Field Type Description idstring namestring descriptionstring or null channelenum One of EMAIL, SMS. purposeenum One of TRANSACTIONAL, MARKETING. subjectstring or null bodystring placeholdersarray of string variantsarray of object categorystring or null isSystemboolean systemKeystring or null updatedAtstring ISO 8601 time (UTC).
DELETE /organizations/{organizationId}/message-templates/{templateId}
Destructive: deletes a template no automation uses (409 otherwise). Preset templates cannot be deleted.
Permission engagement.manage (Owner, Admin)Risk sensitive, OAuth scope servflo.sensitive. Sensitive: moves money, deletes, sends or shows something to a customer, or grants or revokes access.MCP tool messageTemplates_delete (toolset marketing)Approval Over MCP, this tool always waits for your approval in ServFlo. See Approvals .
Name In Type Required Description templateIdpath string Yes A message template id, from GET /message-templates.
curl -X DELETE "https://app.servflo.ai/api/organizations/ $ORGANIZATION_ID /message-templates/{templateId}" \
-H "Authorization: Bearer $SERVFLO_API_KEY "
200: the answer's fields Field Type Description oktrue
POST /organizations/{organizationId}/message-templates/preview
Renders a subject and body (or a saved template) for a real customer and optional record, as it would be sent: merge fields filled, the branded email shell, the SMS length. Without a customer, the merge fields' examples are used. Nothing is sent.
Permission engagement.read (Owner, Admin, Dispatcher)Risk write, OAuth scope servflo.write. Write: creates or changes records inside the business; nothing leaves it.MCP tool messageTemplates_preview (toolset marketing)
Field Type Required Description channelenum Yes One of EMAIL, SMS. purposeenum No One of TRANSACTIONAL, MARKETING. Default TRANSACTIONAL. subjectstring or null No Up to 200 characters. bodystring No templateIdstring No Preview a saved template instead of subject/body. customerIdstring No The sample customer (GET /customers); examples when omitted. subjectTypeenum No One of visit, job, quote, invoice, payment, membership, request. subjectIdstring No brandingobject No Email branding not saved yet (Settings → Messaging's live preview); without a customer only. branding.brandColorstring or null No Up to 7 characters. branding.headerTextstring or null No Up to 120 characters. branding.footerTextstring or null No Up to 500 characters.
curl -X POST "https://app.servflo.ai/api/organizations/ $ORGANIZATION_ID /message-templates/preview" \
-H "Authorization: Bearer $SERVFLO_API_KEY " \
-H "Content-Type: application/json" \
-d '{"channel":"EMAIL"}'
200: the answer's fields Field Type Description channelenum One of EMAIL, SMS. subjectstring or null bodystring The exact text (SMS) or the email's text part. htmlstring or null The branded email, as it would be sent. unresolvedarray of string Merge fields with no value for this customer. warningsarray of string smsobject or null sms.charactersinteger sms.segmentsinteger sms.encodingstring