Importing APIs
SureStage supports importing API definitions from multiple formats to quickly create mock simulations.
Supported Formats
| Format | File Type | Notes |
|---|---|---|
| OpenAPI / Swagger | .json, .yaml | v2.0 and v3.x supported |
| Postman Collection | .json | v2.1 format |
| HAR | .har | HTTP Archive from browser dev tools |
| cURL | Text | Paste cURL commands directly |
Importing an OpenAPI Spec
- Open a simulation (or create a new one)
- Click Import > OpenAPI/Swagger
- Upload the spec file or paste a URL
- Review the import preview:
- Routes that will be created
- Response schemas detected
- Parameters and examples
- Click Import
Import Options
- Generate example responses - Use schema definitions to create realistic mock responses
- Include all status codes - Create responses for 200, 400, 401, 404, 500
- Preserve examples - Use examples from the spec when available
- AI enhancement - Use AI to generate richer mock data
Importing from HAR
HAR (HTTP Archive) files capture real browser traffic:
- Open browser DevTools > Network tab
- Perform the actions you want to capture
- Right-click > Save all as HAR
- In SureStage, click Import > HAR
- Upload the file
- Filter which requests to import
- Click Import
Importing from cURL
Paste one or more cURL commands:
curl -X GET https://api.example.com/users \
-H "Authorization: Bearer token123"
SureStage parses the command and creates a matching route with the response structure.
Next Steps
- Routes & Responses - Edit imported routes
- Environments - Save imports as reusable environments