Skip to main content

REST API Reference

Generated file: do not edit by hand. Run proxymock mcp openapi --markdown to regenerate it.

This is version 1.0.0 of the stable API that proxymock mcp run --http serves under /v1. How to start the server, authenticate and use jobs is in REST API for CI and scripts. The machine-readable contract is the OpenAPI document, also served at GET /v1/openapi.json. A running server also serves an interactive version of this page at /v1/docs, where you can send requests from the browser.

Every operation is a POST with a JSON object body. Unknown fields are rejected with 400. Operations marked job answer 202 with a job and put their result in the job's result field.

Snapshots​

POST /v1/snapshots/list​

List snapshots (snapshots.list).

Lists stored snapshots, newest first, in Speedscale cloud or in a bucket.

FieldTypeRequiredDescription
searchstringMatch snapshot names containing this text.
servicestringOnly snapshots with traffic for this service.
tagstringOnly snapshots with this build tag.
limitnumberMaximum snapshots to return (default 20, max 100).
bucketstringUse this bucket instead of Speedscale cloud. Credentials come from the standard AWS chain (S3) or Google Application Default Credentials (GCS). No Speedscale account is needed.
bucketProviderstringBucket storage provider: s3 (default) or gcs.
bucketPrefixstringKey prefix in the bucket. proxymock only writes and deletes under it.
regionstringBucket region. Defaults to the AWS SDK configuration.
s3EndpointUrlstringEndpoint of an S3-compatible store such as MinIO. Empty for AWS S3.
s3ForcePathStylebooleanUse path-style S3 addressing, often needed for MinIO.

Answers 200 with a SnapshotListResult.

POST /v1/snapshots/push​

Push a snapshot (snapshots.push). Job.

Uploads local RRPair directories as one new snapshot. Runs as a job.

FieldTypeRequiredDescription
inDirectoriesarray of stringyesDirectories of RRPair files to upload, read recursively.
namestringDisplay name for the snapshot.
samplestringKeep a deterministic fraction of the traffic, whole sessions at a time: "20%", "1/5" or "1 in 5".
maxRRPairsnumberAbove this many RRPairs, narrow the push to a representative time window that fits.
bucketstringUse this bucket instead of Speedscale cloud. Credentials come from the standard AWS chain (S3) or Google Application Default Credentials (GCS). No Speedscale account is needed.
bucketProviderstringBucket storage provider: s3 (default) or gcs.
bucketPrefixstringKey prefix in the bucket. proxymock only writes and deletes under it.
regionstringBucket region. Defaults to the AWS SDK configuration.
s3EndpointUrlstringEndpoint of an S3-compatible store such as MinIO. Empty for AWS S3.
s3ForcePathStylebooleanUse path-style S3 addressing, often needed for MinIO.

The job's result is a SnapshotPushResult.

POST /v1/snapshots/pull​

Pull a snapshot (snapshots.pull). Job.

Downloads a stored snapshot into local RRPair files that can be replayed and mocked. Runs as a job.

FieldTypeRequiredDescription
snapshotIdstringyesID of the snapshot to pull.
outDirectorystringWorkspace directory to expand the snapshot into. Defaults to ./proxymock.
forcebooleanOverwrite test configs in the workspace that differ from the snapshot's.
bucketstringUse this bucket instead of Speedscale cloud. Credentials come from the standard AWS chain (S3) or Google Application Default Credentials (GCS). No Speedscale account is needed.
bucketProviderstringBucket storage provider: s3 (default) or gcs.
bucketPrefixstringKey prefix in the bucket. proxymock only writes and deletes under it.
regionstringBucket region. Defaults to the AWS SDK configuration.
s3EndpointUrlstringEndpoint of an S3-compatible store such as MinIO. Empty for AWS S3.
s3ForcePathStylebooleanUse path-style S3 addressing, often needed for MinIO.

The job's result is a SnapshotPullResult.

POST /v1/snapshots/delete​

Delete a snapshot (snapshots.delete).

Deletes a stored snapshot. This cannot be undone, so confirm must be true.

