v1

latestOpenAPI 3.0.22026-07-12103244.1 KB
Email templates

migrateAutomationsForTemplate

Find all automation flows in the org that contain a send-email or reply-email action referencing old_template_id and rewrite those actions to point at the new template id ({id} path param). Intended to be called after a duplicated template has been refined, so automations follow over to the new template.

post/v1/email-template/templates/{id}:migrate-automations

Path parameters

idstring required

New template id (the duplicate that automations should be migrated onto)

Request body

old_template_idstring required

Source template id that automations are being migrated away from

Example request

{
  "old_template_id": "511ceb90-f738-47aa-8b1e-915ace0ae13c"
}

Response

Success

migrated_flow_countinteger required

Number of automation flows successfully rewritten to point at the new template

migrated_flow_idsstring[] required

IDs of automation flows that were successfully migrated

migrated_workflow_countinteger required

Number of v2 workflows whose AUTOMATION tasks point at a migrated automation flow. Derived from migrated_flow_ids — a workflow is counted once even if multiple of its tasks reference the same migrated flow.

migrated_workflow_idsstring[] required

IDs of workflows (wf-*) that owned at least one migrated automation flow

migrated_portal_countinteger required

Number of customer-portal email-template config rows whose references were rewritten from the old template id to the new one (via customer-portal-api's migrateEmailTemplateReferences).

migrated_portal_idsstring[] required

Portal IDs whose email-template references were successfully rewritten

failed_flow_idsstring[] required

IDs of automation flows whose putFlow update failed. Caller can retry or surface to the user.

failed_portal_idsstring[] required

Portal IDs whose email-template reference rewrite failed in customer-portal-api.

portal_migration_erroredboolean required

True when the call to customer-portal-api threw before returning, so the portal counts could not be computed. Flow/workflow results are still valid; the caller should surface this and offer a retry of the portal migration.

Example response

{
  "migrated_flow_count": 3,
  "migrated_workflow_count": 2,
  "migrated_portal_count": 1
}