REST API
Segments

Segments

Segments are member tiers — the equivalent of "Free", "Pro", "Founding Member", "Annual Supporter" depending on your model. A segment can have a public form (members submit it to apply), pricing (monthly / quarterly / yearly / one-time / installment), and an active flag.

Configuration reference. This page is the REST endpoints reference. For the complete tier configuration model — every supported billing cycle, how to mix them on a single tier, currencies, commissions, founding rates — see Memberships.

Public-read endpoints (READ_PUBLIC) — list segments, fetch form schema, check email. Write endpoints — submit form (WRITE_MEMBERS), accept rules (WRITE_MEMBERS), patch a segment (ADMIN).

Base URL: https://api.cobuntu.com/api/v1

Every endpoint requires an X-API-Key header. See Authentication for scope details.

GET /communities/{communityTag}/segments/public — List public segments (tiers)

Scope: READ_PUBLIC

Path parameters:

ParamTypeDescription
communityTagstringYour community's tag (e.g. your-community, acme).

Response (200):

[
  {
    "id": "…",
    "name": "…",
    "description": "…",                          // nullable
    "color": "…",
    "hasForm": false,
    "currency": "EUR",
    "priceMonthly": 0,                           // nullable
    "priceQuarterly": 0,                         // nullable
    "priceYearly": 0,                            // nullable
    "priceOneTime": 0,                           // nullable
    "installmentTotalPrice": 0,                  // nullable
    "installmentCount": 0,                       // nullable
    "installmentIntervalMonths": 0,              // nullable
    "accessDurationMonths": 0,                   // nullable
    "installmentRenewsAnnually": false,
    "foundingPriceMonthly": 0,                   // nullable
    "foundingPriceQuarterly": 0,                 // nullable
    "foundingPriceYearly": 0,                    // nullable
    "foundingMemberCap": 0,                      // nullable
    "foundingMemberCount": 0
  }
]
FieldTypeDescription
idstringStable segment identifier (uuid).
namestringDisplay name (e.g. Free, Pro, Founding Member).
descriptionstring (nullable)Long-form description shown on the segment's apply page.
colorstringDisplay color, hex.
hasFormbooleanTrue if the segment requires submitting a form to join (use GET /segments/{segmentId}/form).
currencystringISO-4217 code. See Memberships → Currencies for the supported list.
priceMonthlyinteger (nullable)Monthly price in cents (null = not offered monthly).
priceQuarterlyinteger (nullable)Quarterly price in cents (null = not offered quarterly).
priceYearlyinteger (nullable)Yearly price in cents (null = not offered yearly).
priceOneTimeinteger (nullable)One-time price in cents (null = not offered as a single charge). Access lasts accessDurationMonths then expires.
installmentTotalPriceinteger (nullable)Total amount the buyer commits to across installmentCount charges. Null = installment plan not offered.
installmentCountinteger (nullable)How many charges (e.g. 3).
installmentIntervalMonthsinteger (nullable)Months between installment charges (typically 1).
accessDurationMonthsinteger (nullable)How long access lasts from signup (typically 12).
installmentRenewsAnnuallybooleanWhen true + an installment plan is set, the N-charge cycle repeats every accessDurationMonths. False = single-cycle.
foundingPriceMonthly / Quarterly / Yearlyinteger (nullable)Founding-member discount prices. Used in place of the regular price until foundingMemberCap is reached.
foundingMemberCapinteger (nullable)Max members eligible for the founding rate. Null = no cap.
foundingMemberCountintegerCurrent count of founding-rate members (drives the "N spots left" UI).

Configuration model + buyer-experience matrix lives in Memberships.

Example:

curl https://api.cobuntu.com/api/v1/communities/my-community/segments/public \
  -H "X-API-Key: pk_live_..."

GET /communities/{communityTag}/segments/{segmentId}/check-email — Check whether an email is already registered for this segment

Scope: READ_PUBLIC

Path parameters:

ParamTypeDescription
communityTagstringYour community's tag (e.g. your-community, acme).
segmentIdstringSegment identifier from GET /segments/public.

Query parameters:

