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

# Namespace: cards

# Webhook link: https://dev.wix.com/docs/api-reference/crm/crm/pipelines-management/cards/card-moved.md

# Webhook Permissions Scopes IDs:
Read Pipelines: SCOPE.DC-CRM.READ-PIPELINES

## Introduction

Triggered when a card is moved from one stage to another.

---

## REST API

### Schema

```
Webhook: Card Moved
Description: Triggered when a card is moved from one stage to another.
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: actionEvent | type: object | description: Custom action event details.
    - name: body | type: CardMoved | description: The event body.
        - name: card | type: Card | description: The card that moved.
           - name: id | type: string | description: Card GUID.
           - name: revision | type: string | description: Revision number, which increments by 1 each time the card is updated. To prevent conflicting changes, the current revision must be passed when updating the card.
           - name: createdDate | type: string | description: Date and time the card was created in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#combined_date_and_time_representations) format.
           - name: updatedDate | type: string | description: Date and time the card was last updated in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#combined_date_and_time_representations) format.
           - name: pipelineId | type: string | description: GUID of the pipeline containing this card.
           - name: stageId | type: string | description: GUID of the cards' current.
           - name: stageUpdatedDate | type: string | description: Date and time when the card last moved between stagesin [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#combined_date_and_time_representations) format.
           - name: stageUpdateSource | type: CardSource | description: How the card was moved to its current stage.
              - name: userId | type: string | description: GUID of the Wix user who performed the action.
              - name: appId | type: string | description: GUID of the app that performed the action.
              - name: additionalInfo | type: string | description: Additional information about the card's origin or creation context.  For example, the name of the form whose submission created the card. Only used in `createdBy`, where it can be provided when creating the card.
           - name: name | type: string | description: The Card name.
           - name: description | type: string | description: Card description.
           - name: priority | type: Priority | description: Priority level of the card for task management.  Default: `P3_MEDIUM`
               - enum:
               -     P1_URGENT: Urgent priority. Card requires immediate attention.
               -     P2_HIGH: High priority. Card is important and should be addressed promptly.
               -     P3_MEDIUM: Medium priority. Card should be completed within regular workflow timelines.
               -     P4_LOW: Low priority. Card can be addressed when time and resources allow.
           - name: assigneeId | type: string | description: GUID of the Wix user assigned to manage the card.
           - name: dueDate | type: string | description: Date and time when the card is expected to moved to the done stage in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#combined_date_and_time_representations) format. If the card remains active past this date, it becomes overdue.
           - name: staleDate | type: string | description: Date and time when the card becomes stale based on the stage's stale duration setting in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#combined_date_and_time_representations) format. This date is automatically calculated and updated when the card moves to a new stage.
           - name: value | type: Money | description: Monetary value assigned to the card.
              - name: value | type: string | description: Monetary amount. For example, `"3.99"`, or `"-4.99"` for a negative amount.
              - name: currency | type: string | description: Three-letter currency code in ISO-4217 format. Currency is the same as the pipeline currency and is immutable.
           - name: outcome | type: Outcome | description: Final outcome of the card when moved to the done stage.  Default: `NONE`
               - enum:
               -     NONE: No specific outcome. The card reached the final stage but hasn't been specified as successful or unsuccessful.
               -     WON: Successful outcome. The card achieved its intended goal.
               -     LOST: Unsuccessful outcome. The card didn't achieve its intended goal.
           - name: mainContact | type: ContactInfo | description: Primary contact associated with the card.
              - name: contactId | type: string | description: GUID of the contact associated with the card.
              - name: firstName | type: string | description: Contact's first name.
              - name: lastName | type: string | description: Contact's last name.
              - name: email | type: string | description: Contact's primary email.
              - name: phone | type: string | description: Contact's primary phone.
           - name: additionalContacts | type: array<ContactInfo> | description: Secondary contacts associated with the card.
           - name: linkedEntities | type: array<LinkedEntity> | description: Other entities linked to the card.  For example, orders, invoices, activities, or other relevant entities.
              - name: entityId | type: string | description: GUID of the linked entity.
              - name: referencedEntity | type: string | description: Linked entity type.  Identifies the type of entity associated with this card such as a contact submitted by a form, or an invoice sent to close a deal. You can store any value that helps identify the entity type. Use the item selection provider key to make the item selectable by the client. For example, an invoice uses "13ee94c1-b635-8505-3391-97919052c16f_InvoiceSelectionProvider".
              - name: linkedDate | type: string | description: Date and time the entity was linked to the card in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#combined_date_and_time_representations) format.
           - name: createdBy | type: CardSource | description: Details about who created the card.  Immutable after creation. `userId` and `appId` are set automatically from the caller; either one or both are populated depending on the caller. `additionalInfo` can be provided when creating the card to describe its origin, for example the submitted form.
           - name: pipelineExternalId | type: string | description: External GUID of the pipeline containing this card, copied from the pipeline when the card is created.
           - name: pipelineNamespace | type: string | description: Namespace of the pipeline containing this card, copied from the pipeline when the card is created.
           - name: extendedFields | type: ExtendedFields | description: Extended fields data.
              - 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).
           - name: tags | type: PrivateTags | description: Tags for organizing and categorizing the card.
              - name: privateTags | type: TagList | description: Tags that are exposed to anyone with access to the entity, including site members and visitors.
                 - name: tagIds | type: array<string> | description: List of tag GUIDs.
        - name: targetStageId | type: string | description: The GUID of the stage to which the card was moved.
        - name: sourceStageId | type: string | description: The GUID of the stage from which the card was moved.

```

