REST API
Read a toggle's effective value in the tenant you are testing. The global definition and a tenant-specific override answer different questions.
Open the API Explorer at /docs/api on your Open Mercato instance to inspect request and response schemas or try a call with an API key.
The Feature Toggles API enables programmatic access to feature flag management, overrides, and status checks. Use these endpoints to integrate feature toggles into your applications and workflows.
/api/feature_toggles
All Feature Toggles API endpoints require authentication. Include your API key or session token in the request headers.
Note: All admin-related endpoints require the Super Admin role. The check endpoint only requires authentication.
curl -X GET "$BASE_URL/feature_toggles/global" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Accept: application/json"
All endpoints are automatically scoped to your tenant based on your authentication context. You cannot access toggles or overrides from other tenants unless explicitly authorized.
export BASE_URL="http://localhost:3000/api"
export API_KEY="<paste your API key secret here>"
Use an API key with appropriate permissions for feature toggle management.
GET /feature_toggles/globalQuery parameters (selected):
page, pageSize – pagination (default 1, 50).search – case-insensitive match on identifier, name, description, category.category – filter by category.name – filter by name.identifier – filter by identifier.type – filter by toggle type (boolean, string, number, json).sortField – id, category, identifier, name, createdAt, updatedAt, type.sortDir – asc, desc.curl -X GET "$BASE_URL/feature_toggles/global?page=1&pageSize=50" \
-H "X-Api-Key: $API_KEY" \
-H "Accept: application/json"
Response:
{
"items": [
{
"id": "uuid-of-toggle",
"identifier": "new-feature",
"name": "New Feature",
"description": "Description of the new feature",
"category": "experimental",
"type": "boolean",
"defaultValue": false,
"created_at": "2025-12-29 21:59:25.246+00",
"updated_at": "2025-12-29 21:59:25.246+00"
}
],
"total": 1,
"totalPages": 1,
"page": 1,
"pageSize": 50
}
GET /feature_toggles/global/{id}Get details of a specific feature toggle.
curl -X GET "$BASE_URL/feature_toggles/global/$TOGGLE_ID" \
-H "X-Api-Key: $API_KEY" \
-H "Accept: application/json"
Response:
{
"id": "uuid-of-toggle",
"identifier": "new-feature",
"name": "New Feature",
"description": "Description of the new feature",
"category": "experimental",
"type": "boolean",
"defaultValue": false,
"created_at": "2025-12-29 21:59:25.246+00",
"updated_at": "2025-12-29 21:59:25.246+00"
}
POST /feature_toggles/globalBody must satisfy toggleCreateSchema:
identifier (lowercase, numbers, underscores), name, type (boolean, string, number, json).description, category, defaultValue (any, defaults to null).curl -X POST "$BASE_URL/feature_toggles/global" \
-H "X-Api-Key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"identifier": "new-feature",
"name": "New Feature",
"description": "Description of the new feature",
"category": "experimental",
"type": "boolean",
"defaultValue": false
}'
Response:
{ "id": "uuid-of-new-toggle" }
PUT /feature_toggles/globalSend id and any mutable fields from the create schema.
id.identifier, name, description, category, defaultValue.curl -X PUT "$BASE_URL/feature_toggles/global" \
-H "X-Api-Key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"id": "uuid-of-toggle",
"name": "Updated Feature Name",
"defaultValue": true
}'
Response:
{ "id": "uuid-of-toggle" }
DELETE /feature_toggles/globalDelete a feature toggle.
id (in body).curl -X DELETE "$BASE_URL/feature_toggles/global" \
-H "X-Api-Key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"id": "uuid-of-toggle"
}'
Response:
{ "id": "uuid-of-toggle" }
GET /feature_toggles/global/{id}/overrideQuery parameters:
Get specific override for a feature toggle in current tenant context.
# Get override for a specific toggle
curl -X GET "$BASE_URL/feature_toggles/global/$TOGGLE_ID/override" \
-H "X-Api-Key: $API_KEY" \
-H "Accept: application/json"
Response:
{
"id": "uuid-of-override",
"value": true,
"tenantName": "Tenant Name",
"tenantId": "uuid-of-tenant",
"toggleType": "boolean"
}
GET /feature_toggles/overridesQuery parameters:
page, pageSize – pagination (default 1, 25).category – filter by category.name – filter by name.identifier – filter by identifier.sortField - identifier, name, category.sortDir – asc, desc.curl -X GET "$BASE_URL/feature_toggles/overrides?page=1&pageSize=50" \
-H "X-Api-Key: $API_KEY" \
-H "Accept: application/json"
Response:
{
"items": [
{
"id": "uuid-of-override",
"toggleId": "uuid-of-toggle",
"tenantId": "uuid-of-tenant",
"identifier": "new-feature",
"name": "New Feature",
"category": "experimental",
"tenantName": "Tenant Name",
"isOverride": true
}
],
"total": 1,
"totalPages": 1,
"page": 1,
"pageSize": 50,
"isSuperAdmin": false
}
PUT /feature_toggles/overridesChange the state of a feature toggle override.
toggleId, isOverride (boolean).overrideValue (any).Note: The
tenantIdis automatically resolved from the request context.
curl -X PUT "$BASE_URL/feature_toggles/overrides" \
-H "X-Api-Key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"toggleId": "uuid-of-toggle",
"isOverride": true,
"overrideValue": true
}'
Response:
{
"ok": true,
"overrideToggleId": "uuid-of-override"
}
Check if a feature is enabled and get its configuration value for the current context.
GET /feature_toggles/check/booleanQuery parameters:
identifier – (required) feature toggle identifier.curl -X GET "$BASE_URL/feature_toggles/check/boolean?identifier=new-feature" \
-H "X-Api-Key: $API_KEY" \
-H "Accept: application/json"
Response:
{
"enabled": true,
"source": "override",
"toggleId": "uuid-of-toggle",
"identifier": "new-feature",
"tenantId": "uuid-of-tenant"
}
GET /feature_toggles/check/stringQuery parameters:
identifier – (required) feature toggle identifier.curl -X GET "$BASE_URL/feature_toggles/check/string?identifier=my-string-feature" \
-H "X-Api-Key: $API_KEY" \
-H "Accept: application/json"
Response:
{
"valueType": "string",
"value": "some-string-value",
"source": "default",
"toggleId": "uuid-of-toggle",
"identifier": "my-string-feature",
"tenantId": "uuid-of-tenant"
}
GET /feature_toggles/check/numberQuery parameters:
identifier – (required) feature toggle identifier.curl -X GET "$BASE_URL/feature_toggles/check/number?identifier=my-number-feature" \
-H "X-Api-Key: $API_KEY" \
-H "Accept: application/json"
Response:
{
"valueType": "number",
"value": 42,
"source": "default",
"toggleId": "uuid-of-toggle",
"identifier": "my-number-feature",
"tenantId": "uuid-of-tenant"
}
GET /feature_toggles/check/jsonQuery parameters:
identifier – (required) feature toggle identifier.curl -X GET "$BASE_URL/feature_toggles/check/json?identifier=my-json-feature" \
-H "X-Api-Key: $API_KEY" \
-H "Accept: application/json"
Response:
{
"valueType": "json",
"value": { "key": "value" },
"source": "default",
"toggleId": "uuid-of-toggle",
"identifier": "my-json-feature",
"tenantId": "uuid-of-tenant"
}
Previous: Export data through the API · Next: Integrations and data sync API