SocialHub.AI
Resources · Developers

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.

Base URLhttps://flash.socialhub.ai/api/v2

This 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 →

Authentication

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.

Test mode (sandbox)

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.

Reference

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 endpoints

Store management

GET/api/v2/stores
GET/api/v2/stores/{id}
POST/api/v2/stores
PUT/api/v2/stores/{id}

Members

12 endpoints

Loyalty member management

GET/api/v2/members
POST/api/v2/members
POST/api/v2/members/batch
GET/api/v2/members/{id}
PATCH/api/v2/members/{id}
GET/api/v2/members/{id}/points
POST/api/v2/members/{id}/points
GET/api/v2/members/{id}/tier
GET/api/v2/members/{id}/coupons
GET/api/v2/members/{id}/receipts
GET/api/v2/members/{id}/profile
POST/api/v2/members/{id}/redeem-coupon

Orders

4 endpoints

Order ingestion → auto-award points, refunds, and reconciliation

GET/api/v2/orders
POST/api/v2/orders
POST/api/v2/orders/batch
POST/api/v2/orders/{externalOrderId}/refund

Catalog

5 endpoints

Product catalog (PIM) — products, variants, categories, brands; generic ERP/Shopify import

GET/api/v2/products
GET/api/v2/products/{id}
GET/api/v2/categories
GET/api/v2/brands
POST/api/v2/catalog/import

Member Tags

4 endpoints

Read 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

GET/api/v2/tags
GET/api/v2/members/{id}/tags
POST/api/v2/members/{id}/tags
DELETE/api/v2/members/{id}/tags/{tagKey}

Custom Fields

2 endpoints

Read tenant-defined custom fields for any entity (member / store / product / coupon pool / order). Read-only; non-PII by design. Scope: custom_fields:read.

GET/api/v2/custom-fields
GET/api/v2/custom-fields/values

Captures

1 endpoint

Capture records

GET/api/v2/captures

Coupons

4 endpoints

Coupon pools, codes, and redemption

GET/api/v2/coupons
GET/api/v2/coupons/pools
POST/api/v2/coupons/issue
POST/api/v2/coupons/{id}/redeem

Ambassador

3 endpoints

Ambassador program — candidates, ROI report, and affiliate codes

GET/api/v2/ambassador/candidates
GET/api/v2/ambassador/metrics
POST/api/v2/ambassador/members/{id}/issue-code

Tracking

2 endpoints

Page-visit / behavior analytics and event ingestion

GET/api/v2/tracking/stats
POST/api/v2/tracking/events

API Keys

3 endpoints

API key management

GET/api/v2/api-keys
POST/api/v2/api-keys
DELETE/api/v2/api-keys/{id}

Auth

7 endpoints

Authentication and user profile

POST/api/v2/auth/register
POST/api/v2/auth/login
GET/api/v2/auth/profile
PATCH/api/v2/auth/profile
POST/api/v2/auth/change-password
POST/api/v2/auth/forgot-password
POST/api/v2/auth/reset-password

Segments

5 endpoints

Audience segments — structured conditions used to target campaigns

GET/api/v2/segments
POST/api/v2/segments
GET/api/v2/segments/{id}
PATCH/api/v2/segments/{id}
DELETE/api/v2/segments/{id}

Campaigns

3 endpoints

Campaigns — list and create drafts (never sends; a human reviews and sends)

GET/api/v2/campaigns
POST/api/v2/campaigns
GET/api/v2/campaigns/{id}

Automations

2 endpoints

Automations — list event-triggered flows and pause/resume them

GET/api/v2/automations
PATCH/api/v2/automations/{id}

Transactional

1 endpoint

Transactional 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

POST/api/v2/transactional/send

Imports

4 endpoints

Async bulk import — upload a CSV/JSONL member/order file and poll the job (no 100-row cap)

POST/api/v2/members/import
GET/api/v2/members/import/{id}
POST/api/v2/orders/import
GET/api/v2/orders/import/{id}

Test data

1 endpoint

Sandbox test-mode data — purge everything a test key created

POST/api/v2/test-data/purge
Recently shipped

Predictive 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}/profile

The 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 stored

A 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.