REST API - Space Categories
General informations
Available since v. 2.7.*
Get all categories
Available for all confluence users
Method type:Â GET
URL: {CONFLUENCE_URL}/rest/extender/1.0/category/getAllCategories
Response format -Â JSON
Example response:
{
"categories": [
{
"name": "category1",
"id": 1146882,
"niceName": "Category1"
},
{
"name": "category2",
"id": 1146883,
"niceName": "Category2"
},
{
"name": "test",
"id": 1146881,
"niceName": "Test"
}
]
}
Â
Get space categories
Available only for Confluence Administrators and Space Administrators
Method type:Â GET
URL: {CONFLUENCE_URL}/rest/extender/1.0/category/getSpaceCategories/{SPACE_KEY}
where {SPACE_KEY} is the space key
Response format -Â JSON
Example response:
{
"name": "Test space",
"categories": [
{
"name": "category1",
"id": 1146882,
"niceName": "Category1"
},
{
"name": "category2",
"id": 1146883,
"niceName": "Category2"
},
{
"name": "test",
"id": 1146881,
"niceName": "Test"
}
],
"key": "TESTSPACE"
}
Â
Add category to space
Method type:Â PUT
URL: {CONFLUENCE_URL}/rest/extender/1.0/category/addSpaceCategory/space/{SPACE_KEY}/category/{CATEGORY_NAME}
where {SPACE_KEY} is the space key
where {CATEGORY_NAME} is category name to add
Response format -Â JSON
Â
Rename category
Method type:Â PUT
URL: {CONFLUENCE_URL}/rest/extender/1.0/category/renameCategory/category/{OLD_CATEGORY_NAME}/renameTo/{NEW_CATEGORY_NAME}
where {OLD_CATEGORY_NAME} is existing category name
where {NEW_CATEGORY_NAME} is new category name after change
Response format -Â JSON
Â
Remove category from space
Method type:Â DELETE
URL: {CONFLUENCE_URL}/rest/ui/1.0/space/{SPACE_KEY}/label/{LABEL_ID}
where {SPACE_KEY} is the space key
where {LABEL_ID} is label id to delete form space
Â