> 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

# Package: portfolio

# Namespace: collections

# Webhook link: https://dev.wix.com/docs/api-reference/business-solutions/portfolio/collections/collection-updated.md

# Webhook Permissions Scopes IDs:
Manage Portfolio: SCOPE.PORTFOLIO.MANAGE-PORTFOLIO

## Introduction

Triggered when a collection is updated.

---

## REST API

### Schema

```
Webhook: Collection Updated
Description: Triggered when a collection is updated.
Event body:
 - name: id | type: string | description: Unique event ID. Allows clients to ignore duplicate events.
 - name: entityFqdn | type: string | description: Fully qualified domain name of the entity associated with the event.
 - name: slug | type: string | description: Event name.
 - name: entityId | type: string | description: ID of the entity associated with the event.
 - name: eventTime | type: string (date-time) | description: Event timestamp.
 - name: triggeredByAnonymizeRequest | type: boolean | description: Whether the event was triggered as a result of a privacy regulation application such as GDPR.
 - name: originatedFrom | type: string | description: If present, indicates the action that triggered the event.
 - name: updatedEvent | type: object | description: Updated event details.
    - name: currentEntity | type: Collection | description: The entity after the update.
        - name: id | type: string | description: Collection GUID.
        - name: revision | type: string | description: Revision number, which increments by 1 each time the collection is updated. To prevent conflicting changes, the existing revision must be passed when updating the collection object.
        - name: title | type: string | description: Collection title.
        - name: description | type: string | description: Collection description.
        - name: slug | type: string | description: Collection slug.
        - name: coverImage | type: Image | description: Collection cover image.
           - name: imageInfo | type: Image | description: Information about the Wix Media image.
              - name: id | type: string | description: WixMedia image GUID. Required.
              - name: url | type: string | description: Image URL.
              - name: height | type: integer | description: Original image height. Required.
              - name: width | type: integer | description: Original image width. Required.
              - name: altText | type: string | description: Image alt text.
              - name: filename | type: string | description: Image filename.
           - name: focalPoint | type: Point | description: Focal point of the image.
              - name: x | type: number | description: X-coordinate of the focal point.
              - name: y | type: number | description: Y-coordinate of the focal point.
           - name: altText | type: string | description: Alt text of the image, for screen readers and SEO. On read, the same value as `image_info.alt_text`. On write, both fields set the same stored value; when the update mask names this field, it wins. Use this field from the SDK, where `image_info` is a `wix:image` string that cannot carry alt text.
        - name: hidden | type: boolean | description: Whether the collection is hidden from the portfolio. Default: `false`
        - name: sortOrder | type: number | description: Index that determines which position a collection is displayed in the portfolio. <br />  Default: [Epoch](https://www.epoch101.com/) timestamp. <br />
        - name: createdDate | type: string | description: Date and time the collection was created.
        - name: updatedDate | type: string | description: Date and time the collection was updated.
        - name: url | type: PageUrlV2 | description: Collection page URL and relative path. Returned when `includePageUrl` is `true` in the request.
           - name: relativePath | type: string | description: The relative path for the page within the site. For example, `/product-page/a-product`.
           - name: url | type: string | description: The page's full URL. For example, `https://mysite.com/product-page/a-product`.
        - name: seoData | type: SeoSchema | description: Collection SEO data.
           - name: tags | type: array<Tag> | description: The tags rendered into <head>, in no particular order. Render order is decided by the renderer, not by position in this list.  No maxSize: this list is already populated by data written years ago, and a bound added now could reject a page that is already stored.
              - name: type | type: string | description: Legacy. Was a free-form string: "title" | "meta" | "script" | "link". The typed replacement is the `kind` oneof on `SeoSchemaV2.Tag`, which makes the invalid combinations unrepresentable rather than merely discouraged.  Which of these an API actually accepts depends on where the tag is being set: this list is not a blanket guarantee across every API that reuses this message. Site SEO Tags in particular accepts only `meta` (see `SiteSeoTags.tags`) and rejects `title`/`script`/`link` with a validation error even though they appear here — check the field description of the specific `tags`-typed field you are writing to.  Limitation: `title` and `script` (e.g. a `script` tag with `props.type` "application/ld+json" carrying structured data) are supported only when `custom` is unset or `false`. Setting `custom: true` on a `title` or `script` tag is rejected with `TAG_TYPE_NOT_ALLOWED`, because `custom: true` routes the write through the site's Advanced/Custom Tags list. To write structured data, omit `custom` (or set it to `false`).  No length limit: this field holds data written years ago by writers we are not migrating. A constraint here could reject a record that is already stored, which is exactly the promise this design makes.
              - name: props | type: object | description: Legacy. Was an untyped bag of HTML attributes. Typed replacement: `SeoSchemaV2.TitleTag` / `MetaTag` / `LinkTag`.
              - name: meta | type: object | description: Legacy. Was an untyped bag of 16 mixed-purpose keys. In `SeoSchemaV2` its contents are split by purpose: per-page structured-data state moves to StructuredDataTag, authorship to `written_by`, and render-time preset logic (variants, enabledByExperiment, removeSchemaIf*) moved out of the stored document entirely — it belongs to the preset definition, not to the page. See the design log for the full key-by-key mapping.
              - name: children | type: string | description: Legacy. Was the tag's inner content, doubling as the JSON-LD payload for script tags. Typed replacement: `SeoSchemaV2.TitleTag.text` and `StructuredDataTag.json_ld`. No length limit, for the same reason as `type` above.
              - name: custom | type: boolean | description: Whether the tag is a [custom tag](https://support.wix.com/en/article/adding-additional-meta-tags-to-your-sites-pages) — i.e. an entry from the site's Advanced/Custom Tags list.  Setting this to `true` on a write restricts which `type` values are accepted — the same restriction the Advanced/Custom Tags UI enforces. `title` and `script` tags (including JSON-LD structured data) must be sent with `custom` omitted or `false`; sending them with `custom: true` is rejected with `TAG_TYPE_NOT_ALLOWED`.  Note this is a separate restriction from Site SEO Tags' own type restriction on `SiteSeoTags.tags`: even with `custom` unset, Site SEO Tags rejects `script` (e.g. for site-wide structured data) unconditionally. There is currently no way to set site-wide, every-page structured data through any of these APIs — write a per-page `script` tag through the Item SEO Tags API instead.  This flag is scoped to that feature only. It is NOT an indicator of whether a standard tag (`title`, `description`, Open Graph, etc.) reflects a manually configured value versus a computed default/pattern — standard tags always resolve with `custom: false`, even when their content comes from a page's manually saved SEO title/description override. Don't use this field to verify whether a live page reflects a manual per-page SEO edit.  Limitation: when `ResolveStaticPageSeoTags` is called without `seoData`, the per-page SEO data is read only from the Vibe/Wix-managed-headless override store. That store holds nothing for classic Wix Editor or Wix Studio pages, so even genuine Advanced/Custom Tags saved on those pages are missing from the response entirely — there, `false` means this API could not tell, not that no custom tag exists. Pass `seoData` explicitly to resolve against a known set of tags.  `SeoSchemaV2.Tag` expresses this as `written_by = USER_CUSTOM`.
              - name: disabled | type: boolean | description: Whether the tag is excluded from the rendered <head>.  A disabled tag is still stored, so the user can re-enable it and so a pattern-provided tag stays suppressed on this page. Default false.
           - name: settings | type: Settings | description: Page-level SEO settings that are not themselves tags.
              - name: preventAutoRedirect | type: boolean | description: Whether to suppress the automatic redirect from this page's previous URL to its current one after a slug change.  Default false, meaning the redirect IS created. The field is named for the exception rather than the rule, which reads backwards; kept as-is because renaming a stored boolean is not worth the migration.
              - name: keywords | type: array<Keyword> | description: Keyword terms the user is targeting for this page. Used by the SEO assistant and checklist; never rendered into <head>.  20 is a sanity bound, not the product limit. v1 declared 5 — the number the panel happens to allow today — which is exactly the mistake we are fixing for structured data. A product decision to allow 8 should not need a proto release, so the panel owns that number and the proto only stops something absurd.
                 - name: term | type: string | description: The term itself, e.g. "trail running shoes".  No maxLength, for the same reason as the legacy tag fields: keywords are already stored, and a bound added now could reject a record written before the bound existed. The flynt `missing-string-validations` warning on this field is accepted deliberately.
                 - name: isMain | type: boolean | description: Whether this is the page's primary focus keyword. At most one per page.
                 - name: origin | type: string | description: Which surface added the term, e.g. a panel or a suggestion flow. Used for attribution in BI. Opaque to the renderer.

```

---

## JavaScript SDK

### Schema

```
Webhook: onCollectionUpdated
Description: Triggered when a collection is updated.
Payload: CollectionUpdatedEnvelope
  - name: entity | type: Collection | description: none
     - name: _id | type: string | description: Collection GUID.
     - name: revision | type: string | description: Revision number, which increments by 1 each time the collection is updated. To prevent conflicting changes, the existing revision must be passed when updating the collection object.
     - name: title | type: string | description: Collection title.
     - name: description | type: string | description: Collection description.
     - name: slug | type: string | description: Collection slug.
     - name: coverImage | type: Image | description: Collection cover image.
        - name: imageInfo | type: string | description: Information about the Wix Media image.
        - name: focalPoint | type: Point | description: Focal point of the image.
           - name: x | type: number | description: X-coordinate of the focal point.
           - name: y | type: number | description: Y-coordinate of the focal point.
        - name: altText | type: string | description: Alt text of the image, for screen readers and SEO. On read, the same value as `image_info.alt_text`. On write, both fields set the same stored value; when the update mask names this field, it wins. Use this field from the SDK, where `image_info` is a `wix:image` string that cannot carry alt text.
     - name: hidden | type: boolean | description: Whether the collection is hidden from the portfolio. Default: `false`
     - name: sortOrder | type: number | description: Index that determines which position a collection is displayed in the portfolio. <br />  Default: [Epoch](https://www.epoch101.com/) timestamp. <br />
     - name: _createdDate | type: Date | description: Date and time the collection was created.
     - name: _updatedDate | type: Date | description: Date and time the collection was updated.
     - name: url | type: string | description: Collection page URL and relative path. Returned when `includePageUrl` is `true` in the request.
     - name: seoData | type: SeoSchema | description: Collection SEO data.
        - name: tags | type: array<Tag> | description: The tags rendered into <head>, in no particular order. Render order is decided by the renderer, not by position in this list.  No maxSize: this list is already populated by data written years ago, and a bound added now could reject a page that is already stored.
           - name: type | type: string | description: Legacy. Was a free-form string: "title" | "meta" | "script" | "link". The typed replacement is the `kind` oneof on `SeoSchemaV2.Tag`, which makes the invalid combinations unrepresentable rather than merely discouraged.  Which of these an API actually accepts depends on where the tag is being set: this list is not a blanket guarantee across every API that reuses this message. Site SEO Tags in particular accepts only `meta` (see `SiteSeoTags.tags`) and rejects `title`/`script`/`link` with a validation error even though they appear here — check the field description of the specific `tags`-typed field you are writing to.  Limitation: `title` and `script` (e.g. a `script` tag with `props.type` "application/ld+json" carrying structured data) are supported only when `custom` is unset or `false`. Setting `custom: true` on a `title` or `script` tag is rejected with `TAG_TYPE_NOT_ALLOWED`, because `custom: true` routes the write through the site's Advanced/Custom Tags list. To write structured data, omit `custom` (or set it to `false`).  No length limit: this field holds data written years ago by writers we are not migrating. A constraint here could reject a record that is already stored, which is exactly the promise this design makes.
           - name: props | type: object | description: Legacy. Was an untyped bag of HTML attributes. Typed replacement: `SeoSchemaV2.TitleTag` / `MetaTag` / `LinkTag`.
           - name: meta | type: object | description: Legacy. Was an untyped bag of 16 mixed-purpose keys. In `SeoSchemaV2` its contents are split by purpose: per-page structured-data state moves to StructuredDataTag, authorship to `written_by`, and render-time preset logic (variants, enabledByExperiment, removeSchemaIf*) moved out of the stored document entirely — it belongs to the preset definition, not to the page. See the design log for the full key-by-key mapping.
           - name: children | type: string | description: Legacy. Was the tag's inner content, doubling as the JSON-LD payload for script tags. Typed replacement: `SeoSchemaV2.TitleTag.text` and `StructuredDataTag.json_ld`. No length limit, for the same reason as `type` above.
           - name: custom | type: boolean | description: Whether the tag is a [custom tag](https://support.wix.com/en/article/adding-additional-meta-tags-to-your-sites-pages) — i.e. an entry from the site's Advanced/Custom Tags list.  Setting this to `true` on a write restricts which `type` values are accepted — the same restriction the Advanced/Custom Tags UI enforces. `title` and `script` tags (including JSON-LD structured data) must be sent with `custom` omitted or `false`; sending them with `custom: true` is rejected with `TAG_TYPE_NOT_ALLOWED`.  Note this is a separate restriction from Site SEO Tags' own type restriction on `SiteSeoTags.tags`: even with `custom` unset, Site SEO Tags rejects `script` (e.g. for site-wide structured data) unconditionally. There is currently no way to set site-wide, every-page structured data through any of these APIs — write a per-page `script` tag through the Item SEO Tags API instead.  This flag is scoped to that feature only. It is NOT an indicator of whether a standard tag (`title`, `description`, Open Graph, etc.) reflects a manually configured value versus a computed default/pattern — standard tags always resolve with `custom: false`, even when their content comes from a page's manually saved SEO title/description override. Don't use this field to verify whether a live page reflects a manual per-page SEO edit.  Limitation: when `ResolveStaticPageSeoTags` is called without `seoData`, the per-page SEO data is read only from the Vibe/Wix-managed-headless override store. That store holds nothing for classic Wix Editor or Wix Studio pages, so even genuine Advanced/Custom Tags saved on those pages are missing from the response entirely — there, `false` means this API could not tell, not that no custom tag exists. Pass `seoData` explicitly to resolve against a known set of tags.  `SeoSchemaV2.Tag` expresses this as `written_by = USER_CUSTOM`.
           - name: disabled | type: boolean | description: Whether the tag is excluded from the rendered <head>.  A disabled tag is still stored, so the user can re-enable it and so a pattern-provided tag stays suppressed on this page. Default false.
        - name: settings | type: Settings | description: Page-level SEO settings that are not themselves tags.
           - name: preventAutoRedirect | type: boolean | description: Whether to suppress the automatic redirect from this page's previous URL to its current one after a slug change.  Default false, meaning the redirect IS created. The field is named for the exception rather than the rule, which reads backwards; kept as-is because renaming a stored boolean is not worth the migration.
           - name: keywords | type: array<Keyword> | description: Keyword terms the user is targeting for this page. Used by the SEO assistant and checklist; never rendered into <head>.  20 is a sanity bound, not the product limit. v1 declared 5 — the number the panel happens to allow today — which is exactly the mistake we are fixing for structured data. A product decision to allow 8 should not need a proto release, so the panel owns that number and the proto only stops something absurd.
              - name: term | type: string | description: The term itself, e.g. "trail running shoes".  No maxLength, for the same reason as the legacy tag fields: keywords are already stored, and a bound added now could reject a record written before the bound existed. The flynt `missing-string-validations` warning on this field is accepted deliberately.
              - name: isMain | type: boolean | description: Whether this is the page's primary focus keyword. At most one per page.
              - name: origin | type: string | description: Which surface added the term, e.g. a panel or a suggestion flow. Used for attribution in BI. Opaque to the renderer.
  - name: metadata | type: EventMetadata | description: none
     - name: instanceId | type: string | description: App instance GUID.
     - name: eventType | type: string | description: Event type.
     - name: identity | type: IdentificationData | description: The identification type and identity data.
        - ONE-OF:
           - name: anonymousVisitorId | type: string | description: GUID of a site visitor that has not logged in to the site.
           - name: memberId | type: string | description: GUID of a site visitor that has logged in to the site.
           - name: wixUserId | type: string | description: GUID of a Wix user (site owner, contributor, etc.).
           - name: appId | type: string | description: GUID of an app.
        - name: identityType | type: WebhookIdentityType | description: 
             - enum: UNKNOWN, ANONYMOUS_VISITOR, MEMBER, WIX_USER, APP
     - name: accountInfo | type: AccountInfo | description: Details related to the account
        - name: accountId | type: string | description: GUID of the Wix account associated with the event.
        - name: parentAccountId | type: string | description: GUID of the parent Wix account. Only included when accountId belongs to a child account.
        - name: siteId | type: string | description: GUID of the Wix site associated with the event. Only included when the event is tied to a specific site.
     - name: _id | type: string | description: Event GUID. With this GUID you can easily spot duplicated events and ignore them.
     - name: entityFqdn | type: string | description: Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities. For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.
     - name: slug | type: string | description: Event action name, placed at the top level to make it easier for users to dispatch messages. For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.
     - name: entityId | type: string | description: GUID of the entity associated with the event.
     - name: eventTime | type: Date | description: Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`.
     - name: triggeredByAnonymizeRequest | type: boolean | description: Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).
     - name: originatedFrom | type: string | description: If present, indicates the action that triggered the event.
     - name: entityEventSequence | type: string | description: A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at `16:00` and then again at `16:01`, the second update will always have a higher sequence number. You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.

```

### Examples


```javascript
import { collections } from '@wix/portfolio';

collections.onCollectionUpdated((event) => {
    // handle your event here
});
```


```javascript
import { createClient, AppStrategy } from '@wix/sdk';
import { collections } from '@wix/portfolio';

const wixClient = createClient({
  auth: AppStrategy({
    appId: 'MY-APP-ID',
    publicKey: 'YOUR_APP_PUBLIC_KEY',
  }),
  modules: {
      collections,
    },
});

wixClient.collections.onCollectionUpdated((event) => {
    // handle your event here
});
```

---