REST API - Space Categories

General informations


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

Â