List live connections
Preview. Returns the SDKs connected to the environment's push streams right now, and the config version Toggld last sent to each. Server SDKs on the sync stream are listed one by one. Clients on the evaluation stream, such as the browser SDK, are counted. Toggld knows what it sent each connection, not what the connection applied. Apps that only make HTTP requests never appear.
Requires a management key.
Returns 404 if the environment does not exist and 503 if the connections could not be read. On a self-hosted Node.js API, tracked is false and the lists are empty.
bearerAuthorizationBearer <token>Send a credential in the Authorization header: Authorization: Bearer <token>.
Each credential belongs to one environment of one workspace, so the API never takes a workspace or environment in the URL.
- Management key (
ffk_…, secret): manages flags, segments, environments, and API keys, and reads the audit log and analytics. It can also do everything an evaluation key can. - Evaluation key (
ffk_…, secret): for server SDKs. It evaluates flags, reads flag definitions for local evaluation, and sends telemetry. - Public token (
ffp_…, not secret): for browser and mobile apps. It evaluates flags through OFREP and sends telemetry. It cannot read flag definitions.
Keep secret keys on your server. A 401 response means the credential is missing or not valid. A 403 response means the credential is valid but its role cannot perform the operation.
environmentId*stringThe environment ID, such as env_….
OK
application/json- response
The live connections of one environment, and the config version each was last sent.
environmentId*stringThe environment ID, such as env_….
tracked*booleanWhether this API tracks live connections. The hosted API does. A self-hosted Node.js API does not, and returns false with empty counts.
configVersion*integerThe environment's current config version. A connection with this version was sent the latest flag configuration.
-9007199254740991 <= value <= 9007199254740991observedAt*stringWhen the connections were counted, as an ISO 8601 timestamp. Counts can be up to 2 seconds old.
servers*array<>Server SDK connections, oldest first. At most 500 are listed; serverCount counts all of them.
serverCount*integerThe number of server SDK connections.
-9007199254740991 <= value <= 9007199254740991browsers*Clients connected to the evaluation stream, such as the browser SDK. Toggld evaluates flags for them. They are anonymous, so only counts are returned.
curl -X GET 'https://api.toggld.io/api/v1/environments/string/connections'{ "environmentId": "string", "tracked": true, "configVersion": -9007199254740991, "observedAt": "string", "servers": [ { "id": "string", "keyId": "string", "connectedAt": "string", "lastHeartbeatAt": "string", "configVersion": -9007199254740991 } ], "serverCount": -9007199254740991, "browsers": { "total": -9007199254740991, "awaitingContext": -9007199254740991, "unresponsive": -9007199254740991, "versions": [ { "configVersion": -9007199254740991, "count": -9007199254740991 } ], "credentials": [ { "keyId": "string", "credential": "public", "count": -9007199254740991 } ] }}List environments GET
Returns every environment in the workspace, in workspace order (ascending `position`). Requires a management key.
Create an environment POST
Creates an environment and its public token. The new environment goes last in the workspace order. Every existing flag gets a copy of its values from the environment before it, but starts off, with no targeting rules. Later changes in that environment do not affect the copy. Requires a management key. Returns `409` if the key is already in use.