> 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

# GetAsyncJob

# Package: asyncJob

# Namespace: AsyncJobService

# Method link: https://dev.wix.com/docs/api-reference/business-management/async-job/get-async-job.md

## Permission Scopes:
READ ASYNC JOBS: SCOPE.ASYNC_JOB.READ

## Introduction

Retrieves a job.

---

## REST API

### Schema

```
 Method: getAsyncJob
 Description: Retrieves a job.
 URL: https://www.wixapis.com/async-jobs/v1/async-jobs/{jobId}
 Method: GET
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  jobId
 Method parameters: 
   param name: jobId | type:   none | required: true 
 Return type: GetAsyncJobResponse
  - name: job | type: AsyncJob | description: Returned job.  
     - name: id | type: string | description: Job GUID.  | read-only: true | validation: format GUID
     - name: metadata | type: object | description: Optional job metadata, used to store any parameters used during job execution, user-defined statuses, etc.  
     - name: status | type: Status | description: Current job execution status.  
         - enum:
         -     UNKNOWN: 
         -     INITIALIZED: Job is created, but hasn't started yet.
         -     PROCESSING: Job has started and is in progress.
         -     FINISHED: Job is finished.
         -     FAILED: Job has failed.
     - name: createdDate | type: string | description: Date and time the job was created in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#combined_date_and_time_representations) format.  | read-only: true | validation: format date-time
     - name: updatedDate | type: string | description: Date and time the job was last updated in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#combined_date_and_time_representations) format.  | read-only: true | validation: format date-time
     - name: createdBy | type: CreatedBy | description: Job creator.  | read-only: true 
        - ONE-OF: 
           - name: anonymousVisitorIdOptions | type: AnonymousVisitorIdOptions | description: Visitor GUID - when the job is created by a site visitor that was **not** logged in.  
              - name: anonymousVisitorId | type: string | description: Visitor GUID - When the job is owned by a site visitor that was **not** logged in.  | validation: format GUID
           - name: memberIdOptions | type: MemberIdOptions | description: Member GUID - When the job is created by a by a **logged in** site visitor.  
              - name: memberId | type: string | description: Member GUID - When the job is owned by a by a **logged in** site visitor.  | validation: format GUID
           - name: wixUserIdOptions | type: WixUserIdOptions | description: User GUID - When the job is created by a Wix user.  
              - name: wixUserId | type: string | description: User GUID - When the job is owned by a site owner or contributor.  | validation: format GUID
           - name: appIdOptions | type: AppIdOptions | description: App GUID - When the job is created by an external app or app by Wix.  
              - name: appId | type: string | description: App GUID - When the job is owned by an external app. or app by Wix.  | validation: format GUID
        - name: type | type: Type | description: The type of the creator.  
             - enum:
             -     UNKNOWN_TYPE: 
             -     ANONYMOUS_VISITOR_ID: Job was created by a site visitor that was **not** logged in.
             -     MEMBER_ID: Job was created by a **logged in** site visitor.
             -     WIX_USER_ID: Job was created by a  Wix user.
             -     APP_ID: Job was created by an external app or app by Wix.
     - name: counts | type: Counts | description: Current execution counts.  
        - name: total | type: integer | description: Optional count of the dataset size, specified during job creation. Can be used for progress bars, etc.  | validation: format int32
        - name: successCount | type: integer | description: Amount of items that were successfully processed.  
        - name: failCount | type: integer | description: Amount of items whose processing failed.  
        - name: errorByCodeCount | type: object | description: Mapping between an error code and the number of failures associated with it.  | validation: format map


```

### Examples

