Response Versioning
Track, compare, and manage versions of your mock API responses with draft workflows, rollback capability, and response pinning. This feature helps teams collaborate on response definitions and maintain a complete audit trail of changes.
Prerequisites
- An existing mock simulation with at least one route and response
- Basic understanding of simulation responses
Understanding Response Versions
Every time you modify a response body, headers, or status code, SureStage automatically creates a version record. This allows you to:
- View the complete history of response changes
- Compare any two versions to see what changed
- Revert to previous versions without manual reconstruction
- Pin responses to prevent accidental modifications
- Create draft versions for testing changes before publishing
Creating Drafts
Drafts are working copies of responses that can be edited before promoting to live.
Create a Draft from Current Response
- Navigate to a response in your simulation
- Click Create Draft or + Draft
- Optionally name the draft (e.g., "Experiment with new payload shape")
- Click Create
You now have a draft version that's independent from the live response.
Viewing Drafts
- Open the response
- Click the Drafts tab
- See all draft versions with creation timestamps and creator names
Each draft shows:
- Draft name/label
- Creator name
- Created timestamp
- Status (active, finalized)
Editing a Draft
- Select a draft from the drafts list
- Click Edit
- Modify the response:
- Status code
- Headers (JSON)
- Body (JSON/raw)
- Click Save to update the draft
Changes to drafts don't affect the live response until you promote.
Promoting a Draft to Live
When you're satisfied with a draft, promote it to become the live response:
- Open the draft
- Click Promote
- Confirm the action
- The draft content becomes the live response
- A new version record is created with source "draft_promote"
Discarding a Draft
If you no longer need a draft:
- Select the draft
- Click Discard (⚠️ cannot be undone)
- Confirm deletion
Viewing Version History
List Response Versions
- Open a response in your simulation
- Click the Versions or History tab
- View paginated list of all published versions (excludes drafts)
Each version shows:
- Version ID (UUID)
- Creation timestamp
- Creator name
- Source (e.g., "direct_edit", "draft_promote", "rollback")
- Status code, headers, and body summary
Get Version Details
- Click on a version in the history
- View the complete response definition:
- Full status code
- Complete headers object
- Full response body
- Creation timestamp
- Creator information
Comparing Versions (Diff)
Compare Two Versions
- Navigate to the response version history
- Click Compare or select two versions
- Enter the older version UUID as "from"
- Enter the newer version UUID as "to"
- View the structured diff
The diff shows:
- Added: Fields present in newer version
- Removed: Fields present in older version
- Modified: Fields that changed between versions
- Unchanged: Fields that remain the same
Example Diff
{
"statusCode": {
"from": 200,
"to": 201,
"status": "modified"
},
"headers": {
"X-Custom-Header": {
"status": "added"
},
"Content-Type": {
"from": "application/json",
"to": "application/json; charset=utf-8",
"status": "modified"
}
},
"body": {
"userId": {
"status": "added"
},
"message": {
"status": "removed"
}
}
}
Rolling Back to Previous Versions
Rollback Workflow
- Open the response history
- Find the version you want to restore
- Click Rollback to this version
- Confirm the action
- The response is restored to that version's state
- A new version is created with source "rollback"
Example: If you accidentally changed a response, you can rollback to restore the previous working version.
Rollback Behavior
- Only the response content is restored (status code, headers, body)
- The rollback creates a new version record for audit trail
- Previous versions remain in history
- The live response is immediately updated
Pinning Responses
Pin responses to prevent accidental edits in high-risk scenarios.
Pin a Response
- Open the response
- Click Pin or Lock
- Optionally enter a reason (e.g., "Locked for QA certification")
- Click Confirm Pin
Pin Restrictions
When a response is pinned:
- Cannot edit the response body, headers, or status code
- Cannot delete the response
- Can still view history and create drafts
- Can still create snapshots
- Admin can override the pin if needed
Unpin a Response
- Open the pinned response
- Click Unpin or Unlock
- Confirm the action
The response is now editable again.
Simulation-Level Version History
View all version changes across every response in a simulation.
Access Simulation Version Timeline
- Open a simulation
- Click History or Version Timeline
- View paginated timeline of all response changes for the simulation
This shows:
- Which response was modified
- The user who made the change
- The timestamp
- Whether it was a direct edit, draft promotion, or rollback
- Quick link to view the version
Filter and Search
- Filter by user
- Filter by response
- Search by date range
- Sort by newest/oldest first
Common Workflows
A/B Testing Response Variants
- Create Draft A with variant 1
- Create Draft B with variant 2
- Test both drafts in different environments
- Promote the winning variant
- Keep the rollback history for documentation
Collaborative Editing
- Team member creates a draft with proposed changes
- Another team member reviews the draft
- Use diff to see exactly what changed
- If approved, promote the draft
- If rejected, discard the draft
Emergency Rollback
If a response change breaks tests:
- Navigate to response history
- Find the last known-good version
- Click Rollback
- Confirm
- The response is immediately restored
- The broken version remains in history for analysis
Documentation Trail
Use response versioning as documentation:
- Each version captures the exact response at a point in time
- Diffs show what evolved and why
- Creator info tracks who made each change
- Sources (direct_edit, draft_promote, rollback) show the action type
Version History Limits
Retention Policy
- Versions are retained indefinitely
- All drafts are retained until explicitly discarded
- Pinned responses cannot be deleted or modified
- Consider archiving old responses periodically to manage volume
Performance
- List endpoints support pagination (default 20 items/page)
- Diff operations work with any two versions
- Simulation-level history is paginated for large simulations
Troubleshooting
Can't Find an Old Version
- Check the version history pagination
- Use simulation-level timeline to find the response
- Versions are never deleted; search by date range
- Contact your workspace admin for very old versions
Rollback Didn't Work
- Verify you selected the correct target version
- Check that the response permissions allow rollback
- Ensure the response hasn't been pinned
- Review the operation result in the activity log
Comparison Shows No Differences
- Verify you selected different version UUIDs
- Check that one version is actually newer than the other
- Both versions may be identical (no changes occurred)
Can't Edit Because Response Is Pinned
- Unpin the response first (or ask admin)
- Create a draft instead (drafts bypass the pin)
- Promote the draft when ready
- This is intentional to prevent accidental modifications
API Reference
Version Management Endpoints
| Method | Path | Description |
|---|---|---|
GET | /responses/:id/versions | List response versions |
GET | /responses/:id/versions/:versionId | Get version details |
GET | /responses/:id/versions/diff | Diff two versions |
POST | /responses/:id/rollback | Rollback to version |
Draft Endpoints
| Method | Path | Description |
|---|---|---|
POST | /responses/:id/drafts | Create draft |
GET | /responses/:id/drafts | List drafts |
PATCH | /responses/:id/drafts/:draftId | Update draft |
POST | /responses/:id/drafts/:draftId/promote | Promote draft |
DELETE | /responses/:id/drafts/:draftId | Discard draft |
Pinning Endpoints
| Method | Path | Description |
|---|---|---|
POST | /responses/:id/pin | Pin response |
DELETE | /responses/:id/pin | Unpin response |
Next Steps
- Request Validation - Validate responses against schemas
- Mock Snapshots - Share response configurations
- Analytics - Track response usage over time
- Routes and Responses - Learn about response fundamentals