{
  "openapi": "3.0.1",
  "info": {
    "title": "Octoparse API",
    "description": "Octoparse OpenAPI allows you to programmatically manage tasks, run cloud extractions, and retrieve scraped data. Base URL: `https://openapi.octoparse.com`",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://openapi.octoparse.com",
      "description": "Octoparse API Server"
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Use the access_token obtained from POST /token"
      }
    },
    "schemas": {
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "integer"
              },
              "message": {
                "type": "string"
              }
            }
          },
          "requestId": {
            "type": "string"
          }
        }
      }
    }
  },
  "paths": {
    "/token": {
      "post": {
        "operationId": "obtainToken",
        "summary": "Obtain a New Token",
        "description": "Before getting access to the Octoparse OpenAPI, you will need your username and password to get a new Access Token.",
        "tags": [
          "Access Token"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "username",
                  "password",
                  "grant_type"
                ],
                "properties": {
                  "username": {
                    "type": "string",
                    "description": "Account email address or username"
                  },
                  "password": {
                    "type": "string",
                    "description": "Account password"
                  },
                  "grant_type": {
                    "type": "string",
                    "description": "Must be `password`",
                    "example": "password"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Token obtained successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "access_token": {
                          "type": "string"
                        },
                        "expires_in": {
                          "type": "integer",
                          "description": "Expiry time in seconds"
                        },
                        "token_type": {
                          "type": "string"
                        },
                        "refresh_token": {
                          "type": "string"
                        }
                      }
                    },
                    "requestId": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/token/refresh": {
      "post": {
        "operationId": "refreshToken",
        "summary": "Refresh Token",
        "description": "Once an Access Token expires, you can refresh it using the refresh_token obtained during the initial token request.",
        "tags": [
          "Access Token"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "refresh_token",
                  "grant_type"
                ],
                "properties": {
                  "refresh_token": {
                    "type": "string",
                    "description": "The refresh token from the original token response"
                  },
                  "grant_type": {
                    "type": "string",
                    "description": "Must be `refresh_token`",
                    "example": "refresh_token"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Token refreshed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "access_token": {
                          "type": "string"
                        },
                        "expires_in": {
                          "type": "integer"
                        },
                        "token_type": {
                          "type": "string"
                        },
                        "refresh_token": {
                          "type": "string"
                        }
                      }
                    },
                    "requestId": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/taskGroup": {
      "get": {
        "operationId": "getTaskGroups",
        "summary": "Get Task Group Information",
        "description": "Get information of all task groups.",
        "tags": [
          "Task Group"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Task group list retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "taskGroupId": {
                            "type": "string"
                          },
                          "taskGroupName": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "requestId": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/task/search": {
      "get": {
        "operationId": "searchTask",
        "summary": "Search Task",
        "description": "Get task information based on task group ID.",
        "tags": [
          "Task"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "taskGroupId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The task group ID to search tasks within"
          }
        ],
        "responses": {
          "200": {
            "description": "Tasks retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "taskId": {
                            "type": "string"
                          },
                          "taskName": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "requestId": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/task/getActions": {
      "post": {
        "operationId": "getActionParameters",
        "summary": "Get Action Parameters",
        "description": "Get task parameters based on the specific action. For example, the URL from 'Go to Web Page' or the text from 'Enter Text'.",
        "tags": [
          "Task"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "taskIds",
                  "actionTypes"
                ],
                "properties": {
                  "taskIds": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "List of task IDs"
                  },
                  "actionTypes": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "List of action types to retrieve parameters for"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Action parameters retrieved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "taskId": {
                            "type": "string"
                          },
                          "actions": {
                            "type": "array",
                            "items": {
                              "type": "object"
                            }
                          }
                        }
                      }
                    },
                    "requestId": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/task/updateTaskParameters": {
      "post": {
        "operationId": "updateTaskParameters",
        "summary": "Update Task Parameters",
        "description": "Update task parameters, including loop parameters (URLs, text lists) and action properties.",
        "tags": [
          "Task"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "taskId",
                  "actions"
                ],
                "properties": {
                  "taskId": {
                    "type": "string"
                  },
                  "actions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "actionType": {
                          "type": "string"
                        },
                        "actionId": {
                          "type": "string"
                        },
                        "properties": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "name": {
                                "type": "string"
                              },
                              "value": {
                                "type": "string"
                              }
                            }
                          }
                        },
                        "loopItems": {
                          "type": "object",
                          "properties": {
                            "actionId": {
                              "type": "string"
                            },
                            "loopType": {
                              "type": "string"
                            },
                            "loopItems": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "isAppend": {
                              "type": "boolean"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Task parameters updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "taskId": {
                          "type": "string"
                        },
                        "updatedParameters": {
                          "type": "object"
                        }
                      }
                    },
                    "requestId": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/task/copy": {
      "post": {
        "operationId": "duplicateTask",
        "summary": "Duplicate Task",
        "description": "Duplicate a task to a specified group.",
        "tags": [
          "Task"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "taskId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ID of the task to duplicate"
          },
          {
            "name": "taskGroupId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Destination task group ID"
          }
        ],
        "responses": {
          "200": {
            "description": "Task duplicated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "taskId": {
                          "type": "string"
                        }
                      }
                    },
                    "requestId": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/task/moveToGroup": {
      "post": {
        "operationId": "moveTask",
        "summary": "Move Task",
        "description": "Move a task to a specified task group.",
        "tags": [
          "Task"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "taskId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ID of the task to move"
          },
          {
            "name": "taskGroupId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Destination task group ID"
          }
        ],
        "responses": {
          "200": {
            "description": "Task moved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "moved": {
                          "type": "boolean"
                        }
                      }
                    },
                    "requestId": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/task/updateActionProperties": {
      "post": {
        "operationId": "updateActionProperties",
        "summary": "Update Action Parameters",
        "description": "Update the text value in the Enter Text action or the URL in the Go to Web Page action.",
        "tags": [
          "Task"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "taskId",
                  "actions"
                ],
                "properties": {
                  "taskId": {
                    "type": "string"
                  },
                  "actions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "actionType": {
                          "type": "string"
                        },
                        "actionId": {
                          "type": "string"
                        },
                        "properties": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "name": {
                                "type": "string"
                              },
                              "value": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Action properties updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        }
                      }
                    },
                    "requestId": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/task/updateLoopItems": {
      "post": {
        "operationId": "updateLoopItems",
        "summary": "Update Loop Item List",
        "description": "Update the text list or URL list in a Loop Item.",
        "tags": [
          "Task"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "taskId",
                  "actionId",
                  "loopType",
                  "loopItems"
                ],
                "properties": {
                  "taskId": {
                    "type": "string"
                  },
                  "actionId": {
                    "type": "string"
                  },
                  "loopType": {
                    "type": "string",
                    "description": "Type of loop item (e.g. URL, text)"
                  },
                  "loopItems": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "isAppend": {
                    "type": "boolean",
                    "description": "If true, appends items to existing list. If false, replaces the list."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Loop items updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        }
                      }
                    },
                    "requestId": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/task/urls:file": {
      "post": {
        "operationId": "updateTaskUrls",
        "summary": "Update Task URLs",
        "description": "Update the URLs in a task with a URL file link.",
        "tags": [
          "Task"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "taskId",
                  "file"
                ],
                "properties": {
                  "taskId": {
                    "type": "string"
                  },
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "A file containing URLs (one per line)"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Task URLs updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "requestId": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/cloudextraction/start": {
      "post": {
        "operationId": "startTask",
        "summary": "Start Task",
        "description": "Run a task in the Cloud.",
        "tags": [
          "Cloud Extraction"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "taskId"
                ],
                "properties": {
                  "taskId": {
                    "type": "string",
                    "description": "ID of the task to start"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Task started",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "lotNo": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string"
                        }
                      }
                    },
                    "requestId": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/cloudextraction/stop": {
      "post": {
        "operationId": "stopTask",
        "summary": "Stop Task",
        "description": "Stop a task running in the Cloud.",
        "tags": [
          "Cloud Extraction"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "taskId"
                ],
                "properties": {
                  "taskId": {
                    "type": "string",
                    "description": "ID of the task to stop"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Task stopped",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "requestId": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/cloudextraction/statuses": {
      "post": {
        "operationId": "getTaskStatus",
        "summary": "Get Task Status",
        "description": "Get the status of tasks based on task IDs. Request frequency: 1 request / 5 seconds.",
        "tags": [
          "Cloud Extraction"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "taskIds"
                ],
                "properties": {
                  "taskIds": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Task statuses retrieved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "taskId": {
                            "type": "string"
                          },
                          "taskName": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "requestId": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/cloudextraction/statuses/v2": {
      "post": {
        "operationId": "getTaskStatusV2",
        "summary": "Get Task Status V2",
        "description": "Get the status of tasks based on task IDs. Request frequency: 5 requests / second.",
        "tags": [
          "Cloud Extraction"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "taskIds"
                ],
                "properties": {
                  "taskIds": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Detailed task statuses retrieved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "taskId": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "currentTotalExtractCount": {
                            "type": "integer"
                          },
                          "executedTimes": {
                            "type": "integer"
                          },
                          "subTaskCount": {
                            "type": "integer"
                          },
                          "nextExecuteTime": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "startExecuteTime": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "endExecuteTime": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    },
                    "requestId": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/cloudextraction/task/subtasks": {
      "get": {
        "operationId": "getSubtaskStatus",
        "summary": "Get Subtask Status",
        "description": "Get the subtask status of the latest run of a task.",
        "tags": [
          "Cloud Extraction"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "taskId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Page number (starts from 1)"
          },
          {
            "name": "size",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Number of subtasks per page"
          }
        ],
        "responses": {
          "200": {
            "description": "Subtask statuses retrieved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "subTaskId": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "requestId": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/cloudextraction/subtasks:start": {
      "post": {
        "operationId": "startSubtasks",
        "summary": "Start Subtasks",
        "description": "Start subtasks in the Cloud.",
        "tags": [
          "Cloud Extraction"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "taskId",
                  "subTaskIds"
                ],
                "properties": {
                  "taskId": {
                    "type": "string"
                  },
                  "subTaskIds": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Subtasks started",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "requestId": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/cloudextraction/subtasks:stop": {
      "post": {
        "operationId": "stopSubtasks",
        "summary": "Stop Subtasks",
        "description": "Stop subtasks in the Cloud.",
        "tags": [
          "Cloud Extraction"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "taskId",
                  "subTaskIds"
                ],
                "properties": {
                  "taskId": {
                    "type": "string"
                  },
                  "subTaskIds": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Subtasks stopped",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "requestId": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/data/notexported": {
      "get": {
        "operationId": "getNonExportedData",
        "summary": "Get Non-Exported Data",
        "description": "Get data that has never been exported. Use 'Mark Data as Exported' to mark data after processing so it won't appear here again.",
        "tags": [
          "Data"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "taskId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "size",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Number of rows to return"
          }
        ],
        "responses": {
          "200": {
            "description": "Non-exported data retrieved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        },
                        "total": {
                          "type": "integer"
                        },
                        "current": {
                          "type": "integer"
                        }
                      }
                    },
                    "requestId": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/data/markexported": {
      "post": {
        "operationId": "markDataAsExported",
        "summary": "Mark Data as Exported",
        "description": "Mark the data as exported. Without marking, the data will still appear in the non-exported data endpoint.",
        "tags": [
          "Data"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "taskId"
                ],
                "properties": {
                  "taskId": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Data marked as exported",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "requestId": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/data/all": {
      "get": {
        "operationId": "getDataByOffset",
        "summary": "Get Data by Offset",
        "description": "Get data starting from a specific row offset. Set offset to 0 to start from the first row.",
        "tags": [
          "Data"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "taskId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Row offset to start from (0-indexed)"
          },
          {
            "name": "size",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Number of rows to return"
          }
        ],
        "responses": {
          "200": {
            "description": "Data retrieved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        },
                        "total": {
                          "type": "integer"
                        },
                        "restTotal": {
                          "type": "integer"
                        },
                        "offset": {
                          "type": "integer"
                        }
                      }
                    },
                    "requestId": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/data/remove": {
      "post": {
        "operationId": "removeData",
        "summary": "Remove Data",
        "description": "Delete all the data of a task.",
        "tags": [
          "Data"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "taskId"
                ],
                "properties": {
                  "taskId": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Data removed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "requestId": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/data/lotno/all": {
      "get": {
        "operationId": "getDataByBatchOffset",
        "summary": "Get Data From a Designated Batch by Offset",
        "description": "Get data from a specific batch (lotno) starting from a row offset. Set offset to 0 to start from the first row.",
        "tags": [
          "Data"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "taskId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lotno",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The batch number (lotNo) returned when a task was started"
          },
          {
            "name": "offset",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Row offset to start from (0-indexed)"
          },
          {
            "name": "size",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Number of rows to return"
          }
        ],
        "responses": {
          "200": {
            "description": "Batch data retrieved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        },
                        "total": {
                          "type": "integer"
                        },
                        "restTotal": {
                          "type": "integer"
                        },
                        "offset": {
                          "type": "integer"
                        }
                      }
                    },
                    "requestId": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}