FieldTypeRequiredDescription
snapshotIdstringyesID of the snapshot to delete.
confirmbooleanyesMust be true.
bucketstringUse this bucket instead of Speedscale cloud. Credentials come from the standard AWS chain (S3) or Google Application Default Credentials (GCS). No Speedscale account is needed.
bucketProviderstringBucket storage provider: s3 (default) or gcs.
bucketPrefixstringKey prefix in the bucket. proxymock only writes and deletes under it.
regionstringBucket region. Defaults to the AWS SDK configuration.
s3EndpointUrlstringEndpoint of an S3-compatible store such as MinIO. Empty for AWS S3.
s3ForcePathStylebooleanUse path-style S3 addressing, often needed for MinIO.

Answers 200 with a SnapshotDeleteResult.

Mocks​

POST /v1/mocks/start​

Start the mock server (mocks.start).

Starts the mock server on the outbound proxy port and answers once it accepts connections. Point the application under test at it with the returned environment variables. One mock server runs at a time.

FieldTypeRequiredDescription
inDirectoriesarray of stringyesDirectories of recorded RRPairs to answer from.
outDirectorystringDirectory to write the traffic the mock server served to. Score the replay's outbound calls from it.
mockTimingstringResponse timing: none, recorded, or a fixed duration.
faultsarray of stringFault specs, '<regexp>:action=value[,...]'.
chaosarray of stringChaos specs, '<filter query>:<effect>=<value>[,...]'.
responseSelectionstringHow to pick among several recorded responses for one request.

Answers 200 with a MockServerResult.

POST /v1/mocks/stop​

Stop the mock server (mocks.stop).

Stops the running mock server.

No request fields; send an empty body.

Answers 200 with a MockServerResult.

Replays​

POST /v1/replays/run​

Run a replay (replays.run). Job.

Replays recorded traffic against the application under test and scores the result. Runs as a job; the job's result has passed=false when a test config goal is missed or a fail-if condition triggers. One replay runs at a time.

FieldTypeRequiredDescription
inDirectoriesarray of stringyesDirectories of recorded RRPairs to replay.
testAgainstarray of stringWhere to send the requests: a URL, or host=URL pairs to route each recorded host.
outDirectorystringDirectory to write the observed traffic and replay-verdict.json to. Required unless noOut is true.
noOutbooleanWrite nothing to disk. The result then has no score.
testConfigstringTest config ID from the workspace: load shape, goals and assertions.
failIfarray of stringFail conditions such as "requests.failed > 0".
rewriteHostbooleanRewrite the Host header to the testAgainst host.
testsFilterstringFilter query selecting which recorded requests to replay.
vusnumberVirtual users replaying in parallel.
sessionsnumberSessions to replay in parallel.
forstringKeep replaying for this long, e.g. "5m".
timesnumberReplay the traffic this many times.
stagesarray of stringLoad stages such as "30s:10" (duration:virtual users).
loadTestbooleanLoad-test mode: skip response comparison to drive more load.
baselinestringOutput directory of an earlier replay to compare with.
failOnNewMismatchbooleanFail when a response differs that matched in the baseline.
verifyFixbooleanFail unless the responses that differed now match.
expectstringWith verifyFix: a pattern the fixed requests must match.
ignoreBodyChangesbooleanCompare status codes only, not bodies.
semanticbooleanScore response bodies by semantic similarity.
semanticPassnumberWith semantic: the similarity, 0 to 1, at or above which a body passes.
semanticFailnumberWith semantic: the similarity, 0 to 1, below which a body fails.
requireBlueprintsarray of stringTuning blueprints that must apply during the replay.

The job's result is a ReplayRunResult.

POST /v1/replays/score​

Score a replay (replays.score).

Scores a finished replay: accuracy, mock match rate, goals and the outbound HTTP assertion. Takes a local replay output directory or a pulled cloud report.

