API Reference

REST API Overview

Programmatic access to workspaces, post sets, approvals, scheduling, media, and analytics under /api/v1.

Authentication & Headers

All API routes live under /api/v1. Authenticate with either a workspace API key or a user Bearer JWT in the Authorization header.

Browser clients proxy through /api/mera/<path> with httpOnly session cookies and must include the CSRF header X-Mera-Client: web on state-changing requests.

curl-example.sh
curl -X GET "https://sparlby.com/api/v1/workspaces" \
  -H "Authorization: Bearer $SPARLBY_API_KEY" \
  -H "Accept: application/json"

Core endpoints

Below are the primary resource endpoints exposed by the Sparlby API v1:

GET/api/v1/workspacesList workspaces accessible to the caller
GET/api/v1/workspaces/{ws}/accountsList connected social accounts and health status
GET/api/v1/workspaces/{ws}/postsList post sets and account variants
POST/api/v1/workspaces/{ws}/postsCreate a new post set with per-account variants
POST/api/v1/workspaces/{ws}/posts/{id}/request-approvalDispatch approval cards to paired channels
POST/api/v1/workspaces/{ws}/approvals/{id}/decideRecord an explicit approve or reject decision
POST/api/v1/workspaces/{ws}/publishing/scheduleSchedule an approved variant with staggered jitter
GET/api/v1/workspaces/{ws}/analytics/overviewFetch workspace-wide impressions and engagement
GET/api/v1/workspaces/{ws}/mcp/serversList connected external MCP servers

Signed webhooks

Sparlby signs every outbound webhook event using HMAC-SHA256 in the Mera-Signature header (t=<timestamp>,v1=<hex_digest>) so you can verify payload authenticity before processing.