Skip to main content
Sitecore Documentation
  • Learn
  • Downloads
  • Changelog
  • Roadmap
PersonalizeCloud Portal
Sitecore Personalize
        • Getting started
        • Create a triggered experiment
        • Compose a webhook
        • Create a trigger
        • Apply a condition
        • Apply a segment
            • Use FreeMarker snippets
            • Use dynamic decision model data
            • Use guest data
        • Using traffic allocation and variant traffic assignment
        • Use a decision model
        • Testing via Request Bin
        • Automatic goal tracking for triggered experiments
    • SitecoreAI experiments
    • Using the experiment list
    • Manage experiment details
    • Set automated post-test actions
    • Set up email notifications
    • Duplicate, delete, and view details
  • Using client-side JavaScript
  • Glossary
  1. Introduction to experiments in Sitecore Personalize
  1. Sitecore Personalize
  2. Introduction to experiments in Sitecore Personalize
  3. Introduction to triggered experiments in Sitecore Personalize

Compose the API request for an experiment

After you compose a webhook for a triggered experiment, you must compose the API request to include the offer or content returned by a decision model to send to the chosen webhook destination.

The API request enables you to include dynamic data from the guest data model and experiment response. For example, you might want the variant for the triggered experiment to include the guest's first name, location, loyalty number, etc. You configure the request using FreeMarker.

To compose the API request for a triggered experiment:

  1. In the API editor, on the API request tab, use the drop-down list to select the external destination you want to send data to.

  2. Optionally, to add more headers to the request, click Add headers.

    Note

    You can't include FreeMarker variables in the headers that you add here. If you need FreeMarker variables in headers, you have to create them when you're configuring the request to an external destination.

  3. If the connection contains FreeMarker variables, click Set variable values to specify a value for every variable. Then, click Save.

    Note

    Wrap string values in double quotes, for example, "test-value".

  4. Click the API body tab and compose the API request body.

    You can include variables by using the FreeMarker variable notation ${}. For example, you can copy and paste dynamic data from the guest data model and decision model response, as required.

    Here's an example of the API request body for an abandoned cart email using variables for the guest data model:

    {
      "from": "[email protected]",
      "to": "${guest.email}",
      "subject": "Don't forget your favorite pair of shoes",
      "body": "Hello, ${guest.firstName}. We noticed that you left a pair of shoes in your cart..."
    }
  5. Click Save.

  6. Click to close the API editor.

If you have suggestions for improving this article, let us know!

© Copyright 2026, Sitecore A/S or a Sitecore affiliated company.
All rights reserved.

Privacy policySitecore Trust CenterTerms of use