Categories

Creates a category

POST
https://discourse.example.com/categories.json

Body

application/json
namestringrequired
colorstring
Example
49d9e9
text_colorstring
Example
f0fcfd
style_typestring
emojistring
iconstring
parent_category_idinteger
allow_badgesboolean
slugstring
permissionsobject
Show child attributes
everyoneinteger
Example
1
staffinteger
search_priorityinteger
form_template_idsArray<any>
category_localizationsArray<object>
Show child attributes
idinteger

The unique identifier for an existing localization. Must be included otherwise the record will be deleted.

localestringrequired

The locale for the localization, e.g., 'en', 'zh_CN'. Locale should be in the list of SiteSetting.content_localization_supported_locales.

namestringrequired

The name of the category in the specified locale.

descriptionstring

The description excerpt of the category in the specified locale.

Response

200OKany

success response

Response fields application/json
categoryobjectrequired
Show child attributes
idintegerrequired
namestringrequired
colorstringrequired
text_colorstringrequired
style_typestringrequired
emojistring | nullrequired
iconstring | nullrequired
slugstringrequired
localestring | null
topic_countintegerrequired
post_countintegerrequired
positionintegerrequired
descriptionstring | nullrequired
description_textstring | nullrequired
description_excerptstring | nullrequired
topic_urlstring | nullrequired
read_restrictedbooleanrequired
permissioninteger | nullrequired
notification_levelintegerrequired
can_editbooleanrequired
topic_templatestring | nullrequired
topic_title_placeholderstring | nullrequired
form_template_idsArray<any>
has_childrenboolean | nullrequired
subcategory_countinteger | nullrequired
sort_orderstring | nullrequired
sort_ascendingstring | nullrequired
show_subcategory_listbooleanrequired
default_viewstring | nullrequired
subcategory_list_stylestringrequired
default_top_periodstringrequired
default_list_filterstringrequired
minimum_required_tagsintegerrequired
navigate_to_first_post_after_readbooleanrequired
custom_fieldsobjectrequired
allowed_tagsArray<any>
allowed_tag_groupsArray<any>
allow_global_tagsboolean
required_tag_groupsArray<object>required
Show child attributes
namestringrequired
min_countintegerrequired
category_settingobject
Show child attributes
auto_bump_cooldown_daysinteger
num_auto_bump_dailyinteger | null
require_reply_approvalboolean | null
require_topic_approvalboolean | null
nested_replies_defaultboolean | null
topic_posting_review_modestring
reply_posting_review_modestring
category_localizationsArray<any>
read_only_bannerstring | nullrequired
permission_groupsArray<object>
Show child attributes
idintegerrequired
namestringrequired
available_groupsArray<any>required
auto_close_hoursstring | nullrequired
auto_close_based_on_last_postbooleanrequired
allow_unlimited_owner_edits_on_first_postbooleanrequired
default_slow_mode_secondsstring | nullrequired
group_permissionsArray<object>required
Show child attributes
permission_typeintegerrequired
group_namestringrequired
group_idintegerrequired
email_instring | nullrequired
email_in_allow_strangersbooleanrequired
mailinglist_mirrorbooleanrequired
all_topics_wikibooleanrequired
can_deletebooleanrequired
allow_badgesbooleanrequired
search_priorityintegerrequired
topic_posting_review_group_idsArray<integer>required
reply_posting_review_group_idsArray<integer>required
uploaded_logo_darkstring | nullrequired
uploaded_backgroundstring | nullrequired
uploaded_background_darkstring | nullrequired
category_typesobject
category_type_settingsobject
available_category_typesArray<object>
Show child attributes
idstringrequired
namestringrequired
titlestringrequired
descriptionstringrequired
iconstringrequired
availablebooleanrequired
visiblebooleanrequired
configuration_schemaobjectrequired