API reference

Categories

Categories sort the posts of your Sublaunch's Community, each with who posts, comments and reads in it. Every Sublaunch has general, which stays.

Categories change in the Sublaunch's draft. Members see them once you publish the draft.

The category object

A category of your Sublaunch's Community, and who posts, comments and reads in it.

Attributes

  • idstring
    Unique identifier for the category. Every Sublaunch has general.
  • objectstring
    Always category.
  • namestring
    The category's name.
  • who_can_poststring
    Who can post in it.
    membersadmins
  • who_can_commentstring
    Who can comment in it.
    membersadmins
  • who_can_viewstring or null
    Who sees its posts. tiers keeps it to the tiers in tier_ids.
    publicmembersadminstiers
  • tier_idsarray of strings
    The tiers that see it, when who_can_view is tiers.
  • sortstring
    The order of its feed. default puts pinned posts first, then the newest.
    defaultnewtop
Category object
{
  "id": "x7Lp2QaZ",
  "object": "category",
  "name": "Trade ideas",
  "who_can_post": "members",
  "who_can_comment": "members",
  "who_can_view": "tiers",
  "tier_ids": ["tier1"],
  "sort": "new"
}

List categories

GET/v1/categoriesread scopeMCPlist_categories

Returns the Community's categories as the draft has them.

Returns

A list of category objects, whole in one page.

GET/v1/categories
curl https://api.sublaunch.com/v1/categories \
  -H "Authorization: Bearer $SUBLAUNCH_API_KEY"
Response200
{
  "object": "list",
  "data": [
    {
      "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"
    }
  ],
  "has_more": false,
  "next_cursor": null
}

Create a category

POST/v1/categorieswrite scopeMCPcreate_category

Adds a category to the Community, in the draft.

Body parameters

  • namestringRequired
    The category's name, from 1 to 30 characters.
  • who_can_poststring
    Who can post in it. members by default.
    membersadmins
  • who_can_commentstring
    Who can comment in it. members by default.
    membersadmins
  • who_can_viewstring
    Who sees its posts. tiers keeps it to the tiers in tier_ids.
    publicmembersadminstiers
  • tier_idsarray of strings
    With who_can_view set to tiers, the tiers that see it, by ID.
  • sortstring
    The order of its feed. default puts pinned posts first, then the newest. top puts the most liked first.
    defaultnewtop

Returns

The new category object.

Errors

POST/v1/categories
curl -X POST https://api.sublaunch.com/v1/categories \
  -H "Authorization: Bearer $SUBLAUNCH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Trade ideas",
    "who_can_view": "tiers",
    "tier_ids": ["tier1"],
    "sort": "new"
  }'
Response201
{
  "id": "x7Lp2QaZ",
  "object": "category",
  "name": "Trade ideas",
  "who_can_post": "members",
  "who_can_comment": "members",
  "who_can_view": "tiers",
  "tier_ids": ["tier1"],
  "sort": "new"
}

Update a category

PATCH/v1/categories/:category_idwrite scopeMCPupdate_category

Changes a category in the draft. Send only the fields to change.

Path parameters

Body parameters

  • namestring
    The category's name, from 1 to 30 characters.
  • who_can_poststring
    Who can post in it. members by default.
    membersadmins
  • who_can_commentstring
    Who can comment in it. members by default.
    membersadmins
  • who_can_viewstring
    Who sees its posts. tiers keeps it to the tiers in tier_ids.
    publicmembersadminstiers
  • tier_idsarray of strings
    With who_can_view set to tiers, the tiers that see it, by ID.
  • sortstring
    The order of its feed. default puts pinned posts first, then the newest. top puts the most liked first.
    defaultnewtop

Returns

The updated category object.

Errors

PATCH/v1/categories/:category_id
curl -X PATCH \
  https://api.sublaunch.com/v1/categories/x7Lp2QaZ \
  -H "Authorization: Bearer $SUBLAUNCH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "who_can_comment": "admins"
  }'
Response200
{
  "id": "x7Lp2QaZ",
  "object": "category",
  "name": "Trade ideas",
  "who_can_post": "members",
  "who_can_comment": "admins",
  "who_can_view": "tiers",
  "tier_ids": ["tier1"],
  "sort": "new"
}

Delete a category

DELETE/v1/categories/:category_idwrite scopeMCPdelete_category

Removes a category in the draft. Its posts stay, without a category. general stays.

Path parameters

Returns

An object with the category's id and deleted set to true.

Errors

DELETE/v1/categories/:category_id
curl -X DELETE \
  https://api.sublaunch.com/v1/categories/x7Lp2QaZ \
  -H "Authorization: Bearer $SUBLAUNCH_API_KEY"
Response200
{
  "id": "x7Lp2QaZ",
  "object": "category",
  "deleted": true
}