FieldTypeRequiredDescription
inputstringyesA replay output directory holding replay-verdict.json, a pulled report ID, or a pulled workspace.
baselinestringAn earlier replay or report to compare with.
workspacestringDirectory a bare report ID is looked up in.
mockRunstringThe mocked-* run that served the replay, when the time-overlap pairing picks the wrong one.
mocksOutstringThe mock server's outDirectory, to score the outbound HTTP assertion.

Answers 200 with a ReplayScore.

Jobs​

A job is a long-running operation. It lives in the server process and ends with it.

CallWhat it does
GET /v1/jobs/{id}The job. Add ?wait=<seconds> (at most 600) to block until it finishes. Answers 202 while it runs and 200 once it is done.
POST /v1/jobs/{id}/cancelStops a running job. A replay's process is killed.
GET /v1/jobsEvery job this server has run, newest first. The latest 100 finished jobs are kept.

Job​

FieldTypeDescription
createdstring (date-time)
error (optional)string
errorCode (optional)string
finished (optional)string (date-time)
idstring
operationstringoperationId of the call that started the job, e.g. replays.run.
result (optional)any
statusstring

Errors​

Every error answers with a JSON body that has an error message and, except for the access guard's 401 and 403, a code.

StatusCodeMeaning
400invalid_requestThe body or a query parameter is not valid for the operation.
401The access token is missing or wrong.
403The Host or Origin header names another site.
404not_foundNo such operation or job.
409conflictA mock server or a replay is already running.
422tool_errorThe request was valid, but the operation failed. The message says why.
500internalAn unexpected server error.

Result types​

The results of the operations above and the types they use. New fields can appear in a minor version, so ignore fields you do not know.

MockServerResult​

FieldTypeDescription
env (optional)map of stringEnvironment variables that point an application at the mock server.
inDirectories (optional)array of stringDirectories the mock responses come from.
outDirectory (optional)stringDirectory the mock server writes the traffic it served to.
proxyUrl (optional)stringOutbound proxy the application under test must send its dependency calls through.
runningbooleanWhether the mock server is running after the call.

MocksSQLCorrectness​

FieldTypeDescription
bindDriftinteger
checkedinteger
exactinteger
fallbackinteger
fallbackByTier (optional)map of integer
orderDependent (optional)integer
statements (optional)array of MocksSQLStatement
unverified (optional)integer
writesWithNewValues (optional)integer

MocksSQLStatement​

FieldTypeDescription
applied (optional)boolean
bindDriftinteger
exactinteger
fallbackinteger
keyParams (optional)array of integer
orderDependent (optional)integer
reason (optional)string
recommendationId (optional)string
servicestring
statementstring

ProcessLogs​

FieldTypeDescription
stderr (optional)string
stdout (optional)string

ReplayRunResult​

FieldTypeDescription
exitCodeintegerExit code of proxymock replay. 0 passed; 1 means a test config goal was missed, a fail-if condition triggered, or the replay failed.
logsProcessLogs
outDirectory (optional)stringDirectory the observed traffic and replay-verdict.json were written to.
passedbooleanTrue when exitCode is 0. Fail the CI job when this is false.
score (optional)ReplayScoreThe replay scored as replays.score scores it.
scoreError (optional)string

ReplayScore​

FieldTypeDescription
accuracyScoreAccuracy
baseline (optional)ReplayScore
deltas (optional)ScoreDeltas
goalsScoreGoals
httpOutput (optional)ScoreHttpOutput
inputScoreInput
matchRateScoreMatchRate
notes (optional)array of string
sourcesmap of string

ScoreAccuracy​

FieldTypeDescription
bodyMismatchesinteger
matchedinteger
mismatchesinteger
pairsinteger
ratenumber
reportSuccessRate (optional)number
statusMismatchesinteger
topFailingEndpointsarray of ScoreEndpointFailures
unpaired (optional)integer

ScoreAccuracyDeltas​

FieldTypeDescription
bodyMismatchesinteger
matchedinteger
mismatchesinteger
pairsinteger
ratenumber
statusMismatchesinteger

ScoreDeltas​

