Test the API response
Feature availability is part of a phased rollout. Your organization may not see this functionality yet. It will become available when your environment is included in the rollout.
After you configure a headless experience, use Preview API to test the response before you start it.
Preview API lets you test the experience for a specific visitor and check the JSON that SitecoreAI returns. There is no page preview, because a headless experience does not render itself.
The Preview API dialog has two tabs:
- Test - provide a guest reference and build the request body.
- Response - inspect the formatted JSON returned for that scenario.
Test at least twice using an identified visitor and an anonymous visitor. Anonymous visitors might have missing profile data, which can reveal issues in your response code.
To test the API response:
-
On the Configuration page, click Preview API.
-
On the Test tab, provide any required request details such as Point of sale, Headers, and Parameters.
-
In Profile, choose one of the following:
- Load profile - enter the visitor's client ID or profile ID. To retrieve these IDs, use inspect mode.
- Generate profile - use AI to generate a test profile from a natural-language prompt.
-
If you selected Generate profile:
-
Enter a description of the profile you want to test.
Example: A visitor from Copenhagen
-
Click Generate.
After the profile is loaded or generated, optionally click View JSON to review the profile data.
-
-
Click Run test.
-
On the Response tab, verify that the response contains the values your application expects and handles missing profile data safely.
Next step
After the response behaves as expected, publish the headless experience to start it now or schedule it for later.