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
PreviousIntroduction
NextHow It Works
5-Minute Onboarding

Quickstart Guide

Get started with Playground API in under 60 seconds. Zero API keys, zero authentication configuration, and zero credit card required.

1Test Live Server Connectivity

Execute a real-time request to the health check endpoint GET /api/v1/health.

2Fetch & Mutate in Your Favorite Tool

Choose your programming language or framework below to see ready-to-use code snippets with stateful session persistence.

quickstart-fetch
1
// 1. Fetch posts with credentials to isolate your visitor session
2
const response = await fetch('https://playground.nileslabs.com/api/v1/posts?_limit=5', {
3
credentials: 'include', // Automatically attaches/receives pg_identity cookie
4
});
5
6
const data = await response.json();
7
console.log('Posts:', data.data || data);
8
9
// 2. Create a persistent post in your sandbox
10
const createRes = await fetch('https://playground.nileslabs.com/api/v1/posts', {
11
method: 'POST',
12
headers: { 'Content-Type': 'application/json' },
13
credentials: 'include',
14
body: JSON.stringify({
15
title: 'My First Stateful Post',
16
body: 'This post persists across page reloads in your session overlay!',
17
user_id: 1,
18
}),
19
});
20
21
const newPost = await createRes.json();
22
console.log('Created Post:', newPost);

3How Your Private Sandbox Stays Isolated

Playground API ensures multiple developers, test runners, and browsers never collide or overwrite each other. Here is how your identity is resolved:

Browser Apps (Cookie-Based)

When making requests from a web browser, pass credentials: 'include' (or Axios withCredentials: true). The backend assigns an HMAC-signed pg_identity cookie.

CI/CD & Mobile (Header-Based)

For Playwright test workers, Postman, or mobile apps without cookies, pass the header X-Playground-Identity: worker-1. Each worker receives its own isolated database overlay.

4Inject Latency & Chaos Parameters

Test UI skeleton loaders and error boundary states instantly by attaching query parameters to any REST endpoint:

?_delay=1500

Artificial Latency

Forces a 1500ms delay to test loading spinners and skeleton placeholders.

?_status=500

Simulate Server Error

Returns HTTP 500 Internal Server Error to test toast alerts and retry buttons.

?_flaky=true

Flaky Network Jitter

Simulates real-world mobile jitter with randomized delay (200-2500ms) and 10% dropped packets.

Resetting Your Sandbox to Pristine Baseline

Need a clean slate? Execute DELETE /api/v1/session/reset to immediately wipe your visitor mutations overlay and revert all core resources to the factory seed data.

Learn more about sandbox reset & snapshots