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
- idstringUnique identifier for the category. Every Sublaunch has
general. - objectstringAlways
category. - namestringThe category's name.
- who_can_poststringWho can post in it.
membersadmins - who_can_commentstringWho can comment in it.
membersadmins - who_can_viewstring or nullWho sees its posts.
tierskeeps it to the tiers intier_ids.publicmembersadminstiers - tier_idsarray of stringsThe tiers that see it, when
who_can_viewistiers. - sortstringThe order of its feed.
defaultputs 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
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
Adds a category to the Community, in the draft.
Body parameters
- namestringRequiredThe category's name, from 1 to 30 characters.
- who_can_poststringWho can post in it.
membersby default.membersadmins - who_can_commentstringWho can comment in it.
membersby default.membersadmins - who_can_viewstringWho sees its posts.
tierskeeps it to the tiers intier_ids.publicmembersadminstiers - tier_idsarray of stringsWith
who_can_viewset totiers, the tiers that see it, by ID. - sortstringThe order of its feed.
defaultputs pinned posts first, then the newest.topputs the most liked first.defaultnewtop
Returns
The new category object.
Errors
- A required parameter is missing.
paramnames it. - A parameter has a value the API does not accept.
paramnames it. - The body has a field this endpoint does not take.
- A category has this name already.
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
Changes a category in the draft. Send only the fields to change.
Path parameters
- category_idstringRequiredThe category's ID, as List categories returns it.
Body parameters
- namestringThe category's name, from 1 to 30 characters.
- who_can_poststringWho can post in it.
membersby default.membersadmins - who_can_commentstringWho can comment in it.
membersby default.membersadmins - who_can_viewstringWho sees its posts.
tierskeeps it to the tiers intier_ids.publicmembersadminstiers - tier_idsarray of stringsWith
who_can_viewset totiers, the tiers that see it, by ID. - sortstringThe order of its feed.
defaultputs pinned posts first, then the newest.topputs the most liked first.defaultnewtop
Returns
The updated category object.
Errors
- No category with this ID in the key's Sublaunch.
- A parameter has a value the API does not accept.
paramnames it. - The body has a field this endpoint does not take.
- A category has this name already.
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
Removes a category in the draft. Its posts stay, without a category. general stays.
Path parameters
- category_idstringRequiredThe category's ID, as List categories returns it.
Returns
An object with the category's id and deleted set to true.
Errors
- No category with this ID in the key's Sublaunch.
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
}