Quick start
Evaluate a CQL expression in under a minute.
The Evaluation API exposes endpoints for executing CQL expressions in real time against the current user context, available in a client-side variant authenticated with a public application ID and a server-side variant authenticated with a secret API key.
Prefer the SDK
Most applications should integrate through the Croct SDK, which handles authentication, client IDs, context detection, and caching. Call the HTTP API directly only for custom integrations or when building a new client.
Evaluate an expression
Make a POST request to /client/web/evaluate with the expression to evaluate:
JavaScript
1234567891011
const response = await fetch('https://api.croct.io/client/web/evaluate', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-App-Id': '<APP ID>', 'X-Client-Id': '<CLIENT ID>', }, body: JSON.stringify({query: 'user is returning'}),});
const result = await response.json();The response is the JSON-serializable result of the expression. In this case, a boolean:
1
trueSee the endpoint reference for more details.