> 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 # Package: operations # Namespace: dataMovementJobs # Webhook link: https://dev.wix.com/docs/api-reference/business-solutions/cms/operations/data-movement-jobs/job-updated.md ## Introduction Triggered when a job's `status` updates. --- ## REST API ### Schema ``` Webhook: Job Updated Description: Triggered when a job's `status` updates. 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: DataMovementJob | description: The entity after the update. - ONE-OF: - name: partiallySuccessfulOptions | type: PartiallySuccessfulStatusOptions | description: When the job's `status` is `PARTIALLY_SUCCESSFUL`, the additional details. - name: cause | type: string | description: Reason the job was partially successful. - name: id | type: string | description: Job GUID. - name: startedAt | type: string | description: When the job was submitted. - name: status | type: JobStatus | description: Current job status. - enum: - UNINITIALIZED: Job was submitted but has not yet started. - INITIALIZING: Job is initializing. - IN_PROGRESS: Job is in progress. - COMPLETED: Job has successfully completed. - FAILED: Job has failed. - PARTIALLY_SUCCESSFUL: Job has completed but was partially successful due to a destination limitation. See `PartiallySuccessfulOptions` for additional details. - name: source | type: Source | description: Source to move data from. - ONE-OF: - name: wixDataCollection | type: WixDataSource | description: Wix data collection. You can move items from native Wix collections, [Wix app collections](https://dev.wix.com/docs/develop-websites/articles/databases/wix-data/collections/working-with-wix-app-collections-and-code.md), and [external database collections](https://dev.wix.com/docs/develop-websites/articles/databases/external-databases/overview/integrating-external-databases-with-your-wix-site.md). - name: collectionId | type: string | description: GUID of the data collection. - name: filter | type: object | description: Filter to apply to the items. Only items that pass the filter are moved. Learn more about building a query filter using [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#filters). - name: fields | type: array | description: Item fields to move. If not set, the method moves the full items. - name: localization | type: LocalizationSource | description: Localized CMS content. Available when the site has [Wix Multilingual](https://support.wix.com/en/article/wix-multilingual-an-overview) installed. Learn more about working with [translated CMS content](https://support.wix.com/en/article/wix-multilingual-translating-cms-collection-content). - name: languages | type: array | description: Translated CMS content in the specified languages. Content in these languages is exported to the destination, with the first specified language treated as the main one. Use two-letter language codes in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) format. You can also specify a two-letter country code in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) format. Learn more about [available languages in Wix Multilingual](https://support.wix.com/en/article/wix-multilingual-languages-available). - name: file | type: FileSource | description: Source file. You can import data from files in CSV or JSONL formats. Uploading a file with an invalid format causes the movement job to fail. To upload a file, call Create File Upload Url ([SDK](https://dev.wix.com/docs/sdk/backend-modules/data/movement-jobs/create-file-upload-url.md) | [REST](https://dev.wix.com/docs/rest/business-solutions/cms/data-movement-jobs/create-file-upload-url.md)) and use the `uploadUrl` from the response. For example: `curl --request PUT --upload-file "${path_to_file}" "${uploadUrl}"` - name: format | type: FileFormat | description: File format. If not specified, automatically determined by Wix. - enum: - UNKNOWN: Unknown format. - CSV: CSV format. - JSONL: JSONL format. - name: fileId | type: string | description: File GUID as returned in the `fileId` property of the Create File Upload URL method's response. - name: url | type: string | description: URL where the source file is uploaded. Automatically generated by Wix. - name: destination | type: Destination | description: Destination to move data to. - ONE-OF: - name: wixDataCollection | type: WixDataDestination | description: Wix data collection. You can move items to native Wix collections, [Wix app collections](https://dev.wix.com/docs/develop-websites/articles/databases/wix-data/collections/working-with-wix-app-collections-and-code.md), and [external database collections](https://dev.wix.com/docs/develop-websites/articles/databases/external-databases/overview/integrating-external-databases-with-your-wix-site.md). - name: collectionId | type: string | description: GUID of the destination collection. - name: writePolicy | type: WritePolicy | description: When items already exist in the destination collection, the data writing policy. Default: `OVERWRITE`. - enum: - OVERWRITE: When an item with the same ID exists in the collection, overwrite it. - SKIP_EXISTING: When an item with the same ID exists in the collection, skip it. - TRUNCATE_BEFORE: Clear the destination collection before moving data. When the job completes, the collection contains only the moved data. - name: localization | type: LocalizationDestination | description: Localized CMS content. Available when the site has [Wix Multilingual](https://support.wix.com/en/article/wix-multilingual-an-overview) installed. Learn more about working with [translated CMS content](https://support.wix.com/en/article/wix-multilingual-translating-cms-collection-content). - name: languages | type: array | description: Translated CMS content in the specified languages. Content in these languages is imported from the source, with the first specified language treated as the main one. Use two-letter language codes in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) format. You can also specify a two-letter country code in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) format. Learn more about [available languages in Wix Multilingual](https://support.wix.com/en/article/wix-multilingual-languages-available). - name: file | type: FileDestination | description: Downloadable file with the moved items. - name: format | type: FileFormat | description: File format. - enum: - UNKNOWN: Unknown format. - CSV: CSV format. - JSONL: JSONL format. - name: fileName | type: string | description: File name. - name: url | type: string | description: File download URL. - name: name | type: string | description: Job name. - name: progress | type: Progress | description: When the job `status` is `IN_PROGRESS`, the progress details. - name: current | type: integer | description: Number of units already processed. - name: total | type: integer | description: Total number of units to move. - name: itemsRejected | type: integer | description: Number of items that failed to move to the destination. - name: itemsSuccessful | type: integer | description: Number of items successfully moved to the destination. - name: finishedAt | type: string | description: Job finish time. A job is considered finished when its `status` updates to `COMPLETED`, `FAILED`, or `PARTIALLY_SUCCESSFUL`. - name: error | type: ApplicationError | description: Error information. - 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: sourceSiteId | type: string | description: When moving data from a Wix data collection, the source site GUID. By default, the source site is the current site. To move data from [any site in the same Wix Account](https://support.wix.com/en/article/managing-multiple-sites-under-one-account), specify the site GUID, which you can retrieve by calling [Get App Instance](https://dev.wix.com/docs/rest/app-management/app-instance/get-app-instance.md). > **Note**: You can specify the GUID of a source site or destination site, but not both. - name: destinationSiteId | type: string | description: When moving data to a Wix data collection, the destination site GUID. By default, the destination site is the current site. To move data to [any site in the same Wix Account](https://support.wix.com/en/article/managing-multiple-sites-under-one-account), specify the site GUID, which you can retrieve by calling [Get App Instance](https://dev.wix.com/docs/rest/app-management/app-instance/get-app-instance.md). > **Note**: You can specify the GUID of a source site or destination site, but not both. - name: logsRecorded | type: integer | description: Number of recorded logs. - name: scheduleId | type: string | description: Sync Schedule GUID, if the job was triggered by a sync schedule. - name: extendedFields | type: ExtendedFields | description: Extended fields for custom metadata added by applications. - 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: workflowId | type: string | description: Workflow GUID, if the job was created as a child step of a workflow. ``` --- ## JavaScript SDK ### Schema ``` Webhook: onJobUpdated Description: Triggered when a job's `status` updates. Payload: JobUpdatedEnvelope - name: entity | type: DataMovementJob | description: none - ONE-OF: - name: partiallySuccessfulOptions | type: PartiallySuccessfulStatusOptions | description: When the job's `status` is `PARTIALLY_SUCCESSFUL`, the additional details. - name: cause | type: string | description: Reason the job was partially successful. - name: _id | type: string | description: Job GUID. - name: startedAt | type: Date | description: When the job was submitted. - name: status | type: JobStatus | description: Current job status. - enum: - UNINITIALIZED: Job was submitted but has not yet started. - INITIALIZING: Job is initializing. - IN_PROGRESS: Job is in progress. - COMPLETED: Job has successfully completed. - FAILED: Job has failed. - PARTIALLY_SUCCESSFUL: Job has completed but was partially successful due to a destination limitation. See `PartiallySuccessfulOptions` for additional details. - name: source | type: Source | description: Source to move data from. - ONE-OF: - name: wixDataCollection | type: WixDataSource | description: Wix data collection. You can move items from native Wix collections, [Wix app collections](https://dev.wix.com/docs/develop-websites/articles/databases/wix-data/collections/working-with-wix-app-collections-and-code.md), and [external database collections](https://dev.wix.com/docs/develop-websites/articles/databases/external-databases/overview/integrating-external-databases-with-your-wix-site.md). - name: collectionId | type: string | description: GUID of the data collection. - name: filter | type: object | description: Filter to apply to the items. Only items that pass the filter are moved. Learn more about building a query filter using [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#filters). - name: fields | type: array | description: Item fields to move. If not set, the method moves the full items. - name: localization | type: LocalizationSource | description: Localized CMS content. Available when the site has [Wix Multilingual](https://support.wix.com/en/article/wix-multilingual-an-overview) installed. Learn more about working with [translated CMS content](https://support.wix.com/en/article/wix-multilingual-translating-cms-collection-content). - name: languages | type: array | description: Translated CMS content in the specified languages. Content in these languages is exported to the destination, with the first specified language treated as the main one. Use two-letter language codes in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) format. You can also specify a two-letter country code in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) format. Learn more about [available languages in Wix Multilingual](https://support.wix.com/en/article/wix-multilingual-languages-available). - name: file | type: FileSource | description: Source file. You can import data from files in CSV or JSONL formats. Uploading a file with an invalid format causes the movement job to fail. To upload a file, call Create File Upload Url ([SDK](https://dev.wix.com/docs/sdk/backend-modules/data/movement-jobs/create-file-upload-url.md) | [REST](https://dev.wix.com/docs/rest/business-solutions/cms/data-movement-jobs/create-file-upload-url.md)) and use the `uploadUrl` from the response. For example: `curl --request PUT --upload-file "${path_to_file}" "${uploadUrl}"` - name: format | type: FileFormat | description: File format. If not specified, automatically determined by Wix. - enum: - UNKNOWN: Unknown format. - CSV: CSV format. - JSONL: JSONL format. - name: fileId | type: string | description: File GUID as returned in the `fileId` property of the Create File Upload URL method's response. - name: url | type: string | description: URL where the source file is uploaded. Automatically generated by Wix. - name: destination | type: Destination | description: Destination to move data to. - ONE-OF: - name: wixDataCollection | type: WixDataDestination | description: Wix data collection. You can move items to native Wix collections, [Wix app collections](https://dev.wix.com/docs/develop-websites/articles/databases/wix-data/collections/working-with-wix-app-collections-and-code.md), and [external database collections](https://dev.wix.com/docs/develop-websites/articles/databases/external-databases/overview/integrating-external-databases-with-your-wix-site.md). - name: collectionId | type: string | description: GUID of the destination collection. - name: writePolicy | type: WritePolicy | description: When items already exist in the destination collection, the data writing policy. Default: `OVERWRITE`. - enum: - OVERWRITE: When an item with the same ID exists in the collection, overwrite it. - SKIP_EXISTING: When an item with the same ID exists in the collection, skip it. - TRUNCATE_BEFORE: Clear the destination collection before moving data. When the job completes, the collection contains only the moved data. - name: localization | type: LocalizationDestination | description: Localized CMS content. Available when the site has [Wix Multilingual](https://support.wix.com/en/article/wix-multilingual-an-overview) installed. Learn more about working with [translated CMS content](https://support.wix.com/en/article/wix-multilingual-translating-cms-collection-content). - name: languages | type: array | description: Translated CMS content in the specified languages. Content in these languages is imported from the source, with the first specified language treated as the main one. Use two-letter language codes in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) format. You can also specify a two-letter country code in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) format. Learn more about [available languages in Wix Multilingual](https://support.wix.com/en/article/wix-multilingual-languages-available). - name: file | type: FileDestination | description: Downloadable file with the moved items. - name: format | type: FileFormat | description: File format. - enum: - UNKNOWN: Unknown format. - CSV: CSV format. - JSONL: JSONL format. - name: fileName | type: string | description: File name. - name: url | type: string | description: File download URL. - name: name | type: string | description: Job name. - name: progress | type: Progress | description: When the job `status` is `IN_PROGRESS`, the progress details. - name: current | type: integer | description: Number of units already processed. - name: total | type: integer | description: Total number of units to move. - name: itemsRejected | type: integer | description: Number of items that failed to move to the destination. - name: itemsSuccessful | type: integer | description: Number of items successfully moved to the destination. - name: finishedAt | type: Date | description: Job finish time. A job is considered finished when its `status` updates to `COMPLETED`, `FAILED`, or `PARTIALLY_SUCCESSFUL`. - name: error | type: ApplicationError | description: Error information. - 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: sourceSiteId | type: string | description: When moving data from a Wix data collection, the source site GUID. By default, the source site is the current site. To move data from [any site in the same Wix Account](https://support.wix.com/en/article/managing-multiple-sites-under-one-account), specify the site GUID, which you can retrieve by calling [Get App Instance](https://dev.wix.com/docs/rest/app-management/app-instance/get-app-instance.md). > **Note**: You can specify the GUID of a source site or destination site, but not both. - name: destinationSiteId | type: string | description: When moving data to a Wix data collection, the destination site GUID. By default, the destination site is the current site. To move data to [any site in the same Wix Account](https://support.wix.com/en/article/managing-multiple-sites-under-one-account), specify the site GUID, which you can retrieve by calling [Get App Instance](https://dev.wix.com/docs/rest/app-management/app-instance/get-app-instance.md). > **Note**: You can specify the GUID of a source site or destination site, but not both. - name: logsRecorded | type: integer | description: Number of recorded logs. - name: scheduleId | type: string | description: Sync Schedule GUID, if the job was triggered by a sync schedule. - name: extendedFields | type: ExtendedFields | description: Extended fields for custom metadata added by applications. - 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: workflowId | type: string | description: Workflow GUID, if the job was created as a child step of a workflow. - 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 { movementJobs } from '@wix/data'; movementJobs.onJobUpdated((event) => { // handle your event here }); ``` ```javascript import { createClient, AppStrategy } from '@wix/sdk'; import { movementJobs } from '@wix/data'; const wixClient = createClient({ auth: AppStrategy({ appId: 'MY-APP-ID', publicKey: 'YOUR_APP_PUBLIC_KEY', }), modules: { movementJobs, }, }); wixClient.movementJobs.onJobUpdated((event) => { // handle your event here }); ``` ---