Categories
Creates a category
POST
https://discourse.example.com/categories.json
Body
application/json
namestringrequiredcolorstringExample
49d9e9Copy
text_ colorstringExample
f0fcfdCopy
style_ typestringemojistringiconstringparent_ category_ idintegerallow_ badgesbooleanslugstringtopic_ featured_ links_ allowedbooleanpermissionsobjectShow child attributes
everyoneintegerExample
1Copy
staffintegersearch_ priorityintegerform_ template_ idsArray<any>category_ localizationsArray<object>Show child attributes
idintegerThe unique identifier for an existing localization. Must be included otherwise the record will be deleted.
localestringrequiredThe locale for the localization, e.g., 'en', 'zh_CN'. Locale should be in the list of SiteSetting.content_localization_supported_locales.
namestringrequiredThe name of the category in the specified locale.
descriptionstringThe description excerpt of the category in the specified locale.
Response
200OKany
success response
Response fields application/json
categoryobjectrequiredShow child attributes
idintegerrequirednamestringrequiredcolorstringrequiredtext_ colorstringrequiredstyle_ typestringrequiredemojistring | nullrequirediconstring | nullrequiredslugstringrequiredlocalestring | nulltopic_ countintegerrequiredpost_ countintegerrequiredpositionintegerrequireddescriptionstring | nullrequireddescription_ textstring | nullrequireddescription_ excerptstring | nullrequiredtopic_ urlstring | nullrequiredread_ restrictedbooleanrequiredpermissioninteger | nullrequirednotification_ levelintegerrequiredcan_ editbooleanrequiredtopic_ templatestring | nullrequiredtopic_ title_ placeholderstring | nullrequiredform_ template_ idsArray<any>has_ childrenboolean | nullrequiredsubcategory_ countinteger | nullrequiredsort_ orderstring | nullrequiredsort_ ascendingstring | nullrequiredshow_ subcategory_ listbooleanrequirednum_ featured_ topicsintegerrequireddefault_ viewstring | nullrequiredsubcategory_ list_ stylestringrequireddefault_ top_ periodstringrequireddefault_ list_ filterstringrequiredminimum_ required_ tagsintegerrequirednavigate_ to_ first_ post_ after_ readbooleanrequiredcustom_ fieldsobjectrequiredallowed_ tagsArray<any>allowed_ tag_ groupsArray<any>allow_ global_ tagsbooleanrequired_ tag_ groupsArray<object>requiredShow child attributes
namestringrequiredmin_ countintegerrequiredcategory_ settingobjectShow child attributes
auto_ bump_ cooldown_ daysintegernum_ auto_ bump_ dailyinteger | nullrequire_ reply_ approvalboolean | nullrequire_ topic_ approvalboolean | nullnested_ replies_ defaultboolean | nulltopic_ posting_ review_ modestringreply_ posting_ review_ modestringcategory_ localizationsArray<any>read_ only_ bannerstring | nullrequiredpermission_ groupsArray<object>Show child attributes
idintegerrequirednamestringrequiredavailable_ groupsArray<any>requiredauto_ close_ hoursstring | nullrequiredauto_ close_ based_ on_ last_ postbooleanrequiredallow_ unlimited_ owner_ edits_ on_ first_ postbooleanrequireddefault_ slow_ mode_ secondsstring | nullrequiredgroup_ permissionsArray<object>requiredShow child attributes
permission_ typeintegerrequiredgroup_ namestringrequiredgroup_ idintegerrequiredemail_ instring | nullrequiredemail_ in_ allow_ strangersbooleanrequiredmailinglist_ mirrorbooleanrequiredall_ topics_ wikibooleanrequiredcan_ deletebooleanrequiredallow_ badgesbooleanrequiredtopic_ featured_ link_ allowedbooleanrequiredsearch_ priorityintegerrequiredtopic_ posting_ review_ group_ idsArray<integer>requiredreply_ posting_ review_ group_ idsArray<integer>requireduploaded_ logostring | nullrequireduploaded_ logo_ darkstring | nullrequireduploaded_ backgroundstring | nullrequireduploaded_ background_ darkstring | nullrequiredcategory_ typesobjectcategory_ type_ settingsobjectavailable_ category_ typesArray<object>Show child attributes
idstringrequirednamestringrequiredtitlestringrequireddescriptionstringrequirediconstringrequiredavailablebooleanrequiredvisiblebooleanrequiredconfiguration_ schemaobjectrequired