> 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: projectItems

# Webhook link: https://dev.wix.com/docs/api-reference/business-solutions/portfolio/project-items/project-item-created.md

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

## Introduction

Triggered when a project item is created.

---

## REST API

### Schema

```
Webhook: Project Item Created
Description: Triggered when a project item is created.
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: createdEvent | type: object | description: Created event details.
    - name: entity | type: Item | description: The created entity.
        - ONE-OF:
           - name: image | type: Image | description: Information about the Wix Media 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: video | type: Video | description: Information about the Wix Media video.
              - name: videoInfo | type: VideoV2 | description: Information about the Wix Media video.
                 - name: id | type: string | description: WixMedia GUID. Required.
                 - name: url | type: string | description: Video URL.
                 - name: resolutions | type: array<VideoResolution> | description: Available resolutions for the video, starting with the optimal resolution.
                    - name: url | type: string | description: Video URL.  Required.
                    - name: height | type: integer | description: Video height. Required.
                    - name: width | type: integer | description: Video width.  Required.
                    - name: format | type: string | description: Video format for example, mp4, hls.  Required.
                    - name: quality | type: string | description: Video quality for example 480p, 720p.
                    - name: filename | type: string | description: Video filename.
                 - name: filename | type: string | description: Video filename.
                 - name: posters | type: array<Image> | description: Video posters.
              - name: durationInMillis | type: integer | description: Manually defined Video duration in milliseconds.
        - name: projectId | type: string | description: Project GUID.
        - name: id | type: string | description: Project item GUID.
        - name: sortOrder | type: number | description: Index that determines which position a project is displayed in the project.  <br />  Default: [Epoch](https://www.epoch101.com/) timestamp. <br />
        - name: title | type: string | description: Project item title.
        - name: description | type: string | description: Project item description.
        - name: type | type: Type | description: Project item data type.
           - enum:
           -     UNDEFINED: Undefined item type.
           -     IMAGE: Image item type.
           -     VIDEO: Video item type.
        - name: createdDate | type: string | description: Date and time the project item was created.
        - name: updatedDate | type: string | description: Date and time the project item was last updated.
        - name: link | type: Link | description: Project item link.
           - name: text | type: string | description: Display text of the link.
           - name: url | type: string | description: Target URL of the link.
           - name: target | type: string | description: Whether the link opens in a new tab or window. One of: * `'_blank'`: The link opens in a new tab or window. * `'_self'`: The link opens in the same tab or window.

```

---

## JavaScript SDK

### Schema

```
Webhook: onProjectItemCreated
Description: Triggered when a project item is created.
Payload: ProjectItemCreatedEnvelope
  - name: entity | type: Item | description: none
     - ONE-OF:
        - name: image | type: Image | description: Information about the Wix Media 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: video | type: Video | description: Information about the Wix Media video.
           - name: videoInfo | type: string | description: Information about the Wix Media video.
           - name: durationInMillis | type: integer | description: Manually defined Video duration in milliseconds.
     - name: projectId | type: string | description: Project GUID.
     - name: _id | type: string | description: Project item GUID.
     - name: sortOrder | type: number | description: Index that determines which position a project is displayed in the project.  <br />  Default: [Epoch](https://www.epoch101.com/) timestamp. <br />
     - name: title | type: string | description: Project item title.
     - name: description | type: string | description: Project item description.
     - name: type | type: Type | description: Project item data type.
         - enum:
         -     UNDEFINED: Undefined item type.
         -     IMAGE: Image item type.
         -     VIDEO: Video item type.
     - name: _createdDate | type: Date | description: Date and time the project item was created.
     - name: _updatedDate | type: Date | description: Date and time the project item was last updated.
     - name: link | type: Link | description: Project item link.
        - name: text | type: string | description: Display text of the link.
        - name: url | type: string | description: Target URL of the link.
        - name: target | type: string | description: Whether the link opens in a new tab or window. One of: * `'_blank'`: The link opens in a new tab or window. * `'_self'`: The link opens in the same tab or window.
  - 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 { projectItems } from '@wix/portfolio';

projectItems.onProjectItemCreated((event) => {
    // handle your event here
});
```


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

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

wixClient.projectItems.onProjectItemCreated((event) => {
    // handle your event here
});
```

---