Categories: Sample Use Cases & Flows

This article shares some possible use cases your app could support, as well as a sample flow that could support each use case. This can be a helpful jumping off point as you plan your app's implementation.

Sync categories across all sites

If you have multiple event sites using your app, you may need to sync event categories across these sites. For example, if you've added a new city for some of your concerts, such as "Chicago," you’ll need to create a new category named "Chicago" and apply this change to other sites as well.

To sync the category across all sites:

  1. Call Query Categories on the site where you created a new category.

  2. Extract the entire category object. Remove unnecessary fields, like createdDate.

  3. For all other sites, call Query Events and extract the IDs of all relevant events.

  4. Call Create Category on the other sites, passing the new category to each.

  5. Call Bulk Assign Events and assign the new category to all the previously extracted events.

Did this help?

Category Object


Properties
idstringRead-onlyformat GUID

Category ID.


namestringminLength 1maxLength 30

Category name.


createdDatestringRead-onlyformat date-time

Date and time when category was created.


countsCountsRead-only

The total number of draft and published events assigned to the category.


statesArray <string>maxItems 3

Category state. Possible values:

MANUAL: Category is created manually by the user. AUTO: Category is created automatically. RECURRING_EVENT: Category is created automatically when publishing recurring events. HIDDEN: Category can't be seen.

Default: MANUAL.

Note: The WIX_EVENTS.MANAGE_AUTO_CATEGORIES permission scope is required to use states other than MANUAL.

Category
JSON
Did this help?

POST

Create Category


Creates a category.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Events - all permissions
Manage Events
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/events/v1/categories

Body Params
categoryCategoryRequired

Category to create.

Response Object
categoryCategory

Created category.

Create Category Example 1
Request
cURL
Response
JSON
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?

POST

Bulk Create Category


Creates multipe categories at once.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Events - all permissions
Manage Events
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/events/v1/bulk/categories/create

Body Params
categoriesArray <Category>RequiredminItems 1maxItems 10

Categories to create.

Response Object
resultsArray <BulkCategoryResult>

Bulk create results.


bulkActionMetadataBulkActionMetadata

Metadata of results.

Bulk Create Category Example 1
Request
cURL
Response
JSON
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?

PATCH

Update Category


Updates an existing category.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Events - all permissions
Manage Events
Learn more about app permissions.
Endpoint
PATCH
https://www.wixapis.com/events/v1/categories/{category.id}

Path Params
category.idstringRequired

Category ID.

Body Params
categoryCategoryRequired

Category to update.

Response Object
categoryCategory

Updated category.

Update Category Example 1
Request
cURL
Response
JSON
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?