Gate API Reference

Complete endpoint reference for the Solenoid Gate feature flag API.

Base URL: https://api.solenoid.systems

All endpoints require a Bearer token. See Authentication.

See Rate Limits for per-tier request limits.

POST /v1/gate

Create or update a feature flag.

Request Body:

FieldTypeRequiredDescription
flag_keystringYesFlag identifier. Must match /^[a-z0-9][a-z0-9_-]*$/, max 64 characters.
enabledbooleanYesFlag state (true or false)
descriptionstringNoOptional description (max 256 characters)
curl -X POST https://api.solenoid.systems/v1/gate \
  -H "Authorization: Bearer sm_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "flag_key": "maintenance-mode",
    "enabled": false,
    "description": "Site-wide maintenance toggle"
  }'

Response (201 Created):

{
  "success": true,
  "flag_key": "maintenance-mode"
}

Billing: Free

GET /v1/gate

List all flag keys for the authenticated user.

curl https://api.solenoid.systems/v1/gate \
  -H "Authorization: Bearer sm_your_api_key_here"

Response (200 OK):

{
  "flags": [
    "maintenance-mode",
    "new-dashboard",
    "beta-features"
  ]
}

Billing: Free

GET /v1/gate/config

Get all flag configurations. Designed for client SDK polling.

curl https://api.solenoid.systems/v1/gate/config \
  -H "Authorization: Bearer sm_your_api_key_here"

Response (200 OK):

{
  "flags": [
    {
      "flag_key": "maintenance-mode",
      "enabled": false,
      "description": "Site-wide maintenance toggle"
    },
    {
      "flag_key": "new-dashboard",
      "enabled": true,
      "description": "New dashboard UI rollout"
    }
  ]
}

Billing: 1 credit per request. Use caching and reasonable poll intervals (30-60s) to minimize costs.

GET /v1/gate/:flagKey

Evaluate a single feature flag.

ParameterTypeDescription
flagKeystringThe flag identifier
curl https://api.solenoid.systems/v1/gate/maintenance-mode \
  -H "Authorization: Bearer sm_your_api_key_here"

Response (200 OK):

{
  "enabled": false,
  "flag_key": "maintenance-mode"
}

Returns 404 with flag_not_found if the flag does not exist. See Errors.

Billing: 1 credit per evaluation. For client-side apps, prefer GET /v1/gate/config with local caching.

DELETE /v1/gate/:flagKey

Delete a feature flag.

ParameterTypeDescription
flagKeystringThe flag identifier
curl -X DELETE https://api.solenoid.systems/v1/gate/maintenance-mode \
  -H "Authorization: Bearer sm_your_api_key_here"

Response (200 OK):

{
  "success": true
}

Billing: Free

Response Format

All successful responses return JSON with 200 or 201 status codes. All error responses include an error object with code and message fields. See Errors for the full list.

Flag Key Validation

Valid flag keys must:

  • Match the pattern /^[a-z0-9][a-z0-9_-]*$/
  • Start with a lowercase letter or digit
  • Contain only lowercase letters, digits, dashes, and underscores
  • Be at most 64 characters long

Valid: new-dashboard, beta-features, maintenance_mode

Invalid: New-Dashboard (uppercase), _maintenance (starts with underscore), -debug (starts with dash), Feature Flag (spaces)

Next Steps

  • Quick Start — Create your first feature flag
  • Errors — Error codes and resolution