Skip to main content

Mock server

Generated from apiome-rest/openapi.yaml (API version 1.204.1) — do not edit by hand. How to authenticate is on the REST API reference.

Tag: mock-server · 20 operations

GET /v1/mock/{mock_id}​

Serve Mock Root Get

Serve the mock for a request to the instance root path.

Operation id: serve_mock_root_get_v1_mock__mock_id__get

Parameters

NameInTypeRequiredDescription
mock_idpathstringyesPath parameter identifying the mock id segment.

Responses

StatusDescriptionBody
200Successful response for serve mock root get.application/json any
422Validation Errorapplication/json HTTPValidationError

PUT /v1/mock/{mock_id}​

Serve Mock Root Put

Serve the mock for a request to the instance root path.

Operation id: serve_mock_root_put_v1_mock__mock_id__put

Parameters

NameInTypeRequiredDescription
mock_idpathstringyesPath parameter identifying the mock id segment.

Responses

StatusDescriptionBody
200Successful response for serve mock root put.application/json any
422Validation Errorapplication/json HTTPValidationError

POST /v1/mock/{mock_id}​

Serve Mock Root Post

Serve the mock for a request to the instance root path.

Operation id: serve_mock_root_post_v1_mock__mock_id__post

Parameters

NameInTypeRequiredDescription
mock_idpathstringyesPath parameter identifying the mock id segment.

Responses

StatusDescriptionBody
200Successful response for serve mock root post.application/json any
422Validation Errorapplication/json HTTPValidationError

PATCH /v1/mock/{mock_id}​

Serve Mock Root Patch

Serve the mock for a request to the instance root path.

Operation id: serve_mock_root_patch_v1_mock__mock_id__patch

Parameters

NameInTypeRequiredDescription
mock_idpathstringyesPath parameter identifying the mock id segment.

Responses

StatusDescriptionBody
200Successful response for serve mock root patch.application/json any
422Validation Errorapplication/json HTTPValidationError

DELETE /v1/mock/{mock_id}​

Serve Mock Root Delete

Serve the mock for a request to the instance root path.

Operation id: serve_mock_root_delete_v1_mock__mock_id__delete

Parameters

NameInTypeRequiredDescription
mock_idpathstringyesPath parameter identifying the mock id segment.

Responses

StatusDescriptionBody
200Successful response for serve mock root delete.application/json any
422Validation Errorapplication/json HTTPValidationError

HEAD /v1/mock/{mock_id}​

Serve Mock Root Head

Serve the mock for a request to the instance root path.

Operation id: serve_mock_root_head_v1_mock__mock_id__head

Parameters

NameInTypeRequiredDescription
mock_idpathstringyesPath parameter identifying the mock id segment.

Responses

StatusDescriptionBody
200Successful response for serve mock root head.application/json any
422Validation Errorapplication/json HTTPValidationError

OPTIONS /v1/mock/{mock_id}​

Serve Mock Root Options

Serve the mock for a request to the instance root path.

Operation id: serve_mock_root_options_v1_mock__mock_id__options

Parameters

NameInTypeRequiredDescription
mock_idpathstringyesPath parameter identifying the mock id segment.

Responses

StatusDescriptionBody
200Successful response for serve mock root options.application/json any
422Validation Errorapplication/json HTTPValidationError

GET /v1/mock/{mock_id}/{sub_path}​

Serve Mock Path Get

Serve the mock for any request path under the instance base URL.

Operation id: serve_mock_path_get_v1_mock__mock_id___sub_path__get

Parameters

NameInTypeRequiredDescription
mock_idpathstringyesPath parameter identifying the mock id segment.
sub_pathpathstringyesPath parameter identifying the sub path segment.

Responses

StatusDescriptionBody
200Successful response for serve mock path get.application/json any
422Validation Errorapplication/json HTTPValidationError

PUT /v1/mock/{mock_id}/{sub_path}​

Serve Mock Path Put

Serve the mock for any request path under the instance base URL.

Operation id: serve_mock_path_put_v1_mock__mock_id___sub_path__put

Parameters

NameInTypeRequiredDescription
mock_idpathstringyesPath parameter identifying the mock id segment.
sub_pathpathstringyesPath parameter identifying the sub path segment.

Responses

StatusDescriptionBody
200Successful response for serve mock path put.application/json any
422Validation Errorapplication/json HTTPValidationError

POST /v1/mock/{mock_id}/{sub_path}​

Serve Mock Path Post

Serve the mock for any request path under the instance base URL.

Operation id: serve_mock_path_post_v1_mock__mock_id___sub_path__post

Parameters

NameInTypeRequiredDescription
mock_idpathstringyesPath parameter identifying the mock id segment.
sub_pathpathstringyesPath parameter identifying the sub path segment.

Responses

StatusDescriptionBody
200Successful response for serve mock path post.application/json any
422Validation Errorapplication/json HTTPValidationError

PATCH /v1/mock/{mock_id}/{sub_path}​

