/Docs
IntroductionHow FeatureGate worksQuickstart
OrganisationsProjectsEnvironments
OverviewTypes and valuesConfigure across environmentsTargeting rulesPercentage rolloutsDesign evaluation contextLifecycle and intentTags and discovery
Choose an evaluation approachEvaluation credentialsNode.js SDKEvaluate over HTTPEvaluate in browsersSnapshots and configuration freshnessErrors and fallbacksTest flags locallyProduction integration checklist
Run a controlled rolloutKill switchesProject insightsActivity and audit historyReview and clean up flagsEnvironment readinessTroubleshooting and limits
Members, roles, and permissionsInvite and manage a teamOrganisation settings and operational defaultsProject lifecycle and transferPlans, billing, and team organisationsOrganisation closure and reactivationAccount settings and security
Management API overviewPreviewProvision flags through automationPreviewRotate runtime keys through automationPreviewAudit project changes through automationPreview
DocsAPI Reference

Evaluate/Evaluate over HTTP

Get access
/Docs
Get access
  1. Docs
  2. Evaluate
  3. Evaluate over HTTP

Evaluate over HTTP

Batch typed server-side decisions through the hosted evaluation API.

MarkdownFeedback
PreviousNode.js SDKNextEvaluate in browsers

On this page

Send a batchInterpret the responseDesign contextTimeout and fallback policyError handlingProduction checklist

POST /v1/evaluate evaluates one or more keys in the project environment bound to the presented key. Use it when a local released SDK is unavailable or current hosted configuration is required.

Server callers authenticate with a secret runtime key carrying runtime:evaluate. Browser callers use a different publishable key and additional origin and exposure checks.

Send a batch

terminal
sh
curl https://api.featuregate.dev/v1/evaluate \
-H "Authorization: Bearer $FEATUREGATE_RUNTIME_KEY" \
-H "Content-Type: application/json" \
-d '{
  "evaluations": [
    { "key": "new-checkout", "defaultValue": false },
    { "key": "checkout-heading", "defaultValue": "Checkout" }
  ],
  "context": {
    "user": { "id": "user_123" },
    "account": { "id": "account_456", "plan": "pro" }
  }
}'

Batch flags used by the same operation instead of making sequential requests. Keys within one batch must be unique. Send either evaluations or the compatibility flags form, not both.

Every evaluation should include a default matching the expected type. That value is the caller's failure policy when the flag is missing, archived, unconfigured, or incompatible.

Interpret the response

The response identifies the bound project and environment and returns one result for each requested key. Each result includes key, type, value, and reason.

Do not infer environment from local configuration. Verify the response environment during integration testing so a staging key cannot be deployed to production unnoticed.

Use the result reason for diagnostics. Keep normal application branching on the returned typed value. Do not log the entire response when values may contain sensitive application configuration.

Design context

Send only documented attributes required by active rules. Normalize IDs and enum values before the request. Missing attributes are rule misses, not request failures.

FeatureGate validates body size, number and length of flag keys, number of context fields, JSON size, and nesting depth. The generated reference is authoritative for current limits.

Raw context, targeting values, user identifiers, and resolved values are not stored as evaluation telemetry. Existing requested flags contribute only privacy-safe aggregate usage.

Timeout and fallback policy

Set a caller timeout shorter than the surrounding operation budget. On timeout or network failure, apply the explicit defaults locally and record a privacy-safe operational error.

Retry only when the operation can afford extra latency. Use bounded exponential backoff for network failures and 5xx. Respect retry information for 429.

Do not retry 400, 401, 403, or 413 without changing the request, key, configuration, or organisation state. Immediate repetition adds load without changing the outcome.

Error handling

StatusMeaningResponse
400Invalid body, duplicate keys, type, or contextCorrect the caller
401Missing, malformed, unknown, or revoked keyReplace the credential
403Scope, binding, origin, exposure, or offboarding policyInspect the exact error code
413Body exceeds a request-size guardrailReduce the batch or context
429Rate limit exceededRespect retry information and reduce pressure
5xxTransient hosted failureUse defaults and bounded retry

Production checklist

  • Reuse an HTTP client and connection pool.
  • Batch related evaluations.
  • Keep the runtime key in a server secret manager.
  • Define typed defaults before integration.
  • Bound timeout and retry behaviour.
  • Avoid request and response body logging.
  • Monitor request IDs, status classes, latency, and fallback activation.

See the generated POST /v1/evaluate reference for current wire shapes and Troubleshooting for symptom-led diagnosis.