> For the complete documentation index, see [llms.txt](https://docs.flxbl.io/flxbl/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flxbl.io/flxbl/sfp-server/api-reference/mock-scenarios.md).

# Mock Scenarios

## GET /sfp/api/mocks/workspaces/{workspace}/scenarios

> List scenarios for a workspace

```json
{"openapi":"3.0.0","info":{"title":"sfp server","version":"51.40.2"},"security":[{"access-token":[]}],"components":{"securitySchemes":{"access-token":{"scheme":"bearer","bearerFormat":"JWT","type":"http","in":"header"}}},"paths":{"/sfp/api/mocks/workspaces/{workspace}/scenarios":{"get":{"operationId":"MocksScenariosController_list","summary":"List scenarios for a workspace","parameters":[{"name":"workspace","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Scenario summaries"},"403":{"description":"Forbidden - Requires role: owner, member, application"}},"tags":["Mock Scenarios"]}}}}
```

## POST /sfp/api/mocks/workspaces/{workspace}/scenarios

> Start capturing a scenario

```json
{"openapi":"3.0.0","info":{"title":"sfp server","version":"51.40.2"},"security":[{"access-token":[]}],"components":{"securitySchemes":{"access-token":{"scheme":"bearer","bearerFormat":"JWT","type":"http","in":"header"}},"schemas":{"StartScenarioDto":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]}}},"paths":{"/sfp/api/mocks/workspaces/{workspace}/scenarios":{"post":{"operationId":"MocksScenariosController_start","summary":"Start capturing a scenario","parameters":[{"name":"workspace","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartScenarioDto"}}}},"responses":{"201":{"description":"Recording started"},"403":{"description":"Forbidden - Requires role: owner, member, application"}},"tags":["Mock Scenarios"]}}}}
```

## POST /sfp/api/mocks/workspaces/{workspace}/scenarios/{name}/stop

> Stop capturing — journal slice becomes steps

```json
{"openapi":"3.0.0","info":{"title":"sfp server","version":"51.40.2"},"security":[{"access-token":[]}],"components":{"securitySchemes":{"access-token":{"scheme":"bearer","bearerFormat":"JWT","type":"http","in":"header"}}},"paths":{"/sfp/api/mocks/workspaces/{workspace}/scenarios/{name}/stop":{"post":{"operationId":"MocksScenariosController_stop","summary":"Stop capturing — journal slice becomes steps","parameters":[{"name":"workspace","required":true,"in":"path","schema":{"type":"string"}},{"name":"name","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Scenario captured with step summary"},"403":{"description":"Forbidden - Requires role: owner, member, application"}},"tags":["Mock Scenarios"]}}}}
```

## GET /sfp/api/mocks/workspaces/{workspace}/scenarios/{name}

> Get a scenario with steps

```json
{"openapi":"3.0.0","info":{"title":"sfp server","version":"51.40.2"},"security":[{"access-token":[]}],"components":{"securitySchemes":{"access-token":{"scheme":"bearer","bearerFormat":"JWT","type":"http","in":"header"}}},"paths":{"/sfp/api/mocks/workspaces/{workspace}/scenarios/{name}":{"get":{"operationId":"MocksScenariosController_get","summary":"Get a scenario with steps","parameters":[{"name":"workspace","required":true,"in":"path","schema":{"type":"string"}},{"name":"name","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Full scenario"},"403":{"description":"Forbidden - Requires role: owner, member, application"}},"tags":["Mock Scenarios"]}}}}
```

## DELETE /sfp/api/mocks/workspaces/{workspace}/scenarios/{name}

> Delete a scenario

```json
{"openapi":"3.0.0","info":{"title":"sfp server","version":"51.40.2"},"security":[{"access-token":[]}],"components":{"securitySchemes":{"access-token":{"scheme":"bearer","bearerFormat":"JWT","type":"http","in":"header"}}},"paths":{"/sfp/api/mocks/workspaces/{workspace}/scenarios/{name}":{"delete":{"operationId":"MocksScenariosController_remove","summary":"Delete a scenario","parameters":[{"name":"workspace","required":true,"in":"path","schema":{"type":"string"}},{"name":"name","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Scenario removed"},"403":{"description":"Forbidden - Requires role: owner, member, application"}},"tags":["Mock Scenarios"]}}}}
```

## PUT /sfp/api/mocks/workspaces/{workspace}/scenarios/{name}/steps/{seq}

> Edit a step's replayed response

```json
{"openapi":"3.0.0","info":{"title":"sfp server","version":"51.40.2"},"security":[{"access-token":[]}],"components":{"securitySchemes":{"access-token":{"scheme":"bearer","bearerFormat":"JWT","type":"http","in":"header"}},"schemas":{"EditStepDto":{"type":"object","properties":{"response":{"type":"object","properties":{"status":{"type":"number"},"body":{},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"delayMs":{"type":"number"}},"selfRequired":true}},"required":["response"]}}},"paths":{"/sfp/api/mocks/workspaces/{workspace}/scenarios/{name}/steps/{seq}":{"put":{"operationId":"MocksScenariosController_editStep","summary":"Edit a step's replayed response","parameters":[{"name":"workspace","required":true,"in":"path","schema":{"type":"string"}},{"name":"name","required":true,"in":"path","schema":{"type":"string"}},{"name":"seq","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditStepDto"}}}},"responses":{"200":{"description":"Step updated"},"403":{"description":"Forbidden - Requires role: owner, member, application"}},"tags":["Mock Scenarios"]}}}}
```

## POST /sfp/api/mocks/workspaces/{workspace}/scenarios/{name}/arm

> Arm — replay this scenario on the next clickthrough

```json
{"openapi":"3.0.0","info":{"title":"sfp server","version":"51.40.2"},"security":[{"access-token":[]}],"components":{"securitySchemes":{"access-token":{"scheme":"bearer","bearerFormat":"JWT","type":"http","in":"header"}}},"paths":{"/sfp/api/mocks/workspaces/{workspace}/scenarios/{name}/arm":{"post":{"operationId":"MocksScenariosController_arm","summary":"Arm — replay this scenario on the next clickthrough","parameters":[{"name":"workspace","required":true,"in":"path","schema":{"type":"string"}},{"name":"name","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Scenario armed; per-service stub counts"},"403":{"description":"Forbidden - Requires role: owner, member, application"}},"tags":["Mock Scenarios"]}}}}
```

## DELETE /sfp/api/mocks/workspaces/{workspace}/scenarios/{name}/arm

> Disarm — baseline rules apply again

```json
{"openapi":"3.0.0","info":{"title":"sfp server","version":"51.40.2"},"security":[{"access-token":[]}],"components":{"securitySchemes":{"access-token":{"scheme":"bearer","bearerFormat":"JWT","type":"http","in":"header"}}},"paths":{"/sfp/api/mocks/workspaces/{workspace}/scenarios/{name}/arm":{"delete":{"operationId":"MocksScenariosController_disarm","summary":"Disarm — baseline rules apply again","parameters":[{"name":"workspace","required":true,"in":"path","schema":{"type":"string"}},{"name":"name","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Scenario disarmed"},"403":{"description":"Forbidden - Requires role: owner, member, application"}},"tags":["Mock Scenarios"]}}}}
```

## POST /sfp/api/mocks/workspaces/{workspace}/scenarios/{name}/rewind

> Rewind sequences to the first response

```json
{"openapi":"3.0.0","info":{"title":"sfp server","version":"51.40.2"},"security":[{"access-token":[]}],"components":{"securitySchemes":{"access-token":{"scheme":"bearer","bearerFormat":"JWT","type":"http","in":"header"}}},"paths":{"/sfp/api/mocks/workspaces/{workspace}/scenarios/{name}/rewind":{"post":{"operationId":"MocksScenariosController_rewind","summary":"Rewind sequences to the first response","parameters":[{"name":"workspace","required":true,"in":"path","schema":{"type":"string"}},{"name":"name","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Sequences restarted"},"403":{"description":"Forbidden - Requires role: owner, member, application"}},"tags":["Mock Scenarios"]}}}}
```

## GET /sfp/api/mocks/workspaces/{workspace}/scenarios/{name}/export.yaml

> Export as a committable scenario playbook

```json
{"openapi":"3.0.0","info":{"title":"sfp server","version":"51.40.2"},"security":[{"access-token":[]}],"components":{"securitySchemes":{"access-token":{"scheme":"bearer","bearerFormat":"JWT","type":"http","in":"header"}}},"paths":{"/sfp/api/mocks/workspaces/{workspace}/scenarios/{name}/export.yaml":{"get":{"operationId":"MocksScenariosController_exportYaml","summary":"Export as a committable scenario playbook","parameters":[{"name":"workspace","required":true,"in":"path","schema":{"type":"string"}},{"name":"name","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"scenario yaml"},"403":{"description":"Forbidden - Requires role: owner, member, application"}},"tags":["Mock Scenarios"]}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.flxbl.io/flxbl/sfp-server/api-reference/mock-scenarios.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
