> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> 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`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - 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 | read-only: true | validation: format 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. | required: true | read-only: true | validation: format int64
        - name: title | type: string | description: Category title displayed on a site's Wix FAQ widgets.  | validation: minLength 1, maxLength 500
        - 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.  | validation: minimum 0, format double
        - 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).  | validation: format map
 Return type: UpdateCategoryResponse
  - name: category | type: Category | description: Updated category.  
     - name: id | type: string | description: Category GUID.  | read-only: true | validation: format 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.  | read-only: true | validation: format int64
     - name: createdDate | type: string | description: Date and time the category was created.  | read-only: true | validation: format date-time
     - name: updatedDate | type: string | description: Date and time the category was last updated.  | read-only: true | validation: format date-time
     - name: title | type: string | description: Category title displayed on a site's Wix FAQ widgets.  | validation: minLength 1, maxLength 500
     - 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.  | validation: minimum 0, format double
     - 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).  | validation: format map


```

### Examples

### UpdateCategory
```curl
~~~cURL
curl --request PATCH \
  --url https://www.wixapis.com/faq/v2/categories/a1b2c3d4-e5f6-7890-abcd-ef1234567890 \
  --header 'Authorization: <AUTH>' \
  --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.faq.category.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 | validation: format GUID
   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 | read-only: true | validation: format int64
        - name: title | type: string | description: Category title displayed on a site's Wix FAQ widgets.  | validation: minLength 1, maxLength 500
        - 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.  | validation: minimum 0
        - 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).  | validation: format map
 Return type: PROMISE<Category>
  - name: _id | type: string | description: Category GUID.  | read-only: true | validation: format 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.  | read-only: true | validation: format int64
  - name: _createdDate | type: Date | description: Date and time the category was created.  | read-only: true 
  - name: _updatedDate | type: Date | description: Date and time the category was last updated.  | read-only: true 
  - name: title | type: string | description: Category title displayed on a site's Wix FAQ widgets.  | validation: minLength 1, maxLength 500
  - 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.  | validation: minimum 0
  - 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).  | validation: format map


```

### 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-managed)
Self-managed 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);
};
```

---