> 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 # QueryJobs # Package: operations # Namespace: DataMovementService # Method link: https://dev.wix.com/docs/api-reference/business-solutions/cms/operations/data-movement-jobs/query-jobs.md ## Permission Scopes: Data Mover Manage Jobs: SCOPE.DC-DATA.MANAGE_MOVEMENT_JOBS ## Introduction Retrieves data movement jobs for the current site, on the basis of the filtering, sorting, and paging preferences you provide. Learn more about [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language) and [sorting and paging](https://dev.wix.com/docs/rest/articles/get-started/sorting-and-paging.md) configuration. --- ## REST API ### Schema ``` Method: queryJobs Description: Retrieves data movement jobs for the current site, on the basis of the filtering, sorting, and paging preferences you provide. Learn more about [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language) and [sorting and paging](https://dev.wix.com/docs/rest/articles/get-started/sorting-and-paging.md) configuration. URL: https://www.wixapis.com/v1/jobs/query Method: POST Method parameters: param name: query | type: CursorQuery - name: cursorPaging | type: CursorPaging | description: Cursor paging options. Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#cursor-paging). - name: limit | type: integer | description: Maximum number of items to return in the results. - name: cursor | type: string | description: Pointer to the next or previous page in the list of results. Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response. Not relevant for the first request. - name: filter | type: object | description: Filter object. Learn more about [filtering](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#filters). - name: sort | type: array | description: Sort object. Learn more about [sorting](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#sorting). - name: fieldName | type: string | description: Name of the field to sort by. - name: order | type: SortOrder | description: Sort order. - enum: ASC, DESC Return type: QueryJobsResponse - name: jobs | type: array | description: List of jobs matching the query. - 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. - 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. - name: pagingMetadata | type: CursorPagingMetadata | description: Paging metadata. - name: count | type: integer | description: Number of items returned in current page. - name: cursors | type: Cursors | description: Cursor strings that point to the next page, previous page, or both. - name: next | type: string | description: Cursor string pointing to the next page in the list of results. - name: prev | type: string | description: Cursor pointing to the previous page in the list of results. - name: hasNext | type: boolean | description: Whether there are more pages to retrieve following the current page. + `true`: Another page of results can be retrieved. + `false`: This is the last page. ``` ### Examples ### Query failed jobs for the current site, sorted from latest to earliest ```curl curl -X POST 'https://www.wixapis.com/data-mover/v1/jobs/query' \ -H 'Authorization: ' \ -d '{ "query": { "filter": { "status": "FAILED" }, "sort": [ { "fieldName": "finishedAt", "order": "DESC" } ] } }' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.operations.DataMovementService.queryJobs(query) Description: Retrieves data movement jobs for the current site, on the basis of the filtering, sorting, and paging preferences you provide. Learn more about [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language) and [sorting and paging](https://dev.wix.com/docs/rest/articles/get-started/sorting-and-paging.md) configuration. # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: query Method parameters: param name: query | type: JobQuery | required: true - name: cursorPaging | type: CursorPaging | description: Cursor paging options. Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#cursor-paging). - name: limit | type: integer | description: Maximum number of items to return in the results. - name: cursor | type: string | description: Pointer to the next or previous page in the list of results. Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response. Not relevant for the first request. - name: filter | type: object | description: Filter object. Learn more about [filtering](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#filters). - name: sort | type: array | description: Sort object. Learn more about [sorting](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#sorting). - name: fieldName | type: string | description: Name of the field to sort by. - name: order | type: SortOrder | description: Sort order. - enum: ASC, DESC Return type: PROMISE - name: jobs | type: array | description: List of jobs matching the query. - 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. - 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: pagingMetadata | type: CursorPagingMetadata | description: Paging metadata. - name: count | type: integer | description: Number of items returned in current page. - name: cursors | type: Cursors | description: Cursor strings that point to the next page, previous page, or both. - name: next | type: string | description: Cursor string pointing to the next page in the list of results. - name: prev | type: string | description: Cursor pointing to the previous page in the list of results. - name: hasNext | type: boolean | description: Whether there are more pages to retrieve following the current page. + `true`: Another page of results can be retrieved. + `false`: This is the last page. ``` ### Examples ### queryJobs ```javascript import { movementJobs } from '@wix/data'; async function queryJobs(query) { const response = await movementJobs.queryJobs(query); }; ``` ### queryJobs (with elevated permissions) ```javascript import { movementJobs } from '@wix/data'; import { auth } from '@wix/essentials'; async function myQueryJobsMethod(query) { const elevatedQueryJobs = auth.elevate(movementJobs.queryJobs); const response = await elevatedQueryJobs(query); } ``` ### queryJobs (self-hosted) Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md). ```javascript import { createClient } from '@wix/sdk'; import { movementJobs } from '@wix/data'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { movementJobs }, // Include the auth strategy and host as relevant }); async function queryJobs(query) { const response = await myWixClient.movementJobs.queryJobs(query); }; ``` ---