Create and deploy a virtual service
Before you start
Section titled “Before you start”You need a place to run it: either MaxoPerf shared (always available, zero setup) or your own datacenter, a private datacenter you’ve connected with an Outpost agent. You can create a virtual service and define its transactions without one, but you cannot start it until you choose where it runs.
Create a virtual service
Section titled “Create a virtual service”- Open Virtual services in the left navigation, and click New virtual service.
- Give it a name and select or create the transaction group that becomes its home group (transactions you build on the fly land there by default; see Compose & transaction groups).
- Save. MaxoPerf creates the virtual service as a Draft: it has never been started. No workload runs yet, and it has no live endpoint.
Create it from a REST API request
Section titled “Create it from a REST API request”curl -X POST https://app.maxoperf.com/v1/virtual-services \ -H "Authorization: Bearer mpak_example_key" \ -H "X-Account-Id: acn-1234567890" \ -H "Content-Type: application/json" \ -d '{ "workspaceId": "ws_01J...", "serviceId": "vssvc_01J...", "name": "payments-sandbox-mock", "placement": { "privateDatacenterId": "pdc-1163a00001" }, "noMatch": { "policy": "notFound" }, "idleShutdownMinutes": 30 }'placement.privateDatacenterId is required. Every virtual service runs as its own pod on the
private datacenter you pick, so a service created without a usable datacenter could never deploy.
If you omit it, or name a datacenter your account cannot use, the API returns
400 VS_CONFIG_INCOMPLETE and creates nothing. List the ids you can use with
GET /v1/private-datacenters.
The 201 response includes state:"draft", the placement you chose, and a reserved (not-yet-live) hostname/endpointUrl on the generated *.vs.maxoperf.com domain.
Describe with AI. On New virtual service, choose the Describe with AI source, type what the mock should do (and optionally paste an OpenAPI file or an example), and press Generate. The name is filled in and the transactions it will create are listed; Create virtual service saves them. The Deployment and Settings tabs have their own bars that fill the datacenter, custom domain, idle shutdown and latency multiplier, and their normal Save buttons persist. See Describe with AI.
Define transactions
Section titled “Define transactions”Open the virtual service’s Transactions tab to add the request/response pairs it should answer. Each transaction matches on method + path (with parameter placeholders) and returns a templated response: status code, headers, and a body built from the request or from data variables. See Compose & transaction groups for how transactions, groups, and composition fit together on a single virtual service.
Choose where it runs and start it
Section titled “Choose where it runs and start it”Open the Deployment tab.
-
In the Placement card, choose Where it runs. The list is grouped into MaxoPerf shared (the platform’s own capacity, no setup) and Your datacenter (private datacenters your workspace has connected). Pick one and click Save placement. A placement change applies when you start the service.
-
Set the no-match policy (the Whole service — when nothing matches card at the bottom of the Behavior tab; click Save fallback). It decides what the virtual service does with a request that matches none of its transactions:
Policy Behavior 404 Not Found(default)Returns a plain 404. Respond with a fixed status Returns a status code and body template you choose. Proxy to a real origin Forwards the request to a real origin URL. Mock the transactions you care about and pass everything else through unchanged. Reject the connection Drops the connection instead of returning an HTTP response. -
Click Start in the page header. The virtual service moves to Deploying while MaxoPerf provisions a dedicated runtime pod on the selected datacenter and wires its route. This starts a real workload, so it takes a few moments the first time. When it is ready the status changes to Running and the endpoint at the top of the page goes live. If it fails the status reads Failed; the Deployment tab says why and offers Retry in place.
Deploy and stop from the REST API
Section titled “Deploy and stop from the REST API”curl -X POST https://app.maxoperf.com/v1/virtual-services/<id>/deploy \ -H "Authorization: Bearer mpak_example_key" -H "X-Account-Id: acn-1234567890"
curl -X POST https://app.maxoperf.com/v1/virtual-services/<id>/stop \ -H "Authorization: Bearer mpak_example_key" -H "X-Account-Id: acn-1234567890"Both return { "id": "...", "state": "running" | "stopped" } right away. The transition itself is asynchronous. Poll GET /v1/virtual-services/<id> (or watch the console) for the final running/stopped/error state.
Idle-shutdown
Section titled “Idle-shutdown”Set Idle shutdown on the virtual service’s Settings tab. It is the time without traffic before MaxoPerf stops the workload and frees its datacenter resources. An idle mock stops on its own and keeps its URL and remembered values, and a change applies within a minute. The default is 30 minutes. Choose Never (0) to turn idle shutdown off, and the deployed virtual service runs with no time limit. There is no separate lifetime cap. A deployed virtual service runs until it goes idle, you stop it by hand, or you redeploy it later.
Latency multiplier
Section titled “Latency multiplier”Latency multiplier (Settings) scales the latency of every transaction: ×1 serves latencies as authored, ×2 doubles them (slower), ×0 removes added latency. It is a multiplier from 0 to 10; through the API it is thinkScalePercent (a whole percentage, 0 to 1000, so ×1.5 is 150). A running service applies a change within a few seconds, with no redeploy. The Analytics tab shows the current value read-only.
Custom domain (optional, your own datacenter only)
Section titled “Custom domain (optional, your own datacenter only)”By default a virtual service is reachable at its generated *.vs.maxoperf.com hostname. A custom domain is available only when the service runs on your own datacenter:
- On the Deployment tab, enter your hostname under Custom domain and click Save domain.
- Point a CNAME at the service’s managed hostname. Your datacenter’s gateway must accept the host and terminate TLS for it.
- The domain applies on the next start. Once it is set, the managed URL stops routing: only the custom domain reaches the mock.
On a MaxoPerf shared datacenter the console disables the field (“Custom domains aren’t supported on MaxoPerf shared datacenters. Move to your own datacenter to use one.”), and the API refuses the same change with 409 custom_domain_unsupported_on_shared_datacenter. This is a behavior change for REST and MCP callers: setting customDomain on a service placed on a shared datacenter, or moving a service that has a custom domain to a shared one, now returns that 409. A custom domain stored before this change on a shared datacenter is ignored (the service keeps serving its managed URL); remove it by sending { "customDomain": null }.
The console has no certificate upload: terminate TLS for your domain on your own gateway.
To clear the custom domain, click Remove custom domain (or save the field empty). The virtual service falls back to its generated hostname.
Delete a virtual service
Section titled “Delete a virtual service”Deleting is permanent. The confirmation lists exactly what happens:
- The mock is stopped first, if it is Running.
- Its remembered values and all backups are deleted, and they can’t be recovered.
- Its hostname is released.
- Tests bound to it lose the endpoint (the dialog names them).
- Groups and their transactions stay, because other virtual services may use them.
Next steps
Section titled “Next steps”- Compose & transaction groups: build reusable groups and compose a virtual service from multiple sources.
- Private datacenters: connect your own datacenter.
- Virtual services overview: the full model and when to use it.