Categories APIs

Articles are categorized using categories, subcategories, and labels. The categories API enables you to manage categories and subcategories. Articles and labels are manged by other APIs.

You can create two levels of categories: the root level > categories > subcategories. A category can have subcategories, but these subcategories can not have subcategories of their own. A category can either have associated articles, or subcategories that have associated articles, but not both.
Importing Records
You can contact Wix Answers to enable administrators to import categories in bulk.

Get Category Information

Get List of Categories (User)

GET https://<tenant_subdomain>.wixanswers.com/api/v1/categories?locale={locale}

Get the list of categories for a specific language. Also see Get List of Categories (Agent).
  • Authorization: None
  • Content type: application/json; charset=utf-8
  • Accept: application/json
  • Response: List of Category objects
Request Params
Description
Type
Required
brandId
Brand ID
Brand GUID

locale
Category language
Language code string (for example: 'de')
Request Example:
1
GET https://wix.wixanswers.com/api/v1/categories?locale=en

Get List of Categories (Agent)

GET https://<tenant_subdomain>.wixanswers.com/api/v1/categories/admin?locale={locale}

Get the list of categories for a specific language. Unlike the user version (see Get List of Categories (User)), the included information includes extra details, such as the number of published and draft articles.
Request Params
Description
Type
Required
brandId
Brand ID
Brand GUID

locale
Category language
Language code string (for example: 'de')
Request Example:
1
GET https://wix.wixanswers.com/api/v1/categories/admin?locale=en

Get Category Information Using Category ID

GET https://<tenant_subdomain>.wixanswers.com/api/v1/categories/{category GUID}?locale={locale}

Get information about a category, given the category ID.
  • Authorization: None
  • Content type: application/json; charset=utf-8
  • Accept: application/json
  • Response: Category object
Request Params
Description
Type
Required
brandId
Brand ID
Brand GUID

locale
Category language
Language code string (for example: 'de')
Request Example:
1
GET https://wix.wixanswers.com/api/v1/categories/bd948e62-a3fd-4cf0-87f3-ee6a0ae7f3fa?locale=en

Get Category Information Using URI

Top-level category: GET https://<tenant_subdomain>.wixanswers.com/api/v1/categories/uri/{URI}?locale={locale}

Subcategory: GET https://<tenant_subdomain>.wixanswers.com/api/v1/categories/uri/{category URI}/{subcategory URI}?locale={locale}

Get information about a category, given the category URI and subcategory URI. A top-level category's URI is the last part of the URL when viewing the category. If you are getting a subcategory, the category and subcategory URIs are the last parts of the URL, separated by a "/",  when viewing the subcategory.
In the above picture, the category URI is getting-started-2722145.
In the above picture, the category URI is developers and the subcategory URI is overview.
  • Authorization: None
  • Content type: application/json; charset=utf-8
  • Accept: application/json
  • Response: Category object
Request Params
Description
Type

locale
Category language
Language code string (for example: 'de')
brandId
Brand ID
Brand GUID

Request Example (subcategory):
1
GET https://wix.wixanswers.com/api/v1/categories/uri/developers/overview?locale=en

Add Category

Add (Top-Level) Category

POST https://<tenant_subdomain>.wixanswers.com/api/v1/categories

Add a top-level category. The language used is the primary locale.
Payload Params
Description
Type
Required
name
Category name
String
position
Category sort order in the UI
Integer, 0 or higher

data
Structure of:
* iconKey (string): ID of Wix Answers stock image used to represent category
* iconSrc (string): URL of custom category image
Structure

brandId
Brand ID
Brand GUID
Payload Example:
1
2
3
4
5
6
POST https://<tenant_subdomain>.wixanswers.com/api/v1/categories/

{
    "name":"Development",
    "brandId": "77bc8694-5ccf-436c-ab2b-543563a5f425"
}

Add Subcategory

POST https://<tenant_subdomain>.wixanswers.com/api/v1/categories/{category GUID}

Add a subcategory under the category specified in the URL path. You cannot add a subcategory under a subcategory.

The request params / payload are the same as the ones for adding a top-level category. The parent category is taken from the GUID in the path.

Move a Category

PUT https://<tenant_subdomain>.wixanswers.com/api/v1/categories/{category GUID}/parent

Move a category to be a child of another category, or change a subcategory to a top-level category. If a category already has associated published articles, you cannot move a subcategory to that category.
Payload Params
Description
Type
Required
parentId
The new parent.

To change the category to a top-level category, use  
00000000-0000-0000-0000-000000000000 as the parent.
Payload Example:
1
2
3
4
5
PUT https://<tenant_subdomain>.wixanswers.com/api/v1/categories/e932c0a3-6e9b-43cf-b3a9-0ae790f6ee6a/parent

