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
PreviousIn-App Notifications
NextRealtime Studio
Virtual Communications

Template Engine & Dispatcher

Manage reusable Mustache-style template blueprints with dynamic variable compilation ({{name}}, {{otp}}), test cross-channel dispatches, and flush communication logs cleanly in your isolated sandbox.

Live Template StudioAPI ConsolesPurge Sandbox Mailbox

Communication Template Studio

Select a built-in blueprint and adjust variables to see real-time placeholder interpolation.

Template Variables

Account activation notice with prominent OTP code and verification call-to-action button.

Payload Mapping: Pass { template: "welcome-verification", data: { ... } } to POST /emails/send.
Compiled Subject

Welcome to Playground API, Alexander Developer! Verify your account

JSON Dispatch Payload
{ "to": "developer@example.com", "template": "welcome-verification", "data": { "name": "Alexander Developer", "otp": "849201", "verification_link": "https://playground.nileslabs.com/verify?code=849201", "expires_in_minutes": "15" } }

Interactive Consoles

Query registered templates and register custom blueprints.

1. Inspect Available Templates

List Communication Blueprints

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

2. Register Custom Blueprint

Create Custom Template

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

Purge Sandbox Mailbox & Communication Logs

Reset your session inbox. Permanently deletes all generated emails, SMS messages, and temporary attachments.

Purge Communication Inbox

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

Multi-Channel Dispatcher Recipe (Node.js)

Dispatching templated emails and SMS notifications programmatically.

typescript
1
import axios from 'axios';
2
3
const API_BASE = 'https://playground.nileslabs.com/api/v1';
4
5
// Send templated email
6
export async function sendWelcomeEmail(user: { email: string; name: string }) {
7
const otp = Math.floor(100000 + Math.random() * 900000).toString();
8
9
const response = await axios.post(${API_BASE}/emails/send, {
10
to: user.email,
11
template: 'welcome-verification',
12
data: {
13
name: user.name,
14
otp,
15
verification_link: https://myapp.com/verify?code=${otp}`,
16
expires_in_minutes: '15',
17
},
18
});
19
20
return response.data;
21
}