Serve Mock Path Patch

Serve the mock for any request path under the instance base URL.

Operation id: serve_mock_path_patch_v1_mock__mock_id___sub_path__patch

Parameters

NameInTypeRequiredDescription
mock_idpathstringyesPath parameter identifying the mock id segment.
sub_pathpathstringyesPath parameter identifying the sub path segment.

Responses

StatusDescriptionBody
200Successful response for serve mock path patch.application/json any
422Validation Errorapplication/json HTTPValidationError

DELETE /v1/mock/{mock_id}/{sub_path}​

Serve Mock Path Delete

Serve the mock for any request path under the instance base URL.

Operation id: serve_mock_path_delete_v1_mock__mock_id___sub_path__delete

Parameters

NameInTypeRequiredDescription
mock_idpathstringyesPath parameter identifying the mock id segment.
sub_pathpathstringyesPath parameter identifying the sub path segment.

Responses

StatusDescriptionBody
200Successful response for serve mock path delete.application/json any
422Validation Errorapplication/json HTTPValidationError

HEAD /v1/mock/{mock_id}/{sub_path}​

Serve Mock Path Head

Serve the mock for any request path under the instance base URL.

Operation id: serve_mock_path_head_v1_mock__mock_id___sub_path__head

Parameters

NameInTypeRequiredDescription
mock_idpathstringyesPath parameter identifying the mock id segment.
sub_pathpathstringyesPath parameter identifying the sub path segment.

Responses

StatusDescriptionBody
200Successful response for serve mock path head.application/json any
422Validation Errorapplication/json HTTPValidationError

OPTIONS /v1/mock/{mock_id}/{sub_path}​

Serve Mock Path Options

Serve the mock for any request path under the instance base URL.

Operation id: serve_mock_path_options_v1_mock__mock_id___sub_path__options

Parameters

NameInTypeRequiredDescription
mock_idpathstringyesPath parameter identifying the mock id segment.
sub_pathpathstringyesPath parameter identifying the sub path segment.

Responses

StatusDescriptionBody
200Successful response for serve mock path options.application/json any
422Validation Errorapplication/json HTTPValidationError

GET /v1/mocks/{tenant_slug}​

List Mocks

List the tenant's mock instances, newest first.

Operation id: list_mocks_v1_mocks__tenant_slug__get

Parameters

NameInTypeRequiredDescription
tenant_slugpathstringyesURL-safe tenant slug that scopes the request.
authorizationheaderstring or nullnoJWT bearer token for authenticated access (Authorization: Bearer <token>).
X-API-Keyheaderstring or nullnoTenant-scoped API key used as an alternative to JWT bearer authentication.

Responses

StatusDescriptionBody
200Successful response for list mocks.application/json array of MockInstanceResponse
422Validation Errorapplication/json HTTPValidationError

POST /v1/mocks/{tenant_slug}​

Provision Mock

Provision a mock instance from a published version and return its stable base URL.

The version must be published. Its OpenAPI document is generated once and frozen into the instance so the mock is stable for its lifetime. Free-tier expiry and the per-instance rate limit are applied from configuration (overridable within bounds).

Caller-supplied scenarios keep the RC1-2.2 request shape — a list of rules — and are folded into the engine's settings shape at provision time (#5532, MSC-2.2), with the same translator that migrates instances provisioned before the fold. Rules that cannot be translated are reported on the instance rather than dropped.

Operation id: provision_mock_v1_mocks__tenant_slug__post

Parameters

NameInTypeRequiredDescription
tenant_slugpathstringyesURL-safe tenant slug that scopes the request.
authorizationheaderstring or nullnoJWT bearer token for authenticated access (Authorization: Bearer <token>).
X-API-Keyheaderstring or nullnoTenant-scoped API key used as an alternative to JWT bearer authentication.

Request body (required)

Request body for provision mock.

Responses

StatusDescriptionBody
201Successful response for provision mock.application/json MockInstanceResponse
422Validation Errorapplication/json HTTPValidationError

GET /v1/mocks/{tenant_slug}/usage​

Get Mock Usage