{
    "parentId":"77bc8694-5ccf-436c-ab2b-543563a5f425"
}

Manage Categories

Update Category

PUT https://<tenant_subdomain>.wixanswers.com/api/v1/categories/{category GUID}

Payload Params
Description
Type
Required
name
Category name
String

locale
Category language
Language code string (for example: 'de')
position
Category sort order in the UI
Integer, 0 or higher

data
Structure of:
* iconKey (string): ID of Wix Answers stock image used to represent category
* iconSrc (string): URL of custom category image
Structure

Payload Example:
1
2
3
4
5
6
PUT https://<tenant_subdomain>.wixanswers.com/api/v1/categories/e932c0a3-6e9b-43cf-b3a9-0ae790f6ee6a

{
    "locale":"en",
    "name":"Research"
}

Get Whether a Category is Associated with Any Articles

GET https://<tenant_subdomain>.wixanswers.com/api/v1/categories/{category GUID}/isUsed

Get whether a category has any subcategories or articles. The response is true or false.
Request Params
Description
Type
Required
brandId
Brand ID
Brand GUID

Request Example:
1
GET https://wix.wixanswers.com/api/v1/categories/bd948e62-a3fd-4cf0-87f3-ee6a0ae7f3fa/isUsed

Delete Category

DELETE https://<tenant_subdomain>.wixanswers.com/api/v1/categories/{category GUID}

Delete a category. You cannot delete a category if it has any associated articles or subcategories.
Request Params
Description
Type
Required
brandId
Brand ID
Brand GUID

Request Example:
1
DELETE https://wix.wixanswers.com/api/v1/categories/bd948e62-a3fd-4cf0-87f3-ee6a0ae7f3fa
Request Example Using curl:
1
curl -X DELETE https://wix.wixanswers.com/api/v1/categories/bd948e62-a3fd-4cf0-87f3-ee6a0ae7f3fa -H 'Authorization: Bearer {token}' -H 'Content-Type: application/json; charset=utf-8' -H 'Accept: application/json'

Sort Categories

POST https://<tenant_subdomain>.wixanswers.com/api/v1/categories/sort

Sort display of categories according to the specified order.
Payload Params
Description
Type
Required
parentId
The category to sort

To sort the top-level categories, use  
00000000-0000-0000-0000-000000000000 as the parent.
ids
List of categories/subcategories in the desired sort order

If you include any ids that are not associated with the category, the operation fails. If you do not include one or more ids that are are associated with the category, the ones that you include are sorted in the specified order and appear before the other (not included) ids.
List of GUIDs
Payload Example:
1
2
3
4
5
6
POST https://<tenant_subdomain>.wixanswers.com/api/v1/categories/sort

{
    "parentId":"00000000-0000-0000-0000-000000000000",
    "ids":["bd948e62-a3fd-4cf0-87f3-ee6a0ae7f3fa", "e932c0a3-6e9b-43cf-b3a9-0ae790f6ee6a"]
}

Manage Category Followers

Follow a Category

POST https://<tenant_subdomain>.wixanswers.com/api/v1/categories/{category GUID}/follow

Follow a category as an agent. You are notified when a category changes, such as when an article is added to the category.
  • Authorization: Requires agent authorization token for specific agent and permission FETCH_CATEGORIES
  • Content type: application/json; charset=utf-8
  • Accept: application/json
  • Response: None
Payload Params
Description
Type
Required
locale
Category language
Language code string (for example: 'de')
Payload Example:
1
2
3
4
5
POST https://<tenant_subdomain>.wixanswers.com/api/v1/categories/e932c0a3-6e9b-43cf-b3a9-0ae790f6ee6a/follow

{
    "locale":"en"
}

Unfollow a Category

DELETE https://<tenant_subdomain>.wixanswers.com/api/v1/categories/{category GUID}/follow?locale={locale}

Unfollow a category as an agent.
  • Authorization: Requires agent authorization token for specific agent and permission FETCH_CATEGORIES
  • Content type: application/json; charset=utf-8
  • Accept: application/json
  • Response: None
Request Params
Description
Type
Required
locale
Category language
Language code string (for example: 'de')

Get Whether You Are Following a Category

GET https://<tenant_subdomain>.wixanswers.com/api/v1/categories/{category GUID}/follow?locale={locale}

Get whether you are following a category. The response is true or false.
  • Authorization: Requires agent authorization token for specific agent and permission FETCH_CATEGORIES
  • Content type: application/json; charset=utf-8
  • Accept: application/json
  • Response: Boolean
Request Params
Description
Type
Required
locale
Category language
Language code string (for example: 'de')