v1

latestOpenAPI 3.0.22026-07-12103244.1 KB
Variables

replaceVariablesAsync

This endpoint allows to initiate an asynchronous process in replacing the template details & generating the documents. On initial request, a jobId and STARTED status are returned. Subsequent requests can use this jobId to poll for the resolved template. If still processing, it returns the jobId and IN-PROGRESS status. Upon completion or failure, it returns the final template or a failure status with reason.

post/v1/email-template/templates:replaceAsync

Query parameters

job_idstring

Job ID for tracking the status of document generation action

Request body

email_template_idstring
must_include_unsubscribe_linkboolean

If true then include unsubscribe link in the email body

skip_document_generationboolean

If true then skip document generation. This is useful when you want to replace html variables only. Speeds up the process.

Example request

{
  "email_template_id": "511ceb90-f738-47aa-8b1e-915ace0ae13c",
  "variable_parameters": {
    "main_entity_id": "63753437-c9e2-4e83-82bb-b1c666514561",
    "user_id": "123452",
    "custom_variables": [
      {
        "variable": "{{abc.xyz}}",
        "value": "ReplacedValue"
      }
    ]
  }
}

Response

Success

job_idstring required

Job ID of the email template that is requested to replace and generate docs

status'STARTED' | 'PROCESSING' | 'SUCCESS' | 'FAILED' required
messagestring

Error message

Example response

{
  "job_id": "8c086140-f33e-4bb7-a993-50c0f2402c7b",
  "doc_progress_count": {
    "total": 10,
    "completed": 5
  },
  "result": {
    "entity": {
      "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "_org": "206801",
      "_schema": "message",
      "_tags": [
        "automatic email template"
      ],
      "_created_at": "2021-02-09T12:41:43.662Z",
      "_updated_at": "2021-02-10T09:14:31.990Z",
      "_purpose": [
        "a0ec23ac-12f8-4d89-9a63-91cba3787f2a",
        "310cd388-2f15-4b5b-8f98-ca14c1e03304"
      ],
      "_manifest": [
        "123e4567-e89b-12d3-a456-426614174000"
      ],
      "name": "Order confirmation",
      "from": {
        "name": "epilot",
        "email": "no-reply@epilot.cloud"
      },
      "to": [
        {
          "name": "Ny Huynh",
          "email": "ny.huynh@axonactive.com"
        }
      ],
      "cc": [
        {
          "name": "Ny Huynh",
          "email": "ny.huynh@axonactive.com"
        }
      ],
      "bcc": [
        {
          "name": "Ny Huynh",
          "email": "ny.huynh@axonactive.com"
        }
      ],
      "subject": "We have received your order!",
      "body": "Hi Ms Ny Huynh, </br> Thank you for your order. We will contact you shortly",
      "attachments": [
        {
          "cid": "f820ce3b-07b0-45ae-bcc6-babb2f53f79f",
          "filename": "Produktinformationen_epilot360_Double_Opt_in.pdf",
          "size": 451349,
          "content_type": "application/pdf",
          "url": "https://go.epilot.cloud/attachments/3e7c616a-3e89-4f92-b4c5-ea5ab140e3dd/Produktinformationen_epilot360_Double_Opt_in.pdf",
          "bucket": "893487340562-message-attachment",
          "object_key": "attachments/3e7c616a-3e89-4f92-b4c5-ea5ab140e3dd/Produktinformationen_epilot360_Double_Opt_in.pdf",
          "type": "Document template"
        }
      ],
      "backup": {
        "backed_up_at": "2026-05-13T10:00:00.000Z"
      },
      "original_template_id": "cd7809ba-a111-4dd9-8d15-18eb4de0faed"
    }
  }
}