> 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

# BulkCreateCategories

# Package: onlinePrograms

# Namespace: CategoriesService

# Method link: https://dev.wix.com/docs/api-reference/business-management/online-programs/categories/bulk-create-categories.md

## Permission Scopes:
Manage Online Programs: SCOPE.CHALLENGES.MANAGE

## Introduction

Creates up to 100 Categories in a single request.

The operation fails if the resulting site total would exceed 100 Categories. Each primary-language `label` must be unique within the site and within the request.

Individual Categories can fail while others succeed. Check each result's `itemMetadata.success` and `itemMetadata.error`, and use `itemMetadata.originalIndex` to match it to the input.

To create a single Category, use [Create Category](https://dev.wix.com/docs/api-reference/business-management/online-programs/categories/create-category.md).

---

## REST API

### Schema

```
 Method: bulkCreateCategories
 Description: Creates up to 100 Categories in a single request.  The operation fails if the resulting site total would exceed 100 Categories. Each primary-language `label` must be unique within the site and within the request.  Individual Categories can fail while others succeed. Check each result's `itemMetadata.success` and `itemMetadata.error`, and use `itemMetadata.originalIndex` to match it to the input.  To create a single Category, use [Create Category](https://dev.wix.com/docs/api-reference/business-management/online-programs/categories/create-category.md).
 URL: https://www.wixapis.com/_api/program-categories-service/v3/bulk/categories/create
 Method: POST
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  categories
 Method parameters: 
   param name: categories | type: array<categories> | description: Categories to create. | required: true | validation: minItems 1, maxItems 100
              - name: label | type: string | description: Category's display label. The primary-language label must be unique within the site. Localized reads return the Wix Multilingual translation when one exists, and otherwise fall back to the primary label.  | validation: maxLength 100
              - name: assignedTo | type: array<string> | description: IDs of Programs assigned to this Category. For routine assignment changes, use [Bulk Assign Categories to Program](https://dev.wix.com/docs/api-reference/business-management/online-programs/categories/bulk-assign-categories-to-program.md), whose 10-Category-per-Program check is best-effort. Direct writes to `assignedTo` through Create Category, Bulk Create Categories, or Update Category bypass that check; callers using them must keep each Program at or below 10 Categories. Relationship updates are eventually consistent across the Program Categories and Programs APIs.  | validation: maxItems 200, format GUID
              - name: extendedFields | type: ExtendedFields | description: Custom field data for the Category. [Extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md) must be configured in the app dashboard for `wix.achievements.categories.v3.category` 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
   param name: returnEntity | type: returnEntity | description: Whether to return the created Categories in the response.  Default: `false`.  
 Return type: BulkCreateCategoriesResponse
  - name: results | type: array<BulkCategoryResult> | description: Results for each processed Category.  
     - name: itemMetadata | type: ItemMetadata | description: Metadata for the processed Category.  
        - name: id | type: string | description: Item GUID, when available. May be absent if creation fails.  | validation: format GUID
        - name: originalIndex | type: integer | description: Index of the item within the bulk create request array. For Bulk Assign Categories to Program, correlate results by `id` instead; the index does not identify an item in either request list.  
        - name: success | type: boolean | description: Whether the requested action was successful for this item. When `false`, the `error` field is populated.  
        - name: error | type: ApplicationError | description: Details about the error in case of failure.  
           - name: code | type: string | description: Error code.  
           - name: description | type: string | description: Description of the error.  
           - name: data | type: object | description: Data related to the error.  
     - name: item | type: Category | description: Returned only when `returnEntity` is `true` in the request.  
        - 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 passed when updating the 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: label | type: string | description: Category's display label. The primary-language label must be unique within the site. Localized reads return the Wix Multilingual translation when one exists, and otherwise fall back to the primary label.  | validation: maxLength 100
        - name: assignedTo | type: array<string> | description: IDs of Programs assigned to this Category. For routine assignment changes, use [Bulk Assign Categories to Program](https://dev.wix.com/docs/api-reference/business-management/online-programs/categories/bulk-assign-categories-to-program.md), whose 10-Category-per-Program check is best-effort. Direct writes to `assignedTo` through Create Category, Bulk Create Categories, or Update Category bypass that check; callers using them must keep each Program at or below 10 Categories. Relationship updates are eventually consistent across the Program Categories and Programs APIs.  | validation: maxItems 200, format GUID
        - name: extendedFields | type: ExtendedFields | description: Custom field data for the Category. [Extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md) must be configured in the app dashboard for `wix.achievements.categories.v3.category` 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
  - name: bulkActionMetadata | type: BulkActionMetadata | description: Metadata about the bulk create operation.  
     - name: totalSuccesses | type: integer | description: Number of items that were successfully processed.  
     - name: totalFailures | type: integer | description: Number of items that couldn't be processed.  
     - name: undetailedFailures | type: integer | description: Number of failures without details because detailed failure threshold was exceeded.  


```

### Examples

### Create categories in bulk
Creates two reusable site-level categories and returns the created entities. Primary-language labels must be unique within the site and the request. The resulting site total cannot exceed 100 categories.

```curl
curl -X POST \
'https://www.wixapis.com/online-programs/v3/bulk/categories/create' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
  "categories": [
    {
      "label": "Nutrition"
    },
    {
      "label": "Mobility"
    }
  ],
  "returnEntity": true
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.onlinePrograms.categories.bulkCreateCategories(categories, options)
 Description: Creates up to 100 Categories in a single request.  The operation fails if the resulting site total would exceed 100 Categories. Each primary-language `label` must be unique within the site and within the request.  Individual Categories can fail while others succeed. Check each result's `itemMetadata.success` and `itemMetadata.error`, and use `itemMetadata.originalIndex` to match it to the input.  To create a single Category, use [Create Category](https://dev.wix.com/docs/api-reference/business-management/online-programs/categories/create-category.md).
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  categories
 Method parameters: 
   param name: categories | type: array<array> | description: Categories to create. | required: true | validation: minItems 1, maxItems 100
              - name: label | type: string | description: Category's display label. The primary-language label must be unique within the site. Localized reads return the Wix Multilingual translation when one exists, and otherwise fall back to the primary label.  | validation: maxLength 100
              - name: assignedTo | type: array<string> | description: IDs of Programs assigned to this Category. For routine assignment changes, use [Bulk Assign Categories to Program](https://dev.wix.com/docs/api-reference/business-management/online-programs/categories/bulk-assign-categories-to-program.md), whose 10-Category-per-Program check is best-effort. Direct writes to `assignedTo` through Create Category, Bulk Create Categories, or Update Category bypass that check; callers using them must keep each Program at or below 10 Categories. Relationship updates are eventually consistent across the Program Categories and Programs APIs.  | validation: maxItems 200, format GUID
              - name: extendedFields | type: ExtendedFields | description: Custom field data for the Category. [Extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md) must be configured in the app dashboard for `wix.achievements.categories.v3.category` 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
   param name: options | type: BulkCreateCategoriesOptions  none  
        - name: returnEntity | type: boolean | description: Whether to return the created Categories in the response.  Default: `false`.  
 Return type: PROMISE<BulkCreateCategoriesResponse>
  - name: results | type: array<BulkCategoryResult> | description: Results for each processed Category.  
     - name: itemMetadata | type: ItemMetadata | description: Metadata for the processed Category.  
        - name: _id | type: string | description: Item GUID, when available. May be absent if creation fails.  | validation: format GUID
        - name: originalIndex | type: integer | description: Index of the item within the bulk create request array. For Bulk Assign Categories to Program, correlate results by `id` instead; the index does not identify an item in either request list.  
        - name: success | type: boolean | description: Whether the requested action was successful for this item. When `false`, the `error` field is populated.  
        - name: error | type: ApplicationError | description: Details about the error in case of failure.  
           - name: code | type: string | description: Error code.  
           - name: description | type: string | description: Description of the error.  
           - name: data | type: object | description: Data related to the error.  
     - name: item | type: Category | description: Returned only when `returnEntity` is `true` in the request.  
        - 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 passed when updating the 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: label | type: string | description: Category's display label. The primary-language label must be unique within the site. Localized reads return the Wix Multilingual translation when one exists, and otherwise fall back to the primary label.  | validation: maxLength 100
        - name: assignedTo | type: array<string> | description: IDs of Programs assigned to this Category. For routine assignment changes, use [Bulk Assign Categories to Program](https://dev.wix.com/docs/api-reference/business-management/online-programs/categories/bulk-assign-categories-to-program.md), whose 10-Category-per-Program check is best-effort. Direct writes to `assignedTo` through Create Category, Bulk Create Categories, or Update Category bypass that check; callers using them must keep each Program at or below 10 Categories. Relationship updates are eventually consistent across the Program Categories and Programs APIs.  | validation: maxItems 200, format GUID
        - name: extendedFields | type: ExtendedFields | description: Custom field data for the Category. [Extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md) must be configured in the app dashboard for `wix.achievements.categories.v3.category` 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
  - name: bulkActionMetadata | type: BulkActionMetadata | description: Metadata about the bulk create operation.  
     - name: totalSuccesses | type: integer | description: Number of items that were successfully processed.  
     - name: totalFailures | type: integer | description: Number of items that couldn't be processed.  
     - name: undetailedFailures | type: integer | description: Number of failures without details because detailed failure threshold was exceeded.  


```

### Examples

### Create multiple categories
```javascript
import { categories } from "@wix/online-programs";

async function bulkCreateCategoriesExample() {
  const result = await categories.bulkCreateCategories(
    [
      {
        label: "Nutrition",
      },
      {
        label: "Mobility",
      },
    ],
    {
      returnEntity: true,
    },
  );
  return result;
}

/* Promise resolves to (captured response; Date values serialized as ISO strings):
{
  "results": [
    {
      "itemMetadata": {
        "originalIndex": 0,
        "success": true,
        "_id": "89f218e9-f0c9-40da-863e-2e7e042e1c2d"
      },
      "item": {
        "revision": "1",
        "label": "Nutrition",
        "assignedTo": [],
        "_id": "89f218e9-f0c9-40da-863e-2e7e042e1c2d",
        "_createdDate": "2026-10-15T08:18:25.301Z",
        "_updatedDate": "2026-10-15T08:18:25.301Z"
      }
    },
    {
      "itemMetadata": {
        "originalIndex": 1,
        "success": true,
        "_id": "b4b09d17-9a66-4313-b6c6-3fee1bdcb084"
      },
      "item": {
        "revision": "1",
        "label": "Mobility",
        "assignedTo": [],
        "_id": "b4b09d17-9a66-4313-b6c6-3fee1bdcb084",
        "_createdDate": "2026-10-15T08:18:25.301Z",
        "_updatedDate": "2026-10-15T08:18:25.301Z"
      }
    }
  ],
  "bulkActionMetadata": {
    "totalSuccesses": 2,
    "totalFailures": 0,
    "undetailedFailures": 0
  }
}
*/

```

### bulkCreateCategories (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 { categories } from '@wix/online-programs';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { categories },
  // Include the auth strategy and host as relevant
});


async function bulkCreateCategories(categories,options) {
  const response = await myWixClient.categories.bulkCreateCategories(categories,options);
};
```

---