HTTP API

Use Feature Switches from any language, with a few plain HTTP requests.

Not using Node? No problem. The library is a fairly thin wrapper around a small HTTP API, and you can call that from anything that speaks HTTP.

There are libraries for more languages on the way. Until then, this page has everything you need.

The basics

  • Base URL: https://api.dev-team-tools.com
  • Auth: send your API key as a bearer token: Authorization: Bearer fs_srv_…
  • Bodies: JSON in, JSON out.

Every key belongs to one environment, so you never name the environment in a request.

Which endpoint?

There are two ways to get answers, and which one you want depends on where your code runs:

  • On a server, download the rules with GET /sdk/v1/config and work out the answers yourself. It's quick, and checks don't need the network. It's a little more work to build, though.
  • Anywhere else (or if you'd rather keep things simple), ask for the answers with POST /sdk/v1/evaluate. It works with either kind of key.

Errors

Status Meaning
400 The body isn't right. The response says what's wrong
401 No Authorization header
403 The key is malformed, unknown, or revoked (or it's a client key on /config)
503 The environment's switches haven't been published yet. This only happens for a few minutes after an environment is created

Whatever you build, please make sure a failed request never breaks your app. Keep using the last answers you had, or fall back to a sensible default (usually off).

GET /sdk/v1/key

Checks a key works, and tells you what it belongs to. Handy for a health check, or when you're setting things up and want to make sure you've pasted the right key.

terminal
curl https://api.dev-team-tools.com/sdk/v1/key \  -H "Authorization: Bearer fs_srv_…"
response.json
{  "keyId": "8f0c…",  "workspaceId": "1b2e…",  "environmentId": "c4d1…",  "kind": "server"}

POST /sdk/v1/evaluate

Works out the answers for one context. Either kind of key.

terminal
curl -X POST https://api.dev-team-tools.com/sdk/v1/evaluate \  -H "Authorization: Bearer fs_cli_…" \  -H "Content-Type: application/json" \  -d '{ "context": { "userId": "u_123", "plan": "pro" } }'
response.json
{  "version": 12,  "etag": "\"12-3f9a0c1b2d4e5f60\"",  "switches": {    "newCheckout": { "value": true, "reason": "RULE_MATCH", "ruleId": "5e1a…" },    "newSearch": { "value": false, "reason": "DEFAULT" }  }}

The body takes:

  • context (required): who the answers are for. userId is required, and the rest is up to you. Values can be strings, numbers, booleans, or lists of strings. Up to 50 attributes, strings up to 1,000 characters, lists up to 100 items.
  • keys (optional): only work out these switches, up to 500 of them. Leave it out to get every switch in the environment. Keys that don't exist are left out of the response.

Each switch comes back with a value and a reason:

reason Meaning
RULE_MATCH A rule with a fixed value matched. ruleId says which
ROLLOUT A percentage rollout matched, and value says whether this context is in it
DEFAULT No rule matched, so the environment's default was used

Polling without re-downloading everything

If you're checking for changes regularly, send the last etag back as If-None-Match. When neither the switches nor your context have changed, you get an empty 304 Not Modified instead of the whole lot.

terminal
curl -X POST https://api.dev-team-tools.com/sdk/v1/evaluate \  -H "Authorization: Bearer fs_cli_…" \  -H "Content-Type: application/json" \  -H 'If-None-Match: "12-3f9a0c1b2d4e5f60"' \  -d '{ "context": { "userId": "u_123", "plan": "pro" } }'

The etag is in the body as well as the ETag header, because browsers can't read that header across origins. (A small but irritating detail.)

GET /sdk/v1/config

Downloads the environment's switches and rules, so you can work out answers in your own code. Server keys only. Client keys get a 403, because rules may list other people's ids.

terminal
curl https://api.dev-team-tools.com/sdk/v1/config \  -H "Authorization: Bearer fs_srv_…"
response.json
{  "environmentId": "c4d1…",  "workspaceId": "1b2e…",  "version": 12,  "publishedAt": "2026-11-14T10:21:07.000Z",  "switches": {    "newCheckout": {      "key": "newCheckout",      "salt": "k3f9…",      "defaultValue": false,      "rules": [        {          "id": "5e1a…",          "conditions": [            { "attribute": "email", "operator": "endsWith", "values": ["@my-company.com"] }          ],          "serve": { "type": "value", "value": true }        },        {          "id": "9b77…",          "conditions": [],          "serve": { "type": "rollout", "basisPoints": 1000, "bucketBy": "userId" }        }      ]    }  }}

Send the ETag header back as If-None-Match and you'll get a 304 until something changes. The Node library polls this every 30 seconds, which seems to be a happy middle ground.

Working out an answer

For each switch:

  1. Go through rules in order. A rule matches when all of its conditions match. A rule with no conditions matches everything.
  2. The first rule that matches decides:
    • { "type": "value" } serves its value.
    • { "type": "rollout" } serves true if the context is inside the rollout (see below), otherwise false.
  3. If no rule matches, serve defaultValue.

A condition matches like this:

  • If the context doesn't have the attribute at all, it never matches, whatever the operator.
  • exists matches as long as the attribute is there.
  • If the context value is a list, the condition matches if any item does. isNotOneOf is the exception: it matches only if no item is one of the values.
  • isOneOf and isNotOneOf compare the value (as a string) exactly against values.
  • contains, startsWith and endsWith match if the value does so for any of values. They're case-sensitive.
  • gt, gte, lt and lte compare the value as a number against values[0]. If either isn't a number, it doesn't match. Booleans and empty strings aren't numbers.

Rollouts

A rollout's basisPoints is the percentage in hundredths of a percent, so 1000 is 10%. To check whether a context is inside it:

  1. Look up the bucketBy attribute in the context. If it's missing, or it's a list, the context is outside the rollout.
  2. Take the MurmurHash3 (x86, 32-bit, seed 0) of the UTF-8 bytes of "{salt}:{value}", using the switch's salt. Numbers and booleans are turned into strings first, so 42 becomes "42".
  3. The bucket is that hash (as an unsigned integer) modulo 10000.
  4. The context is inside the rollout when bucket < basisPoints.

Do it exactly like this, and you'll get the same answers as the Node library and /evaluate. That matters if you've got a mix of services and you want a user to see the same thing everywhere.

POST /sdk/v1/contexts

Optional, but nice to have. If you work answers out yourself, Dev Team Tools never sees your contexts, so the rule editor can't suggest attributes. This endpoint lets you tell it what you've seen.

terminal
curl -X POST https://api.dev-team-tools.com/sdk/v1/contexts \  -H "Authorization: Bearer fs_srv_…" \  -H "Content-Type: application/json" \  -d '{ "attributes": { "userId": ["u_1", "u_2"], "companyId": ["42"] } }'

It answers 202 Accepted. Send it about once a minute at most, with a small sample of values for each attribute (the Node library sends up to 20). Leave out anything you'd rather not share, like email addresses.