Scenarios
Discover scenario ids and names for your CI setup.
On this page
Before you can PUT a scenario onto a session, you need its id. This endpoint lists what's available.
GET /scenarios
bash
curl "$BASE/scenarios?project=checkout&environment=staging&limit=50" \
-H "Authorization: Bearer $KEY"Query parameters
| Param | Default | Notes |
|---|---|---|
project | — | Required for org-wide keys |
environment | — | Required for multi-endpoint projects |
limit | 50 | 1–100 |
search | — | Filter by name |
Response
json
{
"scenarios": [
{ "id": "scn_paymentDeclined", "name": "Payment declined", "urlId": "payment-declined" }
],
"nextBefore": null
}nextBefore is a pagination cursor. Pass it as before on the next request for older results (when implemented in your client loop).
Using a scenario
Take the id and set it on a session:
bash
curl -X PUT "$BASE/sessions/ci-42" \
-H "Authorization: Bearer $KEY" \
-H "Content-Type: application/json" \
-d '{"project":"checkout","environment":"staging","scenario":"scn_paymentDeclined"}'See Sessions for the full PUT reference.
Product context
Scenarios bundle mocks into switchable presets. Learn how scenarios work →
Related
- Sessions — activate a scenario on a session
- API overview