POST /decide
The/decide endpoint is the primary way SDKs and clients evaluate feature flags. It returns which flags are enabled for a given user or group, along with their values and optional payloads.
This endpoint is designed for SDK use. For server-side evaluation, consider using the Local Evaluation endpoint at
/api/feature_flag/local_evaluation instead.Request Body
Your project API key (public token)
Unique identifier for the user/person
Person properties to use for flag evaluation
Group identifiers for group-based flags. Keys are group type names, values are group keys.
Properties for each group type
Anonymous ID before user identification (for experience continuity)
Disable GeoIP lookup for this request
Response
Object mapping flag keys to their evaluated values. Boolean flags return
true/false, multivariate flags return the variant key.Object mapping flag keys to their JSON payloads (if configured)
Whether any errors occurred during flag evaluation
Examples
Basic Flag Evaluation
With Person Properties
With Group Properties
With Anonymous ID for Experience Continuity
Response Examples
Boolean Flags
Multivariate Flags with Payloads
With Errors
Best Practices:
- The
/decideendpoint performs person and group lookups, which can be slower than local evaluation - For high-traffic server-side applications, use the Local Evaluation endpoint instead
- Cache flag results on the client side when possible
- SDKs automatically handle caching and polling for you
- Include relevant properties to ensure accurate flag evaluation
- Use anonymous IDs for experience continuity when users aren’t yet identified
SDKs
Most PostHog SDKs use the/decide endpoint under the hood. Here’s how to use feature flags in various SDKs: