Feature Flags API
A feature flag is a named, typed value your app reads at runtime: a boolean that turns a feature on, or a string, number or JSON object that configures it (remote config). Each flag has variants - the values it can take - and decides per person which one they get, through targeting rules and a percentage rollout. Apps read flags with the SDKs (getFlag, getBoolFlag, getStringFlag, getNumberFlag, getJsonFlag, getAllFlags).
All endpoints on this page are relative to the base URL: https://api-eu1.joryio.com/api - see API Overview.
Flags belong to a workspace. Environments are workspaces: create the same key in your staging workspace and your production workspace, and each one is configured on its own. A person lands in the same rollout bucket in both, because bucketing depends only on the flag key and the person.
Availability
Feature flags are switched on for your organization by Joryio. Until they are, the endpoints on this page answer 403 with "code": "FEATURE_NOT_ENABLED", and the SDK endpoints answer an empty set of flags (your app uses its in-code defaults) and accept exposures without recording them. Contact Joryio support to have them switched on.
Permissions
| Permission | Allows |
|---|---|
flags:read | List and read flags and their change history |
flags:write | Create, edit, turn off (kill switch), run experiments on and archive flags |
The flag object
{
"id": "0f4a5e7c-1d2b-4c3a-9e8f-7a6b5c4d3e2f",
"key": "new_checkout",
"name": "New checkout",
"description": "The one-page checkout",
"valueType": "boolean",
"variants": [
{ "key": "on", "name": "On", "value": true },
{ "key": "off", "name": "Off", "value": false }
],
"offVariant": "off",
"rules": [
{
"id": "beta",
"name": "Beta testers",
"segmentIds": ["5b1f0c2e-3d4a-4b5c-8d6e-7f8091a2b3c4"],
"rollout": [{ "variant": "on", "weight": 100 }]
},
{
"id": "hebrew",
"name": "Hebrew speakers",
"conditions": [
{ "operator": "AND", "filters": [{ "type": "attribute", "field": "language", "operator": "equals", "value": "he" }] }
],
"rollout": [{ "variant": "on", "weight": 50 }, { "variant": "off", "weight": 50 }]
},
{
"id": "recent_buyers",
"name": "Bought in the last 30 days, not staff",
"conditions": [
{ "operator": "AND", "filters": [{ "type": "event", "eventName": "purchase", "operator": "performed_in_last_days", "value": 30 }] }
],
"conditionOperator": "AND",
"excludeConditions": [
{ "operator": "AND", "filters": [{ "type": "attribute", "field": "staff", "operator": "equals", "value": "true" }] }
],
"rollout": [{ "variant": "on", "weight": 100 }]
}
],
"defaultRollout": [{ "variant": "on", "weight": 10 }, { "variant": "off", "weight": 90 }],
"enabled": true,
"experiment": null,
"status": "active",
"version": 7,
"createdBy": "user-uuid",
"updatedBy": "api_key:key-uuid",
"createdAt": "2026-11-21T09:00:00.000Z",
"updatedAt": "2026-11-21T10:30:00.000Z"
}
| Field | Meaning |
|---|---|
key | What the app's code asks for. Lowercase letters, digits, _ and -, up to 64 characters, unique per workspace among flags that are not archived. It can change only before the flag was ever turned on. |
valueType | boolean, string, number or json. Fixed when the flag is created. |
variants | 2 to 10 values the flag can take. Each value must be of valueType; a JSON value is at most 16 KB. A boolean flag gets on (true) and off (false) when none are sent. |
offVariant | The variant everyone gets while the flag is off or archived. |
rules | Tried in order; the first rule whose audience matches the person decides, through its rollout. A rule's audience is the campaign audience shape: segmentIds matches a person in any of the segments (the same live segment engine as campaigns); conditions are include groups (a campaign's filterGroups) of any filter kind the campaign audience supports - attribute, event, behavioral, segment, channel_subscription, ecommerce, device and the rest - combined by conditionOperator (AND by default); excludeConditions are exclude groups (a campaign's excludeFilterGroups): a person matching any of them does not match the rule. Filters are validated with the same rules as segment and campaign filters. A rule needs at least one segment or filter, and has at most 20 segmentIds and at most 10 event, behaviour, segment or other history filters in its groups (each is a lookup per evaluation). Every segment, in segmentIds or in a segment filter, must be a segment of this workspace - anything else is refused with 400. |
defaultRollout | Everyone no rule matched. |
rollout weights | Percent, at most two decimals, adding up to 100. |
enabled | The kill switch. false serves offVariant to everyone without evaluating any rule. A new flag starts false. |
version | Goes up by one on every change. Exposure events name the version the person saw. |
How a person is bucketed
A percentage split puts each person in one of 10,000 buckets: the first 8 hexadecimal digits of sha256("<flag key>:<subject>"), modulo 10,000. The subject is the person's external ID once identified, otherwise the device's anonymous ID. The same person always lands in the same bucket, on every device and every call, and raising a rollout from 10% to 20% keeps the first 10% in.
Anonymous visitors
A visitor who has not been identified is matched by attribute and context conditions only. A rule with segments, or with any other filter kind (events, subscriptions, journeys...), never matches an anonymous visitor - and costs no lookup for them.
Flags
List flags
GET /flags?status=active
status: active (default), archived or all. Sorted by key.
Flags with their reach
GET /flags/overview?state=current&q=checkout&page=1&limit=25&sortBy=editedAt&sortOrder=desc&days=30
One page of flags as the Campaigns list shows them, with paging, search and the people each flag reached. Every parameter is optional:
state:current(default - on and off),on,off,archivedorall.q: matches the name or the key.page,limit(1-100, default 25);sortBy:name,status,createdAtoreditedAt(default);sortOrder:ascordesc.days: the window people exposed are counted in, 1-90 (default 30).createdBy,editedBy: comma-separated user ids.
{
"data": [{
"id": "...", "key": "new_checkout", "name": "New checkout", "valueType": "boolean",
"state": "on", "variants": 2, "split": [{ "variant": "on", "weight": 80 }, { "variant": "off", "weight": 20 }],
"rules": 1,
"exposure": { "people": 12400, "estimated": true },
"experimentRunning": true,
"experiment": { "campaignId": "...", "name": "Checkout test", "goal": "purchase", "exposed": 5100, "converted": 312, "rate": 0.061 }
}],
"pagination": { "total": 14, "page": 1, "limit": 25, "totalPages": 1 },
"days": 30,
"sampledPercent": 10
}
exposure.people: unique people exposed in the window. Exposures of people outside an experiment may be sampled (sampledPercentbelow 100); they are scaled back up andestimatedistrue.split: the share of each value for everyone no rule matched, while the flag is on (empty while off or archived).experiment: the running Feature flag experiment's goal result so far, summed over its arms. It is campaign analytics: it isnullwithout thecampaigns:readpermission or for a campaign you may not see;experimentRunningsays whether one runs either way.
Create a flag
POST /flags
Content-Type: application/json
{
"key": "new_checkout",
"name": "New checkout",
"valueType": "boolean",
"defaultRollout": [{ "variant": "on", "weight": 10 }, { "variant": "off", "weight": 90 }]
}
The flag starts off unless you send "enabled": true: creating a definition never changes what a live app does. 201 with the flag; 409 when the key is already used in the workspace; 400 lists every problem with the definition.
Read a flag
GET /flags/{id}
Update a flag
PATCH /flags/{id}
Content-Type: application/json
{ "defaultRollout": [{ "variant": "on", "weight": 25 }, { "variant": "off", "weight": 75 }] }
Send only what changes. 409 when the flag is archived, when the key changes after the flag was turned on, or when variants are added or removed while an experiment runs. 400 when valueType changes.
Turn a flag on or off (kill switch)
POST /flags/{id}/enabled
Content-Type: application/json
{ "enabled": false }
Off serves offVariant to everyone at once. Apps pick the change up on their next refresh: on start, on returning to the foreground, on identify, or immediately when you send a silent push with jry_sync: "flags".
Change history
GET /flags/{id}/history?limit=50&offset=0
Every change, newest first: who made it (a person, or api_key:<id>), when, the action (create, update, enabled, disabled, archive), the fields changed, and the state before and after. limit is at most 200.
Archive a flag
POST /flags/{id}/archive
Archive, never delete: the flag is turned off, a running experiment is stopped, and the key is free for a new flag. The history stays.
Experiments
An experiment measures the flag's variants against a goal event, with a holdout.
Start an experiment
Retired: answers 409. Experiments on a flag run as flag experiment campaigns. An experiment started here before keeps running until you stop it, and its results stay in the report.
POST /flags/{id}/experiment/start
Content-Type: application/json
{ "goalEvent": "purchase", "holdoutPercent": 5 }
holdoutPercent (0-50, default 5) of the flag's audience is held out: they get offVariant and are reported as the holdout. 409 when an experiment is already running.
Stop an experiment
POST /flags/{id}/experiment/stop
Rules and rollout keep serving as configured.
Experiment and exposure report
GET /flags/{id}/report?days=14
{
"flagKey": "new_checkout",
"days": 14,
"daily": [{ "day": "2026-11-21", "variant": "on", "people": 1840 }],
"sampledPercent": 100,
"activeOverrides": 42,
"overrideSources": [{ "journeyId": "6f1c2b9e-3a4d-4e5f-8a7b-9c0d1e2f3a4b", "journeyName": "Early access", "nodeId": "feature_flag_1", "people": 42 }],
"experiment": {
"status": "running",
"goalEvent": "purchase",
"holdoutPercent": 5,
"startedAt": "2026-11-14T09:00:00.000Z",
"stoppedAt": null,
"arms": [
{ "arm": "on", "exposed": 9120, "converted": 612, "rate": 0.0671, "ci": { "lower": 0.0621, "upper": 0.0724 }, "pBest": 0.97 },
{ "arm": "off", "exposed": 9045, "converted": 540, "rate": 0.0597, "ci": { "lower": 0.0550, "upper": 0.0648 }, "pBest": 0.03 },
{ "arm": "holdout", "exposed": 960, "converted": 55, "rate": 0.0573, "ci": { "lower": 0.0442, "upper": 0.0740 }, "pBest": 0.0 }
]
}
}
daily counts the people exposed per day (in the workspace timezone) and variant over the last days (1-90, default 14). For an experiment, a person's arm is the variant of their first exposure in this run (holdout for the people held out), and they convert when they track the goal event after that exposure and before the experiment stopped. pBest is the Bayesian probability that the arm has the highest conversion rate - the same stats engine as campaign A/B tests - and ci is the 95% interval of the rate. sampledPercent is the exposure sampling for flags without a running experiment (flags in an experiment are never sampled).
activeOverrides is the number of people a journey's Feature flag step has set this flag for, not yet expired. They get that value before any rule or experiment and are not counted in an experiment. overrideSources lists the journey steps that set them: journeyId, journeyName (null when the journey no longer exists), nodeId and people.
Flag experiment campaigns
An experiment on a flag is an in-app campaign of type flag_experiment, created with the Campaigns API like any other campaign: channel in_app, channelConfig { "type": "flag_experiment", "flagId": "<flag id>" }, the audience in targeting, the goal in conversionTracking. Each variant names the flag variant it serves in flagVariant and has a weight; the control-group variant (isControlGroup: true) is the holdout and gets the flag's offVariant; isBaseline marks the variant the others are compared with. Weights add up to 100.
{
"name": "New checkout test",
"channel": "in_app",
"channelConfig": { "type": "flag_experiment", "flagId": "8b0c6c1e-6f4f-4d6a-9d0e-2f1b3a4c5d6e", "triggers": [] },
"variants": [
{ "id": "a", "name": "Current checkout", "weight": 45, "flagVariant": "off", "isBaseline": true },
{ "id": "b", "name": "New checkout", "weight": 45, "flagVariant": "on" },
{ "id": "holdout", "name": "Holdout", "weight": 10, "isControlGroup": true }
],
"targeting": { "filterGroups": [{ "operator": "AND", "filters": [{ "type": "attribute", "field": "plan", "operator": "equals", "value": "pro" }] }] },
"conversionTracking": { "primaryConversion": { "eventName": "purchase" }, "conversionWindowHours": 72 }
}
Launching it is refused (400) unless the flag exists in the workspace and is active, no other experiment is live on it, no experiment started on the flag page is running, there are 2-10 variants that each serve a value the flag has, the holdout is at most 50%, and a goal is set. While it is live its flag, variants and weights cannot change (409). 403 FEATURE_NOT_ENABLED while feature flags are off for the organization. Every write to a flag experiment campaign (create, update, launch, pause, resume, cancel, publish, archive, duplicate, delete, restoring a version - also one whose snapshot is a flag experiment) also needs flags:write - 403 without it - and is recorded in the flag's history.
While it runs, a person in its audience gets their variant's value from /v1/flags/evaluate with reason experiment (or holdout), always the same variant for the same person: their bucket is sha256 of "<flagKey>:experiment:<campaignId>:<subject>", first 8 hex digits mod 10000. Archive and the kill switch still win over it. Anonymous visitors enter only when the audience uses attribute filters alone.
Flag experiment results
GET /flags/experiments/{campaignId}/report
{
"campaignId": "c3a1...",
"flagId": "8b0c...",
"flagKey": "new_checkout",
"status": "active",
"startedAt": "2026-11-14T09:00:00.000Z",
"endedAt": null,
"goal": { "eventName": "purchase", "windowHours": 72, "isDefault": false },
"pThreshold": 0.05,
"baselineVariantId": "a",
"arms": [
{ "campaignVariantId": "a", "name": "Current checkout", "flagVariant": "off", "isHoldout": false, "isBaseline": true, "exposed": 9045, "converted": 540, "rate": 0.0597, "ci": { "lower": 0.055, "upper": 0.0648 }, "pBest": 0.03, "vsBaseline": null, "vsHoldout": { "relativeDifference": 4.2, "pValue": 0.71, "isSignificant": false } },
{ "campaignVariantId": "b", "name": "New checkout", "flagVariant": "on", "isHoldout": false, "isBaseline": false, "exposed": 9120, "converted": 612, "rate": 0.0671, "ci": { "lower": 0.0621, "upper": 0.0724 }, "pBest": 0.97, "vsBaseline": { "relativeDifference": 12.4, "pValue": 0.04, "isSignificant": true }, "vsHoldout": { "relativeDifference": 17.1, "pValue": 0.12, "isSignificant": false } },
{ "campaignVariantId": "holdout", "name": "Holdout", "flagVariant": null, "isHoldout": true, "isBaseline": false, "exposed": 960, "converted": 55, "rate": 0.0573, "ci": { "lower": 0.0442, "upper": 0.074 }, "pBest": 0, "vsBaseline": null, "vsHoldout": null }
]
}
A person counts in the variant of their first exposure tagged with this campaign, and converts when they reach the campaign's goal (with its property conditions) within its window of that exposure. vsBaseline and vsHoldout are a two-proportion z-test: isSignificant when pValue is below pThreshold (1 - the campaign's confidence level, 95% by default). Requires flags:read and campaigns:read; 404 when the campaign is not a flag experiment of this workspace or not one you can see (team visibility, as GET /campaigns/{id}).
SDK endpoints
The SDKs call these with the app's SDK key, not an API key; you do not call them yourself unless you build your own client. Rate-limited per app.
Evaluate every flag for a person
POST /v1/flags/evaluate
Content-Type: application/json
{
"externalId": "customer-123",
"anonymousId": "8f6d2c1e-...",
"attributes": { "plan": "pro" },
"context": { "platform": "ios", "appVersion": "5.2.0", "locale": "he-IL" },
"etag": "<etag of the answer you hold>"
}
{
"flags": {
"new_checkout": { "value": true, "variant": "on", "valueType": "boolean", "reason": "rule", "version": 7, "logExposure": true }
},
"etag": "3f9a...",
"ttlSeconds": 300,
"evaluatedAt": "2026-11-21T10:31:00.000Z"
}
One call returns every active flag. reason is off (kill switch), override (a journey's Feature flag step set it for this person), rule, default, holdout (held out of an experiment) or experiment (a variant of a running flag experiment campaign). When the etag you send matches, the answer is { "notModified": true, "flags": {} } with the same etag - keep what you have. Keep the answer for ttlSeconds; the SDKs also refresh on start, on returning to the foreground, on identify and on a silent push with jry_sync: "flags". An archived flag is left out, so the app's in-code default applies. context and attributes are matched as attributes; an anonymous visitor (no externalId) is matched by attribute and context conditions only.
Report exposures
POST /v1/flags/exposures
Content-Type: application/json
{
"externalId": "customer-123",
"anonymousId": "8f6d2c1e-...",
"sessionId": "s-42",
"context": { "platform": "ios", "appVersion": "5.2.0" },
"exposures": [{ "key": "new_checkout", "variant": "on" }],
"idempotencyKey": "3c1e9f2a-..."
}
The SDKs send an exposure the first time the app reads a flag value in a session - once per person, flag and variant per session - unless the answer said logExposure: false. Each one must name an active flag and one of its variants; anything else is dropped. Joryio records it as a flag.exposure event (properties flagKey, variant, flagVersion, reason, inExperiment). Event names starting with flag. are reserved: a tracked event with that prefix is refused. At most 100 exposures per call.
Send the same identity, attributes and context as to /v1/flags/evaluate. Joryio evaluates each named flag again for that person and keeps the exposure only when it assigns the same variant; reason, inExperiment and flagVersion always come from that server-side evaluation, never from the request, so an SDK key cannot add exposures to an experiment arm or the holdout. An exposure from a device holding an answer older than the flag's last change can be dropped for the same reason. The response counts accepted and dropped.
Each batch carries an idempotencyKey (a UUID the SDK picks per batch; optional, 16-64 letters, digits and hyphens). Exposures are counted once per person, flag and variant per session: every exposure gets an event id derived from the person, flag, variant and sessionId, so the same exposure sent again - a request retried after a dropped connection, or sent again after the app was relaunched or the page reloaded in the same session - is counted once in every report. Without a sessionId the id is derived from the idempotencyKey, so a copy of one batch counts once; without either, every request counts. The SDKs also remember the exposures they already sent in the session across a relaunch or a reload. Data streaming and webhooks deliver at least once: a copy carries the same event id, so dedupe on it.
Not available yet
Server-side local evaluation - evaluating flags inside your own backend from a downloaded copy of the rules, without a call per person - is planned for later. Today flags are evaluated by Joryio for the SDKs.