### Get Async Job
```curl
curl -X GET \
  'https://www.wixapis.com/async-jobs/v1/async-jobs/076e0505-6944-4645-a248-80b197ee9cfd' \
  -H 'Authorization: <AUTH>'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.asyncJobs.asyncJobs.getAsyncJob(jobId)
 Description: Retrieves a job.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  jobId
 Method parameters: 
   param name: jobId | type: string | description: Job GUID. | required: true | validation: format GUID
 Return type: PROMISE<AsyncJob>
  - name: _id | type: string | description: Job GUID.  | read-only: true | validation: format GUID
  - name: metadata | type: object | description: Optional job metadata, used to store any parameters used during job execution, user-defined statuses, etc.  
  - name: status | type: Status | description: Current job execution status.  
     - enum:
     -     UNKNOWN: 
     -     INITIALIZED: Job is created, but hasn't started yet.
     -     PROCESSING: Job has started and is in progress.
     -     FINISHED: Job is finished.
     -     FAILED: Job has failed.
  - name: _createdDate | type: Date | description: Date and time the job was created in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#combined_date_and_time_representations) format.  | read-only: true 
  - name: _updatedDate | type: Date | description: Date and time the job was last updated in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#combined_date_and_time_representations) format.  | read-only: true 
  - name: createdBy | type: CreatedBy | description: Job creator.  | read-only: true 
     - ONE-OF: 
        - name: anonymousVisitorIdOptions | type: AnonymousVisitorIdOptions | description: Visitor GUID - when the job is created by a site visitor that was **not** logged in.  
           - name: anonymousVisitorId | type: string | description: Visitor GUID - When the job is owned by a site visitor that was **not** logged in.  | validation: format GUID
        - name: memberIdOptions | type: MemberIdOptions | description: Member GUID - When the job is created by a by a **logged in** site visitor.  
           - name: memberId | type: string | description: Member GUID - When the job is owned by a by a **logged in** site visitor.  | validation: format GUID
        - name: wixUserIdOptions | type: WixUserIdOptions | description: User GUID - When the job is created by a Wix user.  
           - name: wixUserId | type: string | description: User GUID - When the job is owned by a site owner or contributor.  | validation: format GUID
        - name: appIdOptions | type: AppIdOptions | description: App GUID - When the job is created by an external app or app by Wix.  
           - name: appId | type: string | description: App GUID - When the job is owned by an external app. or app by Wix.  | validation: format GUID
     - name: type | type: Type | description: The type of the creator.  
         - enum:
         -     UNKNOWN_TYPE: 
         -     ANONYMOUS_VISITOR_ID: Job was created by a site visitor that was **not** logged in.
         -     MEMBER_ID: Job was created by a **logged in** site visitor.
         -     WIX_USER_ID: Job was created by a  Wix user.
         -     APP_ID: Job was created by an external app or app by Wix.
  - name: counts | type: Counts | description: Current execution counts.  
     - name: total | type: integer | description: Optional count of the dataset size, specified during job creation. Can be used for progress bars, etc.  | validation: format int32
     - name: successCount | type: integer | description: Amount of items that were successfully processed.  
     - name: failCount | type: integer | description: Amount of items whose processing failed.  
     - name: errorByCodeCount | type: object | description: Mapping between an error code and the number of failures associated with it.  | validation: format map


```

### Examples

### getAsyncJob
```javascript
import { asyncJobs } from '@wix/async-jobs';

async function getAsyncJob(jobId) {
  const response = await asyncJobs.getAsyncJob(jobId);
};
```

### getAsyncJob (with elevated permissions)
```javascript
import { asyncJobs } from '@wix/async-jobs';
import { auth } from '@wix/essentials';

async function myGetAsyncJobMethod(jobId) {
  const elevatedGetAsyncJob = auth.elevate(asyncJobs.getAsyncJob);
  const response = await elevatedGetAsyncJob(jobId);
}
```

### getAsyncJob (self-managed)
Self-managed 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 { asyncJobs } from '@wix/async-jobs';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { asyncJobs },
  // Include the auth strategy and host as relevant
});


async function getAsyncJob(jobId) {
  const response = await myWixClient.asyncJobs.getAsyncJob(jobId);
};
```

---