---
title: "Get a valid bulk task"
description: >
  Get a valid [bulk query task](https://developer.shopline.com/docs/admin-rest-api/bulk-operations/create-a-bulk-query-task.md) or [bulk mutation task](https://developer.shopline.com/docs/admin-rest-api/bulk-operations/create-a-bulk-mutation-task.md).
doc_type: openapi
doc_category: openapi
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/docs/admin-rest-api/bulk-operations/get-a-valid-bulk-task'
  md: 'https://developer.shopline.com/docs/admin-rest-api/bulk-operations/get-a-valid-bulk-task.md'
---
# Get a valid bulk task

Get a valid [bulk query task](https://developer.shopline.com/docs/admin-rest-api/bulk-operations/create-a-bulk-query-task.md) or [bulk mutation task](https://developer.shopline.com/docs/admin-rest-api/bulk-operations/create-a-bulk-mutation-task.md).


- **Base URL:** `https://{handle}.myshopline.com/admin/openapi`
- **Required Scopes:** `read_bulkoperation`
- **API Version:** v20270301
- **API Type:** Admin
- **API Protocol:** RESTful

## Endpoint

```http
GET /current_bulk_operation.json
```

## Base URL

* `https://{handle}.myshopline.com/admin/openapi`

  * `{handle}`: `handle` : The store's unique identifier, which is the prefix of the store's domain name. For example, if a store's domain name is `open001.myshopline.com` , the store handle is `open001` .

## Required Permissions

* `read_bulkoperation`

## Request

### Query Parameters

* `type`

  string (optional)

  The operation type of the bulk task. Valid values are:  
  - `QUERY`: Query operation
  - `MUTATION`: Mutation operation

### Request Headers

* `Content-Type`

  string (required)

  The field must be set to the fixed value `application/json; charset=utf-8`.

* `Authorization`

  string (required)

   The access token for the API resource. Refer to [App authorization](https://developer.shopline.com/docs/apps/api-instructions-for-use/app-authorization.md?lang=en) to obtain the access token, and then pass the obtained token in the Bearer format. 

## Response

### Status Codes

* `200`

  For the complete list of codes and messages, see [Http status code](https://developer.shopline.com/docs/apps/api-instructions-for-use/http-status-code.md?lang=en).

* `401`

  

* `429`

  

### Response Headers

* `traceId`

  A globally unique identifier for the request. It is used to track the request flow throughout the system, allowing for easy location and debugging when issues arise.

### Response Body

#### 200

* `reason`

  string

  The reason for the bulk task execution exception. 

* `status`

  string

  The status of the bulk task. Valid values are:  
  
  - `CANCELED`：Canceled   
  - `CANCELING`：Canceling     
  - `COMPLETED`：Completed    
  - `CREATED`：Created   
  - `EXPIRED`：Expired  
  - `FAILED`：Failed  
  - `RUNNING`：Running  
  

* `type`

  string

  The type of the bulk task. Valid values are:   
  - `QUERY`: Query operation  
  - `MUTATION`: Mutation operation, which refers to mutation operations executed through the [Bulk operation mutation (to be Deprecated)](https://developer.shopline.com/docs/admin-rest-api/bulk-operations/create-a-change-type-bulk-task-to-be-deprecated.md) API.
  - `MUTATION_GENERAL`: Mutation operation
  

* `url`

  string

  A URL to a file containing all task processing results with an expiration time. Format: [JSON Lines](https://jsonlines.org/).

* `completedCount`

  integer

  The count of the completed bulk operations. 

* `errorCode`

  string

  The error code of the bulk task. Valid values are:  
  
  - `ACCESS_DENIED`: No access permission
  - `TIMEOUT`: Process timeout
  - `NO_DATA`: No data found
  

* `expiredAt`

  string

  The expiration time of the bulk task. Files will become unavailable for download after this time. Format: [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html).

* `id`

  string

  The ID of the bulk task.

* `storeId`

  string

  The ID of the store.

* `completedAt`

  string

  The date and time when the bulk task was completed. Format: [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html).
  

* `createdAt`

  string

  The date and time when the bulk task was created. Format: [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html).

* `partialDataUrl`

  string

  A URL to a file containing task processing results with an expiration time. Format: [JSON Lines](https://jsonlines.org).  
  When `status` is `COMPLETED`, this value is identical to the `url` value. For other statuses, it may contain partial processing results.
  


#### 401

* `errors`

  string

  Error message. 


#### 429

* `errors`

  string

  Error message. 


## OpenAPI Definition

```json
{
  "tags": [
    "Get a valid bulk task"
  ],
  "description": "Get a valid [bulk query task](https://developer.shopline.com/docs/admin-rest-api/bulk-operations/create-a-bulk-query-task.md) or [bulk mutation task](https://developer.shopline.com/docs/admin-rest-api/bulk-operations/create-a-bulk-mutation-task.md).\n",
  "externalDocs": {
    "description": "Permission point used by the interface is `read_bulkoperation` , For more information about the use of permission points, see",
    "url": "ec20/3cv5d7wpfgr6a8z5/xabczf5442284vkq?lang=en",
    "errorTableDescription": ""
  },
  "operationId": "VObwvwC8",
  "parameters": [
    {
      "name": "type",
      "in": "query",
      "description": "The operation type of the bulk task. Valid values are:  \n- `QUERY`: Query operation\n- `MUTATION`: Mutation operation",
      "style": "form",
      "explode": true,
      "schema": {
        "name": "type",
        "description": "The operation type of the bulk task. Valid values are:  \n- `QUERY`: Query operation\n- `MUTATION`: Mutation operation",
        "type": "string"
      },
      "examples": {
        "Get a valid bulk query task": {
          "value": "QUERY"
        }
      }
    },
    {
      "name": "Content-Type",
      "in": "header",
      "description": "The field must be set to the fixed value `application/json; charset=utf-8`.",
      "required": true,
      "schema": {
        "name": "Content-Type",
        "type": "string",
        "example": "application/json; charset=utf-8"
      }
    },
    {
      "name": "Authorization",
      "in": "header",
      "description": " The access token for the API resource. Refer to [App authorization](https://developer.shopline.com/docs/apps/api-instructions-for-use/app-authorization.md?lang=en) to obtain the access token, and then pass the obtained token in the Bearer format. ",
      "required": true,
      "style": "string",
      "schema": {
        "name": "Authorization",
        "description": " The access token for the API resource. Refer to [App authorization](https://developer.shopline.com/docs/apps/api-instructions-for-use/app-authorization.md?lang=en) to obtain the access token, and then pass the obtained token in the Bearer format. ",
        "type": "string",
        "example": "Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6MCwiYXBwS2V5IjoiNzU2ZjI1NWE2NjdlZTcwNTk1MzM0ZjVjYzk4NzU5MzBmN2E3NGZjMSIsImV4cCI6MTg3OTQ4MjA3NiwiaXNzIjoieXNvdWwiLCJzZWxsZXJJZCI6IjIwMDAyMzQ4ODAiLCJzdG9yZUlkIjoiMTY3MjM2OTcyOTYwNiIsInRpbWVzdGFtcCI6MTc4NDc4NzY3NjY2MSwidmVyc2lvbiI6IlYyIn0.3ZzbGAH4cLU1QR2VPEvMOQInUDvus-C4amkINSQIPuNVlXsFKj0sAt1c0KnUy9MWUOFV9cHlkf7J90r2y1FzpA"
      },
      "example": "Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6MCwiYXBwS2V5IjoiNzU2ZjI1NWE2NjdlZTcwNTk1MzM0ZjVjYzk4NzU5MzBmN2E3NGZjMSIsImV4cCI6MTg3OTQ4MjA3NiwiaXNzIjoieXNvdWwiLCJzZWxsZXJJZCI6IjIwMDAyMzQ4ODAiLCJzdG9yZUlkIjoiMTY3MjM2OTcyOTYwNiIsInRpbWVzdGFtcCI6MTc4NDc4NzY3NjY2MSwidmVyc2lvbiI6IlYyIn0.3ZzbGAH4cLU1QR2VPEvMOQInUDvus-C4amkINSQIPuNVlXsFKj0sAt1c0KnUy9MWUOFV9cHlkf7J90r2y1FzpA"
    }
  ],
  "responses": {
    "200": {
      "description": "For the complete list of codes and messages, see [Http status code](https://developer.shopline.com/docs/apps/api-instructions-for-use/http-status-code.md?lang=en).",
      "headers": {
        "traceId": {
          "description": "A globally unique identifier for the request. It is used to track the request flow throughout the system, allowing for easy location and debugging when issues arise."
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "name": "body",
            "type": "object",
            "properties": {
              "reason": {
                "name": "reason",
                "description": "The reason for the bulk task execution exception. ",
                "type": "string"
              },
              "status": {
                "name": "status",
                "description": "The status of the bulk task. Valid values are:  \n\n- `CANCELED`：Canceled   \n- `CANCELING`：Canceling     \n- `COMPLETED`：Completed    \n- `CREATED`：Created   \n- `EXPIRED`：Expired  \n- `FAILED`：Failed  \n- `RUNNING`：Running  \n",
                "type": "string"
              },
              "type": {
                "name": "type",
                "description": "The type of the bulk task. Valid values are:   \n- `QUERY`: Query operation  \n- `MUTATION`: Mutation operation, which refers to mutation operations executed through the [Bulk operation mutation (to be Deprecated)](https://developer.shopline.com/docs/admin-rest-api/bulk-operations/create-a-change-type-bulk-task-to-be-deprecated.md) API.\n- `MUTATION_GENERAL`: Mutation operation\n",
                "type": "string"
              },
              "url": {
                "name": "url",
                "description": "A URL to a file containing all task processing results with an expiration time. Format: [JSON Lines](https://jsonlines.org/).",
                "type": "string",
                "example": "https://sl-private-oss.oss-accelerate.example.com/task-jsonline/prod/1/9b0c0f04-53cb-4ae3-94db-79af6ec193bd.jsonl?Expires=1754059510"
              },
              "completedCount": {
                "name": "completedCount",
                "description": "The count of the completed bulk operations. ",
                "type": "integer"
              },
              "errorCode": {
                "name": "errorCode",
                "description": "The error code of the bulk task. Valid values are:  \n\n- `ACCESS_DENIED`: No access permission\n- `TIMEOUT`: Process timeout\n- `NO_DATA`: No data found\n",
                "type": "string"
              },
              "expiredAt": {
                "name": "expiredAt",
                "description": "The expiration time of the bulk task. Files will become unavailable for download after this time. Format: [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html).",
                "type": "string"
              },
              "id": {
                "name": "id",
                "description": "The ID of the bulk task.",
                "type": "string"
              },
              "storeId": {
                "name": "storeId",
                "description": "The ID of the store.",
                "type": "string"
              },
              "completedAt": {
                "name": "completedAt",
                "description": "The date and time when the bulk task was completed. Format: [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html).\n",
                "type": "string"
              },
              "createdAt": {
                "name": "createdAt",
                "description": "The date and time when the bulk task was created. Format: [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html).",
                "type": "string",
                "example": "2023-04-06T10:48:29+08:00"
              },
              "partialDataUrl": {
                "name": "partialDataUrl",
                "description": "A URL to a file containing task processing results with an expiration time. Format: [JSON Lines](https://jsonlines.org).  \nWhen `status` is `COMPLETED`, this value is identical to the `url` value. For other statuses, it may contain partial processing results.\n",
                "type": "string",
                "example": "https://sl-private-oss.oss-accelerate.example.com/task-jsonline/prod/1/9b0c0f04-53cb-4ae3-94db-79af6ec193bd.jsonl?Expires=1754059510"
              }
            },
            "example": {
              "errorCode": null,
              "expiredAt": null,
              "partialDataUrl": "https://sl-private-oss.oss-accelerate.example.com/task-jsonline/prod/1/9b0c0f04-53cb-4ae3-94db-79af6ec193bd.jsonl?Expires=1754059510",
              "reason": null,
              "url": "https://sl-private-oss.oss-accelerate.example.com/task-jsonline/prod/1/9b0c0f04-53cb-4ae3-94db-79af6ec193bd.jsonl?Expires=1754059510",
              "completedAt": null,
              "createdAt": "2023-04-06T10:48:29+08:00",
              "id": null,
              "status": null,
              "storeId": null,
              "type": null,
              "completedCount": null
            }
          },
          "examples": {
            "Get a valid bulk query task": {
              "description": "If you query the active tasks of the current store, there is only one active task at most",
              "value": {
                "createdAt": "2025-06-26T15:16:32+08:00",
                "reason": null,
                "status": "CREATED",
                "storeId": "1672369729606",
                "url": null,
                "completedAt": null,
                "completedCount": 0,
                "errorCode": null,
                "expiredAt": null,
                "id": "gid://shopline/BulkOperation/30b39695dddbea6bdf02da9400694468",
                "partialDataUrl": null,
                "type": "QUERY"
              }
            }
          }
        }
      }
    },
    "401": {
      "headers": {
        "traceId": {
          "description": "A globally unique identifier for the request. It is used to track the request flow throughout the system, allowing for easy location and debugging when issues arise."
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "errors": {
                "description": "Error message. ",
                "type": "string"
              }
            },
            "required": [
              "errors"
            ]
          }
        }
      }
    },
    "429": {
      "headers": {
        "traceId": {
          "description": "A globally unique identifier for the request. It is used to track the request flow throughout the system, allowing for easy location and debugging when issues arise."
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "errors": {
                "description": "Error message. ",
                "type": "string"
              }
            },
            "required": [
              "errors"
            ]
          }
        }
      }
    }
  },
  "security": [
    {
      "oauth2": []
    }
  ],
  "method": "get",
  "path": "/current_bulk_operation.json",
  "servers": [
    {
      "url": "https://{handle}.myshopline.com/admin/openapi",
      "variables": {
        "handle": {
          "default": "openapiceshidianpu",
          "description": "`handle` : The store's unique identifier, which is the prefix of the store's domain name. For example, if a store's domain name is `open001.myshopline.com` , the store handle is `open001` ."
        }
      }
    }
  ],
  "info": {
    "title": "Get a valid bulk task",
    "version": "v20270301"
  },
  "authIndexes": [
    "read_bulkoperation"
  ]
}
```