ParamTypeDefaultDescription
emailstringEmail address (RFC 5322).

Response (200):

{
  "exists": false,
  "status": "…",
}
FieldTypeDescription
existsboolean
statusstring

Example:

curl https://api.cobuntu.com/api/v1/communities/my-community/segments/EXAMPLE_ID/check-email \
  -H "X-API-Key: pk_live_..."

GET /communities/{communityTag}/segments/{segmentId}/form — Get the segment's form schema

Scope: READ_PUBLIC

Path parameters:

ParamTypeDescription
communityTagstringYour community's tag (e.g. your-community, acme).
segmentIdstringSegment identifier from GET /segments/public.

Response (200):

{
  "segmentId": "…",
  "schema": […],
}
FieldTypeDescription
segmentIdstring
schemaarray

Example:

curl https://api.cobuntu.com/api/v1/communities/my-community/segments/EXAMPLE_ID/form \
  -H "X-API-Key: pk_live_..."

POST /communities/{communityTag}/rules/accept — Accept the community rules (per visitor / on first member action)

Scope: WRITE_MEMBERS

Path parameters:

ParamTypeDescription
communityTagstringYour community's tag (e.g. your-community, acme).

Request body:

{
  "rulesVersion": 0,
}
FieldTypeDescription
rulesVersionintegerInteger version of the rules document the visitor accepted. Get the current version from the community's storefront config.

Response (200):

{
  "ok": false,
}
FieldTypeDescription
okbooleanAlways true on a 200 response.

Example:

curl -X POST \
  https://api.cobuntu.com/api/v1/communities/my-community/rules/accept \
  -H "X-API-Key: sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{ /* request body */ }'

PATCH /communities/{communityTag}/segments/{segmentId} — Update a segment (name / pricing / active)

Scope: ADMIN

Path parameters:

ParamTypeDescription
communityTagstringYour community's tag (e.g. your-community, acme).
segmentIdstringSegment identifier from GET /segments/public.

Request body:

{
  "name": "…",
  "priceMonthly": 0,                   // nullable
  "priceQuarterly": 0,                 // nullable
  "priceYearly": 0,                    // nullable
  "priceOneTime": 0,                   // nullable
  "installmentTotalPrice": 0,          // nullable
  "installmentCount": 0,               // nullable
  "installmentIntervalMonths": 0,      // nullable
  "accessDurationMonths": 0,           // nullable
  "installmentRenewsAnnually": false,
  "isActive": false
}
FieldTypeDescription
namestringNew display name. Preserves the segment's id and existing memberships.
priceMonthlyinteger (nullable)New monthly price in cents. Null disables monthly. Existing subscribers keep their current billing until renewal.
priceQuarterlyinteger (nullable)New quarterly price in cents. Null disables quarterly.
priceYearlyinteger (nullable)New yearly price in cents. Null disables yearly.
priceOneTimeinteger (nullable)One-time price in cents. Null disables the one-time offer.
installmentTotalPriceinteger (nullable)Total committed across installmentCount charges. All four installment fields are a unit — set all or none.
installmentCountinteger (nullable)How many charges.
installmentIntervalMonthsinteger (nullable)Months between charges.
accessDurationMonthsinteger (nullable)How long access lasts after signup. Also the renewal anchor when installmentRenewsAnnually = true.
installmentRenewsAnnuallybooleanRepeats the installment cycle every accessDurationMonths. Ignored if no installment plan is configured.
isActivebooleanFalse = closed to new members (existing memberships unaffected). True = open for new applications.

Response (200): same shape as GET /segments/public (see above).

Example:

curl -X PATCH \
  https://api.cobuntu.com/api/v1/communities/my-community/segments/EXAMPLE_ID \
  -H "X-API-Key: sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{ /* request body */ }'

POST /communities/{communityTag}/segments/{segmentId}/submit — Submit the segment's form (= apply for membership)

Scope: WRITE_MEMBERS

Path parameters:

ParamTypeDescription
communityTagstringYour community's tag (e.g. your-community, acme).
segmentIdstringSegment identifier from GET /segments/public.

Request body:

