Initialize session
Initialize a Product Recommendation API session to obtain a device ID and session ID before calling any other recommendation endpoints.
init API. The initialization process accepts the current user identifier and requests the project settings and user preferences.
When to initialize
Depending on your platform, there are different requirements for when you need to runinit:
- cURL: Initialize each time your server renders the page.
- Web: Initialize each time the user opens the page (including single-page applications).
- iOS or Android: Initialize each time the app launches.
init method without a device ID to generate one. For backend recommendation logic with Kameleoon Web Experimentation, call this API and store the IDs in the KameleoonProducts_session_code cookie for sid and KameleoonProducts_device_id for did.
Query parameters
sid parameter, don’t add it during the first initialization. The system generates it and returns it in the response (as seance).Once generated, use the system-generated sid for requests within the current session.Response
Query Parameters
Store Key. Find this in Recommendations > Settings > Store settings in the Kameleoon app. Contact your Customer Success Manager for the key if necessary.
A device ID. If a device ID already exists, specify it here. If you don't specify a did, the API generates a new one. Use this generated ID as the device ID for all future requests.
A session ID is a temporary identifier assigned to the user for the current session. Do not include sid on the first init request; Kameleoon generates and returns it (as seance) in the response. If a sid is specified and does not exist in the system, an error occurs.
Response
Session initialized. Verified against a live response on 2026-09-24; fields below reflect what the API actually returns, which is more than the did/seance pair described in the endpoint's prose.
The device ID. Store this for use on subsequent requests.
The generated session ID (sid). Use it for requests within the current session.
The shop's default currency symbol.
Whether the email collector feature is enabled for this shop.
Whether an email address is already associated with this session.
Whether product recommendations are enabled for this shop.
Whether recommendation blocks lazy-load on this shop.
Whether Kameleoon automatically injects CSS for recommendation blocks.
The CMS/platform identifier configured for this shop, if any.
Custom JavaScript snippets configured for this shop in the Kameleoon app, injected alongside recommendation blocks.
The shop's Search service configuration.