Overrides

Enable or disable individual mocks on a session — without replacing the whole set.

On this page

Sometimes you want one extra mock on top of a scenario, or a surgical toggle without rewriting the full overrides array. These endpoints do exactly that.

POST /sessions/:sessionKey/overrides/:overrideId

Enable one published mock for the session. Creates the session if it doesn't exist. Idempotent.

bash
curl -X POST "$BASE/sessions/ci-42/overrides/ovr_extraMock?project=checkout&environment=staging" \
  -H "Authorization: Bearer $KEY"

Response:

json
{ "overrideId": "ovr_extraMock", "active": true }

Errors

  • 404 not_found — override doesn't exist
  • 422 invalid_override — scenario-local override (can't toggle individually) or bad id

DELETE /sessions/:sessionKey/overrides/:overrideId

Disable one mock for the session.

bash
curl -X DELETE "$BASE/sessions/ci-42/overrides/ovr_extraMock?project=checkout&environment=staging" \
  -H "Authorization: Bearer $KEY"

Response:

json
{ "overrideId": "ovr_extraMock", "active": false }

Overrides vs PUT

ApproachBest for
PUT with overrides arrayDeclarative exact-set — "these and only these"
POST / DELETE per overrideIncremental tweaks on top of a scenario

Product context

Mocks must be published before they can be activated. Mocks and overrides guide →