Return mock usage counters and daily rollups for the tenant (#4420, SIM-1.5).

Note: project_slug and version_label filter the dailyRollups only. monthlyRequestCount, monthlyQuota, and mockRps are always tenant-wide totals, regardless of any filter parameters.

Operation id: get_mock_usage_v1_mocks__tenant_slug__usage_get

Parameters

NameInTypeRequiredDescription
tenant_slugpathstringyesURL-safe tenant slug that scopes the request.
daysqueryintegernoQuery parameter: days.
project_slugquerystring or nullnoURL-safe project slug within the tenant.
version_labelquerystring or nullnoQuery parameter: version label.
authorizationheaderstring or nullnoJWT bearer token for authenticated access (Authorization: Bearer <token>).
X-API-Keyheaderstring or nullnoTenant-scoped API key used as an alternative to JWT bearer authentication.

Responses

StatusDescriptionBody
200Successful response for get mock usage.application/json MockUsageResponse
422Validation Errorapplication/json HTTPValidationError

GET /v1/mocks/{tenant_slug}/{mock_id}​

Get Mock

Inspect one mock instance owned by the tenant.

Operation id: get_mock_v1_mocks__tenant_slug___mock_id__get

Parameters

NameInTypeRequiredDescription
tenant_slugpathstringyesURL-safe tenant slug that scopes the request.
mock_idpathstringyesPath parameter identifying the mock id segment.
authorizationheaderstring or nullnoJWT bearer token for authenticated access (Authorization: Bearer <token>).
X-API-Keyheaderstring or nullnoTenant-scoped API key used as an alternative to JWT bearer authentication.

Responses

StatusDescriptionBody
200Successful response for get mock.application/json MockInstanceResponse
422Validation Errorapplication/json HTTPValidationError

DELETE /v1/mocks/{tenant_slug}/{mock_id}​

Destroy Mock

Destroy a mock instance and all of its state.

Operation id: destroy_mock_v1_mocks__tenant_slug___mock_id__delete

Parameters

NameInTypeRequiredDescription
tenant_slugpathstringyesURL-safe tenant slug that scopes the request.
mock_idpathstringyesPath parameter identifying the mock id segment.
authorizationheaderstring or nullnoJWT bearer token for authenticated access (Authorization: Bearer <token>).
X-API-Keyheaderstring or nullnoTenant-scoped API key used as an alternative to JWT bearer authentication.

Responses

StatusDescriptionBody
204Successful response for destroy mock.—
422Validation Errorapplication/json HTTPValidationError

PUT /v1/mocks/{tenant_slug}/{mock_id}/active-scenario​

Switch Active Scenario

Switch the instance's default scenario (takes effect immediately, no restart).

The switch writes activeScenario into the instance's settings — the same key, read the same way, as a version's stored active scenario (#5531, MSC-2.1). The two spellings that used to describe this one concept are now one.

Operation id: switch_active_scenario_v1_mocks__tenant_slug___mock_id__active_scenario_put

Parameters

NameInTypeRequiredDescription
tenant_slugpathstringyesURL-safe tenant slug that scopes the request.
mock_idpathstringyesPath parameter identifying the mock id segment.
authorizationheaderstring or nullnoJWT bearer token for authenticated access (Authorization: Bearer <token>).
X-API-Keyheaderstring or nullnoTenant-scoped API key used as an alternative to JWT bearer authentication.

Request body (required)

Request body for switch active scenario.

Responses

StatusDescriptionBody
200Successful response for switch active scenario.application/json MockInstanceResponse
422Validation Errorapplication/json HTTPValidationError

Schemas used​

HTTPValidationError​

Validation error response emitted when request data fails schema checks.

PropertyTypeRequiredDescription
detailarray of ValidationErrornoDetail.

MockInstanceResponse​

Public view of a provisioned mock instance.

PropertyTypeRequiredDescription
idstringyesStable resource identifier.
namestringyesHuman-readable name.
baseUrlstringyesBase URL.
tenantSlugstringyesTenant Slug.
projectSlugstringyesProject Slug.
versionSlugstringyesVersion Slug.
statusstringyesStatus.
activeScenariostringyesActive Scenario.
scenariosarray of stringyesScenarios.
operationCountintegeryesNumber of operation.
rateLimitPerMinuteintegeryesRate Limit Per Minute.
requestCountintegeryesNumber of request.
createdAtstring or nullnoCreated At.
expiresAtstring or nullnoExpires At.
lastActivityAtstring or nullnoLast Activity At.
migrationNotesarray of stringnoRules from the pre-#5532 configuration that could not be translated onto the single mock engine, reported rather than silently dropped. Empty when the fold was lossless.

MockProvisionRequest​

Request body to provision a mock instance from a published version.

PropertyTypeRequiredDescription
projectSlugstringyesProject Slug.
versionSlugstringyesVersion Slug.
namestring or nullnoDisplay name; defaults to the coordinates.
ttlHoursinteger or nullnoAuto-expiry in hours; clamped to the configured maximum.
rateLimitPerMinuteinteger or nullnoRate Limit Per Minute.
seedinteger or nullnoDeterministic data-generation seed.
scenariosarray of MockScenario or nullnoScenarios.
activeScenariostring or nullnoActive Scenario.

MockScenarioSwitchRequest​

Request body to switch a mock instance's active scenario.

PropertyTypeRequiredDescription
activeScenariostringyesActive Scenario.

MockUsageResponse​

Mock usage counters for a tenant (#4420, SIM-1.5).

PropertyTypeRequiredDescription
monthlyRequestCountintegeryesNumber of monthly request.
monthlyQuotaintegeryesMonthly Quota.
mockRpsnumberyesMock Rps.
dailyRollupsarray of MockUsageDailyRollupyesDaily Rollups.