Open an operation
Choose the endpoint in API Designer.
// Mock Responses
Configure success and failure variants, then call enabled mocks through the authenticated hosted runtime while the backend is still being built.
Defined on POST /payments
Delay 120 ms
Delay 300 ms
Delay 1,000 ms
Save and enable a Card declined variant on POST /payments with status 422 and the body below. Configuration alone sends no request. Execute it using the workspace mock base URL and a mock server key; hosted calls consume the account quota. Keep the key out of public frontend bundles.
POST /api/public/v1/mock/<workspaceId>/payments
Authorization: Bearer <mock-server-key>
X-Rest-Test-Mock: Card declined
Expected configured response: 422
{ "code": "card_declined" }Follow the practical guideCapabilities
Workflow
Choose the endpoint in API Designer.
Create a named success or error response.
Set status, headers, body and optional delay.
Review variants with workspace members, then execute enabled mocks with a scoped workspace mock server key.
Define expected response shapes while backend implementation is still moving.
Give frontend work concrete authorization, validation and server errors to handle.
Keep variant bodies and headers attached to the operation being discussed.
// FAQ
// GET STARTED
Start with an OpenAPI or Swagger JSON definition and keep the workflow together.