REST API Reference
67 endpoints across 18 resources. The SocialHub v2 REST API lets you manage stores, loyalty members, points, coupons, captures, the Ambassador program and tracking. All endpoints require Authorization: Bearer fl_live_… unless noted.
https://flash.socialhub.ai/api/v2This reference mirrors the live API.It's a static snapshot of the endpoint catalog, grouped by resource. For the always-current, machine-readable contract (parameters, request bodies, response schemas), see the OpenAPI JSON →
Authenticate with a Bearer key
Every request authenticates with a SocialHub API key (fl_live_…) sent as a Bearer token. Keys are scoped to your team and per-tool — create and manage them in your SocialHub account.
curl https://flash.socialhub.ai/api/v2/members \
-H "Authorization: Bearer fl_live_your_key_here"Prefer to keep the plaintext key out of your shell history? Export it as FLASH_API_KEY and reference the env var.
Mark a key as a test key to build against a sandbox on this same base URL — no separate environment or credentials. Data written with it (members, orders, coupons) is tagged and hidden from your live lists and dashboards; a test member is never really contacted (marketing email, SMS, and push are suppressed) and a test coupon never redeems for real value; and a single POST /api/v2/test-data/purge wipes all of it. Experiment freely, then reset.
Endpoints
67 endpoints across 18 resource groups. Method, path and a one-line summary for each — the full parameter and schema detail lives in the OpenAPI JSON.
Stores
4 endpointsStore management
/api/v2/stores/api/v2/stores/{id}/api/v2/stores/api/v2/stores/{id}Members
12 endpointsLoyalty member management
/api/v2/members/api/v2/members/api/v2/members/batch/api/v2/members/{id}/api/v2/members/{id}/api/v2/members/{id}/points/api/v2/members/{id}/points/api/v2/members/{id}/tier/api/v2/members/{id}/coupons/api/v2/members/{id}/receipts/api/v2/members/{id}/profile/api/v2/members/{id}/redeem-couponOrders
4 endpointsOrder ingestion → auto-award points, refunds, and reconciliation
/api/v2/orders/api/v2/orders/api/v2/orders/batch/api/v2/orders/{externalOrderId}/refundCatalog
5 endpointsProduct catalog (PIM) — products, variants, categories, brands; generic ERP/Shopify import
/api/v2/products/api/v2/products/{id}/api/v2/categories/api/v2/brands/api/v2/catalog/importMember Tags
4 endpointsRead the tag catalog — lifecycle, RFM, value tier, engagement, purchase-timing, preference (incl. category affinity), risk, consent and channel axes — and manually assign/remove a member's tags
/api/v2/tags/api/v2/members/{id}/tags/api/v2/members/{id}/tags/api/v2/members/{id}/tags/{tagKey}Custom Fields
2 endpointsRead tenant-defined custom fields for any entity (member / store / product / coupon pool / order). Read-only; non-PII by design. Scope: custom_fields:read.
/api/v2/custom-fields/api/v2/custom-fields/valuesCaptures
1 endpointCapture records
/api/v2/capturesCoupons
4 endpointsCoupon pools, codes, and redemption
/api/v2/coupons/api/v2/coupons/pools/api/v2/coupons/issue/api/v2/coupons/{id}/redeemAmbassador
3 endpointsAmbassador program — candidates, ROI report, and affiliate codes
/api/v2/ambassador/candidates/api/v2/ambassador/metrics/api/v2/ambassador/members/{id}/issue-codeTracking
2 endpointsPage-visit / behavior analytics and event ingestion
/api/v2/tracking/stats/api/v2/tracking/eventsAPI Keys
3 endpointsAPI key management
/api/v2/api-keys/api/v2/api-keys/api/v2/api-keys/{id}Auth
7 endpointsAuthentication and user profile
/api/v2/auth/register/api/v2/auth/login/api/v2/auth/profile/api/v2/auth/profile/api/v2/auth/change-password/api/v2/auth/forgot-password/api/v2/auth/reset-passwordSegments
5 endpointsAudience segments — structured conditions used to target campaigns
/api/v2/segments/api/v2/segments/api/v2/segments/{id}/api/v2/segments/{id}/api/v2/segments/{id}Campaigns
3 endpointsCampaigns — list and create drafts (never sends; a human reviews and sends)
/api/v2/campaigns/api/v2/campaigns/api/v2/campaigns/{id}Automations
2 endpointsAutomations — list event-triggered flows and pause/resume them
/api/v2/automations/api/v2/automations/{id}Transactional
1 endpointTransactional send — your system triggers a single-recipient send of a campaign a human explicitly enabled for transactional use (order confirmations, receipts). The API never authors content; deliverability suppression is always honored; pass idempotency_key to make retries safe
/api/v2/transactional/sendImports
4 endpointsAsync bulk import — upload a CSV/JSONL member/order file and poll the job (no 100-row cap)
/api/v2/members/import/api/v2/members/import/{id}/api/v2/orders/import/api/v2/orders/import/{id}Test data
1 endpointSandbox test-mode data — purge everything a test key created
/api/v2/test-data/purgePredictive profile fields & smarter recommendations
Two upgrades land inside existing endpoints — no new public surface, and the response shapes of existing recommendation endpoints are unchanged.
GET /api/v2/members/{id}/profileThe profile rollups now include predictive fields, computed when the team's data supports a fit:
- Expected next order date— a per-member Gamma fit on the member's own purchase intervals (requires ≥ 3 purchases), returned with the interval statistics and a confidence indicator.
- Email click propensity — a per-team L2-regularized logistic
P(click)from the profile's rollup engagement features.
Both fields are null below the honesty gates — never a guess. Consumers must handle null.
Recommendations (public embed + v2)Co-purchase scoring is upgraded to cosine-normalized item-item similarity, so pair strength is no longer dominated by bestsellers:
score = co_count / sqrt(buyers(A) × buyers(B)) # pairs need ≥2 shared buyers
# raw co_count still storedA new nightly association-rule mining job runs per team (support / confidence / lift; MIN_PAIR_ORDERS=3, MIN_CONFIDENCE=0.05, top 25 rules per antecedent by lift) and feeds cross-sell suggestions. Existing integrations keep working as-is — response shapes are unchanged.