Dashboard
Environments

List live connections

GET
/api/v1/environments/{environmentId}/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.

Authorization

bearer
headerAuthorizationBearer <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.

Path Parameters

environmentId*string

The environment ID, such as env_….

Response Body

OK

application/json
  1. response

The live connections of one environment, and the config version each was last sent.

environmentId*string

The environment ID, such as env_….

tracked*boolean

Whether this API tracks live connections. The hosted API does. A self-hosted Node.js API does not, and returns false with empty counts.

configVersion*integer

The environment's current config version. A connection with this version was sent the latest flag configuration.

Range-9007199254740991 <= value <= 9007199254740991
observedAt*string

When 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*integer

The number of server SDK connections.

Range-9007199254740991 <= value <= 9007199254740991
browsers*

Clients connected to the evaluation stream, such as the browser SDK. Toggld evaluates flags for them. They are anonymous, so only counts are returned.

Example Request
curl -X GET 'https://api.toggld.io/api/v1/environments/string/connections'
Example Response
{  "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      }    ]  }}