REST API
Articles

Articles

Articles are long-form content (blog posts, announcements). Each article has a stable slug you can use to deep-link.

Workflow: create as DRAFT via POST /articles, then publish via PATCH /articles/:id with status: "PUBLISHED" (requires bannerUrl set). Once published, the article is visible via GET /articles + the article.published webhook fires.

Read endpoints (READ_PUBLIC) — list published, get by slug. Write endpoints (ADMIN) — create, update, publish/unpublish via the status field. Author is the community's founder user.

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

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

GET /communities/{communityTag}/articles — List published articles

Scope: READ_PUBLIC

Path parameters:

ParamTypeDescription
communityTagstringYour community's tag (e.g. bela-escala, orbis).

Query parameters:

ParamTypeDefaultDescription
limitinteger20Page size. Default 20, max 100.
offsetinteger0Zero-based offset for pagination. Use either offset or cursor — not both.

Response (200):

[
  {
      "id": "…",
      "slug": "…",
      "title": "…",
      "excerpt": "…",
      "publishedAt": "…",
      "bannerUrl": "…"  // nullable,
      "author": { … },
      "readTimeMinutes": 0,
      "content": "…",
    }
]
FieldTypeDescription
idstringStable article identifier (uuid).
slugstringURL-safe identifier; stable across edits.
titlestringArticle title.
excerptstringShort summary shown on list pages.
publishedAtstring (date-time)ISO 8601 publish timestamp. Articles only appear in this API once published.
bannerUrlstring (nullable)Hero image URL (or null).
authorobjectAuthor object ({ name, usertag, profileImage }).
readTimeMinutesintegerEstimated reading time in minutes.
contentstringHTML body.

Example:

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

POST /communities/{communityTag}/articles — Create an article (DRAFT)

Scope: ADMIN

Path parameters:

ParamTypeDescription
communityTagstringYour community's tag (e.g. bela-escala, orbis).

Request body:

{
  "title": "…",
  "content": "…",
  "excerpt": "…",
  "category": "…",
  "bannerUrl": "…",
}
FieldTypeDescription
titlestringArticle title. Required, non-empty. Used to generate the URL slug.
contentstringBody as sanitized HTML. Defaults to empty string if omitted.
excerptstringShort summary for listings (max 500 chars). Optional.
categorystringFree-form category label (max 100 chars). Optional.
bannerUrlstringHero image URL. Required to subsequently PATCH the article to status: PUBLISHED.

Response (201):

{
  "id": "…",
  "slug": "…",
  "title": "…",
  "excerpt": "…",
  "publishedAt": "…",
  "bannerUrl": "…"  // nullable,
  "author": { … },
  "readTimeMinutes": 0,
  "content": "…",
}
FieldTypeDescription
idstringStable article identifier (uuid).
slugstringURL-safe identifier; stable across edits.
titlestringArticle title.
excerptstringShort summary shown on list pages.
publishedAtstring (date-time)ISO 8601 publish timestamp. Articles only appear in this API once published.
bannerUrlstring (nullable)Hero image URL (or null).
authorobjectAuthor object ({ name, usertag, profileImage }).
readTimeMinutesintegerEstimated reading time in minutes.
contentstringHTML body.

Example:

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

GET /communities/{communityTag}/articles/slug/{slug} — Get article by slug

Scope: READ_PUBLIC

Path parameters:

ParamTypeDescription
communityTagstringYour community's tag (e.g. bela-escala, orbis).
slugstringURL slug from the event / article. Stable across edits.

Response (200):

{
  "id": "…",
  "slug": "…",
  "title": "…",
  "excerpt": "…",
  "publishedAt": "…",
  "bannerUrl": "…"  // nullable,
  "author": { … },
  "readTimeMinutes": 0,
  "content": "…",
}
FieldTypeDescription
idstringStable article identifier (uuid).
slugstringURL-safe identifier; stable across edits.
titlestringArticle title.
excerptstringShort summary shown on list pages.
publishedAtstring (date-time)ISO 8601 publish timestamp. Articles only appear in this API once published.
bannerUrlstring (nullable)Hero image URL (or null).
authorobjectAuthor object ({ name, usertag, profileImage }).
readTimeMinutesintegerEstimated reading time in minutes.
contentstringHTML body.

Example:

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

PATCH /communities/{communityTag}/articles/{articleId} — Update an article (incl. publish/unpublish)

Scope: ADMIN

Path parameters:

ParamTypeDescription
communityTagstringYour community's tag (e.g. bela-escala, orbis).
articleIdstringArticle identifier (uuid) from POST /articles response.

Request body:

{
  "title": "…",
  "content": "…",
  "excerpt": "…"  // nullable,
  "category": "…"  // nullable,
  "bannerUrl": "…"  // nullable,
  "status": "…",
}
FieldTypeDescription
titlestringNew title. Note: changing the title does NOT regenerate the slug — slugs are stable across edits.
contentstringNew HTML body.
excerptstring (nullable)New short summary; null to clear.
categorystring (nullable)New category; null to clear.
bannerUrlstring (nullable)New banner image; null to clear. Cannot be null if status becomes PUBLISHED in the same request — banners are required for published articles.
statusstring (enum)Workflow status. PUBLISHED makes the article visible via GET /articles + fires the article.published webhook. Setting back to DRAFT hides it again + fires article.deleted (legacy event name — fires on unpublish too).

Response (200):

{
  "id": "…",
  "slug": "…",
  "title": "…",
  "excerpt": "…",
  "publishedAt": "…",
  "bannerUrl": "…"  // nullable,
  "author": { … },
  "readTimeMinutes": 0,
  "content": "…",
}
FieldTypeDescription
idstringStable article identifier (uuid).
slugstringURL-safe identifier; stable across edits.
titlestringArticle title.
excerptstringShort summary shown on list pages.
publishedAtstring (date-time)ISO 8601 publish timestamp. Articles only appear in this API once published.
bannerUrlstring (nullable)Hero image URL (or null).
authorobjectAuthor object ({ name, usertag, profileImage }).
readTimeMinutesintegerEstimated reading time in minutes.
contentstringHTML body.

Example:

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