{
  "answers": { "<fieldId>": "…", "email": "buyer@example.com", "name": "Jane" },
  "source": "community_app",
  "billingCycle": "ONE_TIME"
}
FieldTypeDescription
answersobjectForm answers keyed by field id. Must match the segment's form schema (GET /segments/{segmentId}/form). email and name are extracted from answers — the form's EMAIL field and the SHORT_TEXT field whose label contains "name" are required.
sourcestring (optional)Free-form attribution (e.g. "community_app", "landing_page", "linktree"). Persisted on the membership_request and exposed in the member.requested webhook.
billingCyclestring (enum) (optional)One of MONTHLY, QUARTERLY, YEARLY, ONE_TIME, INSTALLMENT_PLAN. Required when the tier exposes more than one billing cycle (returns 400 otherwise). Optional / can be omitted when the tier has exactly one cycle configured (server resolves it). See Memberships → Mixing payment styles.

Response (201) — free-tier auto-approve path:

{
  "success": true,
  "requestId": "…",
  "requestStatus": "APPROVED",
  "segmentName": "Free",
  "segmentId": "…"
}

Response (201) — paid-tier path (PAYMENT_PENDING):

{
  "success": true,
  "requestId": "…",
  "paymentRequired": true,
  "segmentId": "…",
  "segmentName": "Membro 3x"
}

When paymentRequired: true, the integrator must chain a call to POST /communities/{tag}/apply/checkout with the requestId to obtain the Stripe Checkout URL.

FieldTypeDescription
successbooleanAlways true on a 201 response.
requestIdstringStable id for the membership request. Carried in the member.requested webhook payload and required for the downstream paid-checkout call.
requestStatusstring (enum) (free path)APPROVED for auto-approve segments (OPEN + LIVE community), else PENDING for admin review.
paymentRequiredboolean (paid path)true when the tier is paid and the buyer must complete Stripe Checkout to finalize.
segmentIdstringEcho of the path parameter.
segmentNamestringDisplay name (useful for "Welcome to {segmentName}" confirmation copy).

Error responses:

CodeWhen
400 ALREADY_MEMBERThe email already has an ACCEPTED membership in this community.
400 APPLICATION_PENDINGThe email has a pending application — wait for admin review or pay outstanding.
400 genericMissing required form fields, invalid billingCycle for this tier, tier sold out, etc.

Example:

curl -X POST \
  https://api.cobuntu.com/api/v1/communities/my-community/segments/EXAMPLE_ID/submit \
  -H "X-API-Key: sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{ /* request body */ }'

POST /communities/{communityTag}/apply/checkout — Create Stripe Checkout for a PAYMENT_PENDING application

Scope: WRITE_MEMBERS

Issues a Stripe Checkout URL for a PAYMENT_PENDING membership request created by POST /segments/{segmentId}/submit. The session shape (subscription vs payment mode, recurring interval, cancel_at) is resolved server-side from the request's persisted billingCycle.

Path parameters:

ParamTypeDescription
communityTagstringYour community's tag.

Request body:

{
  "requestId": "…",
  "origin": "https://my-community.com"
}
FieldTypeDescription
requestIdstringThe requestId returned from the prior /segments/{segmentId}/submit call. Must reference a row in PAYMENT_PENDING status.
originstring (optional)Browser origin used to build the success / cancel URLs. Defaults to APP_BASE_URL if omitted.

Response (200):

{
  "checkoutUrl": "https://checkout.stripe.com/c/pay/cs_test_…",
  "sessionId": "cs_test_…"
}
FieldTypeDescription
checkoutUrlstringRedirect the buyer's browser here.
sessionIdstringStripe Checkout session id.

Error responses:

CodeWhen
400requestId is not in PAYMENT_PENDING status (already paid, never created, etc.).
400Tier has no price configured for the requested billingCycle.

Example:

curl -X POST \
  https://api.cobuntu.com/api/v1/communities/my-community/apply/checkout \
  -H "X-API-Key: pk_live_..." \
  -H "Content-Type: application/json" \
  -d '{ "requestId": "abc-123", "origin": "https://my-community.com" }'