Mock Workspaces

sfp server API reference for Mock Workspaces: 10 endpoints.

POST/sfp/api/mocks/workspaces

Registers WireMock stubs for every service in the definition. Re-activation replaces the baseline but preserves session overrides by service name.

Authorization

access-token
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

curl -X POST "https://example.com/sfp/api/mocks/workspaces" \  -H "Content-Type: application/json" \  -d '{    "workspace": "string",    "context": {},    "services": [      {        "name": "string",        "namedCredential": "string",        "packageName": "string",        "specSource": "source",        "baselineRules": [          {            "request": {              "method": "string",              "path": "string"            }          }        ]      }    ]  }'
Empty
GET/sfp/api/mocks/workspaces

Authorization

access-token
AuthorizationBearer <token>

In: header

Response Body

curl -X GET "https://example.com/sfp/api/mocks/workspaces"
Empty
GET/sfp/api/mocks/workspaces/{workspace}

Authorization

access-token
AuthorizationBearer <token>

In: header

Path Parameters

workspace*string

Response Body

curl -X GET "https://example.com/sfp/api/mocks/workspaces/string"
Empty
DELETE/sfp/api/mocks/workspaces/{workspace}

restore=true reverts switched credentials first; force=true tears down even when restore fails.

Authorization

access-token
AuthorizationBearer <token>

In: header

Path Parameters

workspace*string

Query Parameters

restore*string
force*string

Response Body

curl -X DELETE "https://example.com/sfp/api/mocks/workspaces/string?restore=string&force=string"
Empty
PUT/sfp/api/mocks/workspaces/{workspace}/services/{service}/rules

Authorization

access-token
AuthorizationBearer <token>

In: header

Path Parameters

workspace*string
service*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

curl -X PUT "https://example.com/sfp/api/mocks/workspaces/string/services/string/rules" \  -H "Content-Type: application/json" \  -d '{    "rules": [      {        "request": {          "method": "string",          "path": "string"        }      }    ]  }'
Empty
DELETE/sfp/api/mocks/workspaces/{workspace}/services/{service}/rules

Authorization

access-token
AuthorizationBearer <token>

In: header

Path Parameters

workspace*string
service*string

Response Body

curl -X DELETE "https://example.com/sfp/api/mocks/workspaces/string/services/string/rules"
Empty
GET/sfp/api/mocks/workspaces/{workspace}/requests

Authorization

access-token
AuthorizationBearer <token>

In: header

Path Parameters

workspace*string

Query Parameters

service*string
since*string
limit*string

Response Body

curl -X GET "https://example.com/sfp/api/mocks/workspaces/string/requests?service=string&since=string&limit=string"
Empty
GET/sfp/api/mocks/workspaces/{workspace}/services/{service}/rules.yaml

Authorization

access-token
AuthorizationBearer <token>

In: header

Path Parameters

workspace*string
service*string

Response Body

curl -X GET "https://example.com/sfp/api/mocks/workspaces/string/services/string/rules.yaml"
Empty
POST/sfp/api/mocks/workspaces/{workspace}/switch-state

Called after the org-side switch so restore works from anywhere — first recorded original endpoint wins.

Authorization

access-token
AuthorizationBearer <token>

In: header

Path Parameters

workspace*string

Response Body

curl -X POST "https://example.com/sfp/api/mocks/workspaces/string/switch-state"
Empty
POST/sfp/api/mocks/workspaces/{workspace}/restore

Resolves review-environment auth from the workspace context; force continues past per-credential failures.

Authorization

access-token
AuthorizationBearer <token>

In: header

Path Parameters

workspace*string

Response Body

curl -X POST "https://example.com/sfp/api/mocks/workspaces/string/restore"
Empty