---

## JavaScript SDK

### Schema

```
Webhook: onCardMoved
Description: Triggered when a card is moved from one stage to another.
Payload: CardMovedEnvelope
  - name: data | type: CardMoved | description: none
     - name: card | type: Card | description: The card that moved.
        - name: _id | type: string | description: Card GUID.
        - name: revision | type: string | description: Revision number, which increments by 1 each time the card is updated. To prevent conflicting changes, the current revision must be passed when updating the card.
        - name: _createdDate | type: Date | description: Date and time the card was created in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#combined_date_and_time_representations) format.
        - name: _updatedDate | type: Date | description: Date and time the card was last updated in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#combined_date_and_time_representations) format.
        - name: pipelineId | type: string | description: GUID of the pipeline containing this card.
        - name: stageId | type: string | description: GUID of the cards' current.
        - name: stageUpdatedDate | type: Date | description: Date and time when the card last moved between stagesin [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#combined_date_and_time_representations) format.
        - name: stageUpdateSource | type: CardSource | description: How the card was moved to its current stage.
           - name: userId | type: string | description: GUID of the Wix user who performed the action.
           - name: appId | type: string | description: GUID of the app that performed the action.
           - name: additionalInfo | type: string | description: Additional information about the card's origin or creation context.  For example, the name of the form whose submission created the card. Only used in `createdBy`, where it can be provided when creating the card.
        - name: name | type: string | description: The Card name.
        - name: description | type: string | description: Card description.
        - name: priority | type: Priority | description: Priority level of the card for task management.  Default: `P3_MEDIUM`
             - enum:
             -     P1_URGENT: Urgent priority. Card requires immediate attention.
             -     P2_HIGH: High priority. Card is important and should be addressed promptly.
             -     P3_MEDIUM: Medium priority. Card should be completed within regular workflow timelines.
             -     P4_LOW: Low priority. Card can be addressed when time and resources allow.
        - name: assigneeId | type: string | description: GUID of the Wix user assigned to manage the card.
        - name: dueDate | type: Date | description: Date and time when the card is expected to moved to the done stage in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#combined_date_and_time_representations) format. If the card remains active past this date, it becomes overdue.
        - name: staleDate | type: Date | description: Date and time when the card becomes stale based on the stage's stale duration setting in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#combined_date_and_time_representations) format. This date is automatically calculated and updated when the card moves to a new stage.
        - name: value | type: Money | description: Monetary value assigned to the card.
           - name: value | type: string | description: Monetary amount. For example, `"3.99"`, or `"-4.99"` for a negative amount.
           - name: currency | type: string | description: Three-letter currency code in ISO-4217 format. Currency is the same as the pipeline currency and is immutable.
        - name: outcome | type: Outcome | description: Final outcome of the card when moved to the done stage.  Default: `NONE`
             - enum:
             -     NONE: No specific outcome. The card reached the final stage but hasn't been specified as successful or unsuccessful.
             -     WON: Successful outcome. The card achieved its intended goal.
             -     LOST: Unsuccessful outcome. The card didn't achieve its intended goal.
        - name: mainContact | type: ContactInfo | description: Primary contact associated with the card.
           - name: contactId | type: string | description: GUID of the contact associated with the card.
           - name: firstName | type: string | description: Contact's first name.
           - name: lastName | type: string | description: Contact's last name.
           - name: email | type: string | description: Contact's primary email.
           - name: phone | type: string | description: Contact's primary phone.
        - name: additionalContacts | type: array<ContactInfo> | description: Secondary contacts associated with the card.
        - name: linkedEntities | type: array<LinkedEntity> | description: Other entities linked to the card.  For example, orders, invoices, activities, or other relevant entities.
           - name: entityId | type: string | description: GUID of the linked entity.
           - name: referencedEntity | type: string | description: Linked entity type.  Identifies the type of entity associated with this card such as a contact submitted by a form, or an invoice sent to close a deal. You can store any value that helps identify the entity type. Use the item selection provider key to make the item selectable by the client. For example, an invoice uses "13ee94c1-b635-8505-3391-97919052c16f_InvoiceSelectionProvider".
           - name: linkedDate | type: Date | description: Date and time the entity was linked to the card in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#combined_date_and_time_representations) format.
        - name: createdBy | type: CardSource | description: Details about who created the card.  Immutable after creation. `userId` and `appId` are set automatically from the caller; either one or both are populated depending on the caller. `additionalInfo` can be provided when creating the card to describe its origin, for example the submitted form.
        - name: pipelineExternalId | type: string | description: External GUID of the pipeline containing this card, copied from the pipeline when the card is created.
        - name: pipelineNamespace | type: string | description: Namespace of the pipeline containing this card, copied from the pipeline when the card is created.
        - name: extendedFields | type: ExtendedFields | description: Extended fields data.
           - 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).
        - name: tags | type: PrivateTags | description: Tags for organizing and categorizing the card.
           - name: privateTags | type: TagList | description: Tags that are exposed to anyone with access to the entity, including site members and visitors.
              - name: tagIds | type: array<string> | description: List of tag GUIDs.
     - name: targetStageId | type: string | description: The GUID of the stage to which the card was moved.
     - name: sourceStageId | type: string | description: The GUID of the stage from which the card was moved.
  - 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 { cards } from '@wix/crm';

cards.onCardMoved((event) => {
    // handle your event here
});
```


```javascript
import { createClient, AppStrategy } from '@wix/sdk';
import { cards } from '@wix/crm';

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

wixClient.cards.onCardMoved((event) => {
    // handle your event here
});
```

---