Playground API
DocsStatsBlogStudio
Documentation Tree
Technical BlogFeature Deep Dives
  • Introduction
  • Quickstart
    5 min
  • How It Works
  • Recipes & Cookbooks
  • Platform Comparisons
  • Real-World Showcase
  • Interactive Studio
    Studio
  • GraphiQL IDE
    IDE
  • Session Quotas & Activity
  • Network Chaos Simulator
  • Atomic Sandbox Reset
  • Overview & Models
    Hub
  • Users Resource
  • Posts Resource
  • Comments Resource
  • Todos Resource
  • Custom Collections
    Custom
  • Multipart File Uploads
    Upload
  • Dynamic SVG Avatars
    SVG
  • Image Thumbnails
    CDN
  • Relational Filtering
  • Full-Text Search
  • Dynamic Sorting
  • Offset Pagination
  • Cursor Pagination
    Scroll
  • CSV & Excel Export & Import
    IO
  • Custom Collections
    CRUD
  • Overview & Architecture
    Hub
  • JWT Auth Flow
  • Refresh Token Rotation
    Mutex
  • RBAC Permission Matrix
    Roles
  • Expiry Simulation
  • Clock Skew Drift
  • Password Recovery Loop
  • Dual-Mode Sandboxing
  • GraphiQL IDE
    IDE
  • Relational Queries
  • Stateful Mutations
  • Realtime Subscriptions
  • Overview & Flowcharts
    Hub
  • Hosted Checkout
    Stripe
  • Payment Intents API
  • 3DS Challenge Modal
    Modal
  • Customers Vault
  • Charges & Refunds
  • Test Cards Catalog
  • Overview & Channels
    Hub
  • Virtual Email Mailbox
    Mailtrap
  • Virtual SMS Terminal
    Phone
  • In-App Notifications
  • Message Dispatcher
  • Realtime Studio
    Studio
  • Native WebSocket (/ws)
  • Socket.io Gateway
  • Presence & Echo Bot
  • Server-Sent Events (SSE)
    SSE
  • Analytics Telemetry
  • Webhook Subscriptions
  • HMAC SHA-256 Signatures
  • Delivery Logs
  • Manual Retry Simulator
  • Network Latency Delay
  • HTTP Status Codes
  • Rate-Limit Simulator
    429
  • Flaky Network & Jitter
    Chaos
  • Session Quotas & Activity
  • JSON Snapshots
    JSON
  • Headless CI/CD Testing
    CI
  • Mobile QR Code Sync
  • System Metrics & Health
  • Atomic Sandbox Reset
  • Official TypeScript SDK
  • Multi-Language Generators
  • DevTools Extension
  • OpenAPI 3.1 Spec
    JSON
  • Postman Collection v2.1
  • Bruno Collection
  • Insomnia Workspace
  • TypeScript .d.ts
    .d.ts
  • AI Prompt Rules
    Rules
  • Context Index (llms.txt)
  • Full Schema (llms-full.txt)
  • Manifest (product.json)
  • All Feature Articles
    Blog
  • React CRUD Without Backend
    Deep Dive
  • Why Static APIs Fail
  • Mocking Stateful Auth
  • WebSockets & SSE Guide
Technical Blog
Articles

In-depth articles explaining stateful mock APIs, WebSockets, payments, and frontend resilience.

Read Articles
PreviousSession Quotas & Activity
NextHeadless CI/CD Testing
Sandbox State & Health

JSON State Snapshots (Export & Import)

Capture your active session state—created records, modified posts, custom dynamic collections, and shopping carts—into portable JSON fixtures. Share reproducible bug states with teammates or preload seed datasets into CI/CD pipelines.

Why Use State Snapshots?

1-Click Bug Reproduction

When QA encounters an edge case, they can export their exact session state and attach the JSON file to a ticket for developers to restore instantly.

Deterministic CI Fixtures

Preload baseline test data (users, catalog items, completed orders) before running end-to-end tests without executing dozens of setup API calls.

Cross-Team Collaboration

Export mock data created by UX designers and import it directly into staging or mobile simulator environments.

Step 1: Export Active Session Snapshot

Send a GET /session/export request to extract all mutated records and custom collections from your current visitor overlay:

Export Session Snapshot

Downloads the active memory overlay for your browser session

GET
response.json
1
{
2
// Click "Send" above to execute this request against the live server.
3
}

Step 2: Restore Snapshot into Sandbox

Post snapshot JSON to /session/import to immediately apply fixture records to your session:

Import Session Snapshot

Overwrites or seeds your active session with custom fixture state

POST
response.json
1
{
2
// Click "Send" above to execute this request against the live server.
3
}

Automated CI/CD Fixture Loading

Easily script snapshot import and export within local shell scripts or Playwright / Cypress pipelines:

snapshot-cli.sh
1
# 1. Export active sandbox state to a local JSON file
2
curl -X GET "https://playground.nileslabs.com/api/v1/session/export" \
3
-H "X-Playground-Identity: test-runner-1" \
4
-o ./fixtures/regression-test-seed.json
5
6
# 2. Restore the fixture in another test run or teammate's environment
7
curl -X POST "https://playground.nileslabs.com/api/v1/session/import" \
8
-H "Content-Type: application/json" \
9
-H "X-Playground-Identity: test-runner-2" \
10
-d @./fixtures/regression-test-seed.json

Running automated parallel tests?

Learn how to isolate parallel CI test workers using custom session identities.

View Headless CI/CD Guide