Per iniziare
API Sublaunch
Porta i membri, i pagamenti e la Community del tuo Sublaunch nei tuoi strumenti. Un'API REST, webhook firmati e un server MCP per le app di IA, tutto con una sola chiave.
Prima di iniziare
L'API e il server MCP sono inclusi nei piani Business e Premium. Ogni endpoint si trova sotto https://api.sublaunch.com/v1, riceve e restituisce JSON con campi in snake_case e scrive ogni data e ora in ISO 8601, in UTC.
https://api.sublaunch.com/v1Ottieni una chiave API
In Sublaunch, apri la pagina API del tuo Sublaunch su sublaunch.com/<sublaunch>/a/api, dove <sublaunch> è il link del tuo Sublaunch. Dai un nome alla chiave e scegli i suoi scope, solo read oppure read e write.
La chiave inizia con sl_live_ e appare una sola volta, quindi salvala subito nel tuo secret manager o nel tuo ambiente. Una chiave appartiene a un solo Sublaunch e vede solo i suoi dati.
export SUBLAUNCH_API_KEY="sl_live_…"Fai la tua prima richiesta
Verifica la chiave con Recupera il Sublaunch. Ogni richiesta invia la chiave nell'header Authorization, come bearer token.
La risposta è il Sublaunch a cui appartiene la chiave, con i suoi livelli e prezzi e il piano del suo proprietario.
curl https://api.sublaunch.com/v1/sublaunch \
-H "Authorization: Bearer $SUBLAUNCH_API_KEY"{
"id": "q7RkX2LmPv",
"object": "sublaunch",
"username": "alphadesk",
"url": "https://sublaunch.com/alphadesk",
"name": "Alpha Desk",
"slogan": "Daily setups and a private community for traders.",
"logo_url": "https://example.com/alpha-desk-logo.png",
"language": "en",
"currency": "usd",
"private": true,
"status": "live",
"tiers": [
{
"id": "tier1",
"object": "tier",
"name": "Inner Circle",
"prices": [
{
"id": "pR8sK2xLmQ",
"object": "price",
"tier_id": "tier1",
"amount": 29,
"currency": "usd",
"interval": "month",
"interval_count": 1,
"default": true,
"hidden": false,
"trial_days": 7,
"status": "active",
"discount": null,
"members_active": 212,
"members_total": 340,
"created_at": "2026-03-12T10:04:22.000Z"
},
{
"id": "pY3kQ9xLmR",
"object": "price",
"tier_id": "tier1",
"amount": 290,
"currency": "usd",
"interval": "year",
"interval_count": 1,
"default": false,
"hidden": false,
"trial_days": null,
"status": "active",
"discount": null,
"members_active": 41,
"members_total": 58,
"created_at": "2026-03-12T10:04:22.000Z"
}
],
"members_active": 253,
"members_total": 398,
"created_at": "2026-03-12T10:04:22.000Z"
}
],
"members_active": 253,
"members_total": 398,
"plan": "business",
"created_at": "2026-03-12T10:04:22.000Z",
"categories": [
{
"id": "general",
"object": "category",
"name": "General",
"who_can_post": "members",
"who_can_comment": "members",
"who_can_view": "members",
"tier_ids": [],
"sort": "default"
},
{
"id": "x7Lp2QaZ",
"object": "category",
"name": "Trade ideas",
"who_can_post": "members",
"who_can_comment": "members",
"who_can_view": "tiers",
"tier_ids": ["tier1"],
"sort": "new"
}
],
"draft": {
"has_draft": true,
"changed": ["coupons", "page", "prices"],
"courses": ["Hc4mQ9xRt2"],
"affiliates": ["Af6tR2kQxM"],
"pages": ["Pg4mX9kQ2T"],
"broadcasts": ["Bc8nR4kQ1X"]
}
}Elenca i tuoi membri
I membri arrivano dal più recente. Recupera quelli attivi con status=active e aggiungi tier_id, email o una data per restringere l'elenco.
Gli elenchi arrivano una pagina alla volta. Segui next_cursor finché has_more è true, come mostra Paginazione.
curl -G https://api.sublaunch.com/v1/members \
-H "Authorization: Bearer $SUBLAUNCH_API_KEY" \
-d status=active \
-d limit=25{
"object": "list",
"data": [
{
"id": "Ms8kL2QpXz",
"object": "member",
"email": "sam@example.com",
"name": "Sam Carter",
"first_name": "Sam",
"last_name": "Carter",
"user_id": "Us4kP9xQ2M",
"status": "active",
"type": "recurring",
"tier": {
"id": "tier1",
"name": "Inner Circle"
},
"price": {
"id": "pR8sK2xLmQ",
"amount": 29,
"currency": "usd",
"interval": "month"
},
"payments_count": 3,
"joined_at": "2026-09-02T18:41:07.000Z",
"cancel_at": null,
"canceled_at": null,
"affiliate_id": null
}
],
"has_more": true,
"next_cursor": "eyJ0IjoiMjAyNi0xMS0xNVQxNzowMjo0MC4wMDBaIn0"
}Ricevi il tuo primo webhook
I webhook inviano gli eventi al tuo server nel momento in cui accadono, così non devi mai fare polling. Registra un URL HTTPS pubblico per member.joined e payment.succeeded, conserva il secret della risposta, poi inviati un evento di test. lead.created invia ogni email raccolta dai tuoi lead magnet.
Verifica ogni richiesta con il suo header Sublaunch-Signature, come mostra Verifica le firme. Puoi anche aggiungere l'endpoint nell'app, nella pagina API del tuo Sublaunch.
curl -X POST https://api.sublaunch.com/v1/webhook_endpoints \
-H "Authorization: Bearer $SUBLAUNCH_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/webhooks/sublaunch",
"events": ["member.joined", "payment.succeeded"],
"description": "CRM sync",
"filters": {
"tier_ids": ["tier1"]
}
}'curl -X POST \
https://api.sublaunch.com/v1/webhook_endpoints/wh3LpX9dKe/test \
-H "Authorization: Bearer $SUBLAUNCH_API_KEY"Collega un'app di IA
Il server MCP di Sublaunch su https://api.sublaunch.com/mcp permette a Claude, ChatGPT e Cursor di leggere i tuoi membri e i tuoi ricavi, scrivere i tuoi post e gestire il tuo Sublaunch, direttamente nella chat.
In Claude Code basta un comando per collegarlo con la tua chiave. Per gli altri, segui il setup dell'MCP.
claude mcp add --transport http sublaunch https://api.sublaunch.com/mcp \
--header "Authorization: Bearer $SUBLAUNCH_API_KEY"