FieldTypeDescription
accuracy (optional)ScoreAccuracyDeltas
goals (optional)ScoreGoalDeltas
matchRate (optional)ScoreMatchRateDeltas

ScoreEndpointFailures​

FieldTypeDescription
bodyMismatchesinteger
endpointstring
failuresinteger
method (optional)string
statusMismatchesinteger

ScoreGoal​

FieldTypeDescription
conditionstring
metricstring
namestring
observed (optional)string
reason (optional)string
statusstring

ScoreGoalDeltas​

FieldTypeDescription
failedinteger
passedinteger
verdictChanged (optional)string

ScoreGoals​

FieldTypeDescription
failedinteger
goalsarray of ScoreGoal
notEvaluated (optional)integer
passedinteger
verdictstring

ScoreHostCount​

FieldTypeDescription
countinteger
hoststring

ScoreHttpOutput​

FieldTypeDescription
differences (optional)map of integer
reason (optional)string
statusstring

ScoreInput​

FieldTypeDescription
kindstring
pathstring
reportId (optional)string
status (optional)string
workspace (optional)string

ScoreMatchRate​

FieldTypeDescription
analysis (optional)ScoreMatchRateAnalysis
matchedinteger
mockRun (optional)string
mockRunSelection (optional)string
noMatchinteger
noMatchRatenumber
passthroughinteger
passthroughRatenumber
ratenumber
topMissingHostsarray of ScoreHostCount
topMissingSignaturesarray of ScoreMissingSignature
totalinteger

ScoreMatchRateAnalysis​

FieldTypeDescription
blueprintsAppliedinteger
projectedMatchedinteger
projectedMisses (optional)array of ScoreMissingSignature
projectedNoMatchinteger
projectedRateinteger
reportMatchedinteger
reportNoMatchinteger
reportRateinteger
sqlCorrectness (optional)MocksSQLCorrectness
totalinteger

ScoreMatchRateDeltas​

FieldTypeDescription
matchedinteger
noMatchinteger
noMatchRatenumber
passthroughinteger
passthroughRatenumber
ratenumber
totalinteger

ScoreMissingSignature​

FieldTypeDescription
command (optional)string
countinteger
host (optional)string
pathstring

SnapshotDeleteResult​

FieldTypeDescription
deletedboolean
destinationstring
idstring

SnapshotListResult​

FieldTypeDescription
destinationstringWhere the snapshots are stored: cloud or a bucket location.
snapshotsarray of SnapshotSummarySnapshots, newest first.

SnapshotPullResult​

FieldTypeDescription
directorystringDirectory holding the snapshot's RRPair files.
idstring
name (optional)string
services (optional)array of string
sourcestringWhere it was pulled from: cloud or a bucket location.
testConfigs (optional)array of stringTest configs restored into the workspace.
warnings (optional)array of string
workspacestringWorkspace root to replay or mock against.

SnapshotPushResult​

FieldTypeDescription
cloudAnalysisPendingbooleanTrue for a cloud snapshot: it becomes replayable in the cloud when analysis completes.
destinationstringWhere it was stored: cloud or a bucket location.
idstringID of the new snapshot.
name (optional)string
rrpairsintegerNumber of RRPairs uploaded.
services (optional)array of string
testConfigs (optional)array of stringTest configs uploaded with the snapshot.
url (optional)stringDashboard URL for a cloud snapshot, or the object location for a bucket.
warnings (optional)array of string
window (optional)SnapshotWindowSet when maxRRPairs narrowed the push to a time window.

SnapshotSummary​

FieldTypeDescription
buildTag (optional)stringBuild tag the snapshot was recorded with.
created (optional)string (date-time)When the snapshot was created.
idstringSnapshot ID.
name (optional)stringDisplay name, when one was given.
services (optional)array of stringServices with traffic in the snapshot.
status (optional)stringCloud analysis status, e.g. COMPLETE.

SnapshotWindow​

FieldTypeDescription
coveragenumberFraction of the operations in the full recording that the window covers, 0 to 1.
endstring (date-time)
startstring (date-time)