Docs · Integrations · Build, release and runtime

Split.IO

Split.IO feature flags, environments and change requests through the Split Admin API

Docs IntegrationsBuild, release and runtime Split.IO

Feature flags, environments and change requests on Split.IO (Harness FME), through the Admin API under /internal/api/v2. The reads list workspaces, environments, flags and change requests; every write files a change request that Split’s approvers then accept or reject. toil never changes a flag directly. Verification level: unit.

Supported versions: The oldest Split.IO Admin API version toil supports hasn’t been established. toil calls the Admin API under /internal/api/v2 with an Admin API key sent as a Bearer header. It has not been run against a live Split account yet.

Credential

A Split Admin API key: in Split, Admin settings → API keys → Create API key, with the type Admin. toil sends it as Authorization: Bearer <key>. There is no login and no token exchange.

Configuration

KeyEnv varRequiredMeaning
baseUrlTOIL_SPLITIO_BASE_URLyesAdmin API root, normally https://api.split.io
adminApiKeyTOIL_SPLITIO_ADMIN_API_KEYyesAdmin API key
workspaceTOIL_SPLITIO_WORKSPACEnoDefault Split workspace (project) ID, used when --ws is not given

There is no CI fallback variable.

export TOIL_SPLITIO_BASE_URL=https://api.split.io
export TOIL_SPLITIO_ADMIN_API_KEY=<your Admin API key>

Or ~/.toil/config.json:

{
  "version": 2,
  "connections": {
    "split": { "area": "splitio", "baseUrl": "https://api.split.io", "workspace": "<workspace id>" }
  }
}

The key never goes in this file; a plaintext one there is refused with CONFIG_INVALID. Run toil connections add split --area splitio to keep it in the OS credential store, or set TOIL_SPLITIO_ADMIN_API_KEY.

The workspace is --ws

Every command but workspace list and change-request get acts in one Split workspace: --ws <id>, else the connection’s workspace. Over MCP the field is workspace. On the CLI, --workspace is toil’s own flag for the folder commands may read files in, so --workspace <split id> doesn’t name the Split workspace; a command left without one fails with INVALID_INPUT saying to pass --ws.

Commands

Reads:

  • workspace list: List all Split.IO workspaces, every page.
  • environment list: List environments in a workspace.
  • flag list: List feature flags in a workspace. --limit (default 50, Split’s maximum) and --offset (default 0); data.totalCount is Split’s total. --flag-set is sent as flagSetName, which Split’s reference doesn’t document, so the result carries a warning to compare totalCount with an unfiltered list.
  • flag get <flag>: Get a flag, or with --environment its definition in that environment: treatments, rules, default rule, kill state.
  • change-request list: List Change Requests for a workspace (--environment, --status; Split returns REQUESTED ones when --status is unset). --limit defaults to 25 (Split allows 1 to 100). Split pages by marker: pass data.nextMarker (also meta.page.nextCursor) as --after for the next page. --offset accepts only 0, and totalCount is null, since Split reports none.
  • change-request get <id>: Get a Change Request by ID.

Writes, each a change request against one --environment. They need writes: true on the connection and --allow-write on the call. Every one takes --mnemonic (the title), --description (the comment), --change-number (added to the comment as “Change number: …”, since Split has no field for it), --approvers (comma-separated email addresses, only where the environment lets submitters choose) and --rollout-status <id> (a rollout status ID; Split’s guide says KILL doesn’t need one, and the others may).

  • flag update <flag>: Replace a flag’s definition with the JSON object in --input-file (- reads stdin on the CLI). Start from flag get <flag> --environment.
  • flag set-rule <flag>: Change rule --rule-index (from 0) to one --treatment (a 100% bucket) or --weights (a JSON array of {treatment, size}, sizes in percent; anything but an array is refused). The rest of the definition is copied from the current one.
  • flag set-default <flag>: Set the default rule to one --treatment at 100%.
  • flag toggle <flag>: --enabled false (or 0) kills the flag; any other value restores it, off and no included. A value other than true or 1 that restores adds a SPLITIO_TOGGLE_RESTORED warning to meta.warnings saying so.
  • flag toggle-many: One change request per entry of --input-file, a JSON array of {flag, enabled}, titled <mnemonic> — <flag>. A failed entry doesn’t stop the rest; it’s reported in results[] with ok: false, the envelope stays ok, and meta.warnings says how many failed. enabled is read by truthiness, so the string "false" restores. Every entry must have a flag name; if one doesn’t, the command fails with INVALID_INPUT naming the entry, before any request is filed.
  • flag kill <flag>, flag restore <flag>: Kill or restore a flag in the environment.
  • flag archive <flag>: Remove a flag’s definition from the environment (Split’s ARCHIVE change request; not Split’s flag-archive API). CLI only: it removes a definition, and deletes are never served over MCP.
