Tutorial: Automating Daily Workflows with Focus SaaS Webhooks & REST API
Connect your team's project management stack, configure real-time webhook triggers, and automate distraction-free focus sprints using our developer API.
Marcus Vance
Principal Integrations Architect
Focus SaaS empowers high-performance teams to protect their deep work intervals. In this tutorial, you'll learn how to authenticate with the Focus REST API, subscribe to session lifecycle webhooks, and trigger synchronized focus blocks across team calendars.
Prerequisites
Before writing any code, ensure you have:
- An active Focus SaaS subscription (Pro or Enterprise tier).
- An API Secret Token generated from your workspace settings (
Settings > Integrations > API Keys). - A webhook receiving endpoint or tunnel (such as ngrok or Cloudflare Workers).
Step 1: Authenticating API Requests
All API requests require Bearer token authentication passed in the Authorization header:
curl -X GET https://api.skillanswers.com/v1/focus/workspaces \
-H "Authorization: Bearer fcs_live_948a28f4bc1e2098" \
-H "Content-Type: application/json"Step 2: Triggering a Coordinated Focus Sprint
To begin a 50-minute team deep-work sprint and automatically silence notifications:
curl -X POST https://api.skillanswers.com/v1/focus/sprints \
-H "Authorization: Bearer fcs_live_948a28f4bc1e2098" \
-H "Content-Type: application/json" \
-d '{
"duration_minutes": 50,
"mode": "deep_work",
"dnd_slack": true,
"calendar_status": "In Deep Focus Sprint (Focus SaaS)"
}'Step 3: Subscribing to Webhooks
Register a webhook receiver for events such as sprint.completed or focus.interrupted. Every webhook payload contains an HMAC-SHA256 signature in the X-Focus-Signature header so your backend can authenticate deliveries.
Production Recommendation
Always store API keys in secure environment variables, and verify HMAC signatures before executing internal database writes.
Related Articles
Complete Guide: Activating and Managing Your SkillAnswers Licenses
A step-by-step walkthrough covering instant checkout delivery, offline license key verification, hardware seat assignment, and renewal workflows.
Release Notes v2.4: Instant Multi-Currency Checkout & Global Delivery Hub
Introducing support for 21 world currencies, seamless 1-click test checkout evaluation, unified DodoPay & XPay routing, and automated self-service license recovery.