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), and an active flag.

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. bela-escala, orbis).

Response (200):

[
  {
      "id": "…",
      "name": "…",
      "description": "…"  // nullable,
      "color": "…",
      "hasForm": false,
      "priceMonthly": 0  // nullable,
      "priceQuarterly": 0  // nullable,
      "priceYearly": 0  // nullable,
    }
]
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).
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).

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. bela-escala, orbis).
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. bela-escala, orbis).
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. bela-escala, orbis).

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. bela-escala, orbis).
segmentIdstringSegment identifier from GET /segments/public.

Request body:

{
  "name": "…",
  "priceMonthly": 0  // nullable,
  "priceQuarterly": 0  // nullable,
  "priceYearly": 0  // nullable,
  "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.
isActivebooleanFalse = closed to new members (existing memberships unaffected). True = open for new applications.

Response (200):

{
  "id": "…",
  "name": "…",
  "description": "…"  // nullable,
  "color": "…",
  "hasForm": false,
  "priceMonthly": 0  // nullable,
  "priceQuarterly": 0  // nullable,
  "priceYearly": 0  // nullable,
}
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).
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).

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. bela-escala, orbis).
segmentIdstringSegment identifier from GET /segments/public.

Request body:

{
  "email": "…",
  "name": "…",
  "formAnswers": { … },
}
FieldTypeDescription
emailstring (email)Applicant's email. If a membership request for this email already exists for this segment, the response is 409 with the existing request id.
namestringApplicant's display name. Required for downstream member.requested event payloads + email correspondence.
formAnswersobjectForm answers keyed by field id. Shape must match the segment's form schema (GET /segments/{segmentId}/form).

Response (200):

{
  "ok": false,
  "requestId": "…",
  "status": "…",
}
FieldTypeDescription
okbooleanAlways true on a 200 response.
requestIdstringStable id for the membership request. Carried in the member.requested webhook payload.
statusstring (enum)PENDING for review-required communities; ACCEPTED when the segment is auto-approve.

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 */ }'