toil splitio workspace list
toil splitio flag get new_checkout --ws <workspace id> --environment <environment id>
toil splitio flag kill new_checkout --ws <workspace id> --environment <environment id> \
  --mnemonic checkout-off --description "Kill during incident" --change-number CHG0001234 --allow-write

Settings at a glance

  • baseUrl required

    Admin API root, e.g. https://api.split.io

    TOIL_SPLITIO_BASE_URL

  • adminApiKey required secret

    Split Admin API key

    TOIL_SPLITIO_ADMIN_API_KEY

  • workspace

    Default Split workspace (project) ID, used when --ws is not given

    TOIL_SPLITIO_WORKSPACE

Commands at a glance

  • toil splitioworkspace list

    List all Split.IO workspaces

    MCP splitio_workspace_list

  • toil splitioenvironment list

    List environments in a workspace

    MCP splitio_environment_list--ws <id>

  • toil splitioflag list

    List feature flags in a workspace

    MCP splitio_flag_list--limit <n>--offset <n>--flag-set <name>--ws <id>

  • toil splitioflag get

    Get a flag definition

    MCP splitio_flag_get<flag>--environment <id>--ws <id>

  • toil splitioflag updatewrite

    Submit a Change Request to replace a flag's full definition in an environment

    MCP splitio_flag_update<flag>--environment <id>--mnemonic <text>--description <text>--change-number <CHG>--approvers <ids>--rollout-status <id>--input-file <path>--ws <id>--allow-write

  • toil splitioflag set-rulewrite

    Change one targeting rule without altering the rest of the flag definition

    MCP splitio_flag_set_rule<flag>--environment <id>--rule-index <n>--treatment <name>--weights <json>--mnemonic <text>--description <text>--change-number <CHG>--approvers <ids>--rollout-status <id>--ws <id>--allow-write

  • toil splitioflag set-defaultwrite

    Update the fallback default rule for traffic matching no targeting rule

    MCP splitio_flag_set_default<flag>--environment <id>--treatment <name>--mnemonic <text>--description <text>--change-number <CHG>--approvers <ids>--rollout-status <id>--ws <id>--allow-write

  • toil splitioflag togglewrite

    Enable or disable a single flag via a Change Request

    MCP splitio_flag_toggle<flag>--environment <id>--enabled <bool>--mnemonic <text>--description <text>--change-number <CHG>--approvers <ids>--rollout-status <id>--ws <id>--allow-write

  • toil splitioflag toggle-manywrite

    Enable or disable multiple flags from a JSON file (each creates its own Change Request)

    MCP splitio_flag_toggle_many--environment <id>--mnemonic <text>--description <text>--change-number <CHG>--approvers <ids>--rollout-status <id>--input-file <path>--ws <id>--allow-write

  • toil splitioflag killwrite

    Submit a Change Request to kill (disable) a flag

    MCP splitio_flag_kill<flag>--environment <id>--mnemonic <text>--description <text>--change-number <CHG>--approvers <ids>--rollout-status <id>--ws <id>--allow-write

  • toil splitioflag restorewrite

    Submit a Change Request to restore a killed flag

    MCP splitio_flag_restore<flag>--environment <id>--mnemonic <text>--description <text>--change-number <CHG>--approvers <ids>--rollout-status <id>--ws <id>--allow-write

  • toil splitioflag archivewriteCLI only

    Submit a Change Request to remove a flag's definition from an environment

    <flag>--environment <id>--mnemonic <text>--description <text>--change-number <CHG>--approvers <ids>--rollout-status <id>--ws <id>--allow-write

  • toil splitiochange-request list

    List Change Requests for a workspace

    MCP splitio_change_request_list--environment <id>--status <status>--limit <n>--offset <n>--after <marker>--ws <id>

  • toil splitiochange-request get

    Get a Change Request by ID

    MCP splitio_change_request_get<id>