> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # UpdateCategory # Package: faqApp # Namespace: CategoryService # Method link: https://dev.wix.com/docs/api-reference/business-management/faq-app/category-v2/update-category.md ## Permission Scopes: Manage FAQ: SCOPE.DC-LABS.MANAGE-FAQ ## Introduction Updates a category. Each time the category is updated, `revision` increments by 1. The current `revision` must be specified when updating the category. This ensures you're working with the latest category and prevents unintended overwrites. Updates can be partial. --- ## REST API ### Schema ``` Method: updateCategory Description: Updates a category. Each time the category is updated, `revision` increments by 1. The current `revision` must be specified when updating the category. This ensures you're working with the latest category and prevents unintended overwrites. Updates can be partial. URL: https://www.wixapis.com/faq/v2/categories/{category.id} Method: PATCH # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: category, category.id, category.revision Method parameters: param name: category | type: Category | description: Categories are themed groupings of FAQ question entries that a site owner can create to organize their FAQ questions. For example, Shipping or Returns. Each category can contain multiple questions and is displayed as a section on a site's Wix FAQ widgets. | required: true - name: id | type: string | description: Category GUID. | required: true - name: revision | type: string | description: Revision number, which increments by 1 each time the category is updated. To prevent conflicting changes, the current revision must be specified when updating the category. Ignored when creating a category. | required: true - name: title | type: string | description: Category title displayed on a site's Wix FAQ widgets. - name: sortOrder | type: number | description: Order of the category within a site's Wix FAQ dashboard page. Categories with lower sort order values appear first. - name: extendedFields | type: ExtendedFields | description: Custom field data for the `category` object. [Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions.md) must be configured in the app dashboard before they can be accessed with API calls. - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured. You can only access fields for which you have the appropriate permissions. Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md). Return type: UpdateCategoryResponse - name: category | type: Category | description: Updated category. - name: id | type: string | description: Category GUID. - name: revision | type: string | description: Revision number, which increments by 1 each time the category is updated. To prevent conflicting changes, the current revision must be specified when updating the category. Ignored when creating a category. - name: createdDate | type: string | description: Date and time the category was created. - name: updatedDate | type: string | description: Date and time the category was last updated. - name: title | type: string | description: Category title displayed on a site's Wix FAQ widgets. - name: sortOrder | type: number | description: Order of the category within a site's Wix FAQ dashboard page. Categories with lower sort order values appear first. - name: extendedFields | type: ExtendedFields | description: Custom field data for the `category` object. [Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions.md) must be configured in the app dashboard before they can be accessed with API calls. - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured. You can only access fields for which you have the appropriate permissions. Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md). ``` ### Examples ### UpdateCategory ```curl ~~~cURL curl --request PATCH \ --url https://www.wixapis.com/faq/v2/categories/a1b2c3d4-e5f6-7890-abcd-ef1234567890 \ --header 'Authorization: ' \ --header 'Content-Type: application/json' \ --data '{ "category": { "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "revision": 2, "title": "Shipping, Delivery & Tracking" }, "field_mask": { "paths": ["title"] } }' ~~~ ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.faqApp.CategoryService.updateCategory(_id, category) Description: Updates a category. Each time the category is updated, `revision` increments by 1. The current `revision` must be specified when updating the category. This ensures you're working with the latest category and prevents unintended overwrites. Updates can be partial. # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: category, _id, category.revision Method parameters: param name: _id | type: string | description: Category GUID. | required: true param name: category | type: UpdateCategory | description: Categories are themed groupings of FAQ question entries that a site owner can create to organize their FAQ questions. For example, Shipping or Returns. Each category can contain multiple questions and is displayed as a section on a site's Wix FAQ widgets. | required: true - name: revision | type: string | description: Revision number, which increments by 1 each time the category is updated. To prevent conflicting changes, the current revision must be specified when updating the category. Ignored when creating a category. | required: true - name: title | type: string | description: Category title displayed on a site's Wix FAQ widgets. - name: sortOrder | type: number | description: Order of the category within a site's Wix FAQ dashboard page. Categories with lower sort order values appear first. - name: extendedFields | type: ExtendedFields | description: Custom field data for the `category` object. [Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions.md) must be configured in the app dashboard before they can be accessed with API calls. - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured. You can only access fields for which you have the appropriate permissions. Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md). Return type: PROMISE - name: _id | type: string | description: Category GUID. - name: revision | type: string | description: Revision number, which increments by 1 each time the category is updated. To prevent conflicting changes, the current revision must be specified when updating the category. Ignored when creating a category. - name: _createdDate | type: Date | description: Date and time the category was created. - name: _updatedDate | type: Date | description: Date and time the category was last updated. - name: title | type: string | description: Category title displayed on a site's Wix FAQ widgets. - name: sortOrder | type: number | description: Order of the category within a site's Wix FAQ dashboard page. Categories with lower sort order values appear first. - name: extendedFields | type: ExtendedFields | description: Custom field data for the `category` object. [Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions.md) must be configured in the app dashboard before they can be accessed with API calls. - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured. You can only access fields for which you have the appropriate permissions. Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md). ``` ### Examples ### updateCategory ```javascript import { category } from '@wix/faq'; async function updateCategory(_id,category) { const response = await category.updateCategory(_id,category); }; ``` ### updateCategory (with elevated permissions) ```javascript import { category } from '@wix/faq'; import { auth } from '@wix/essentials'; async function myUpdateCategoryMethod(_id,category) { const elevatedUpdateCategory = auth.elevate(category.updateCategory); const response = await elevatedUpdateCategory(_id,category); } ``` ### updateCategory (self-hosted) Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md). ```javascript import { createClient } from '@wix/sdk'; import { category } from '@wix/faq'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { category }, // Include the auth strategy and host as relevant }); async function updateCategory(_id,category) { const response = await myWixClient.category.updateCategory(_id,category); }; ``` ---