Skip to main content
POST
/
api
/
agentTools
/
startOrStopTask
Start Or Stop Task
curl --request POST \
  --url https://api.example.com/api/agentTools/startOrStopTask
import requests

url = "https://api.example.com/api/agentTools/startOrStopTask"

response = requests.post(url)

print(response.text)
const options = {method: 'POST'};

fetch('https://api.example.com/api/agentTools/startOrStopTask', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/agentTools/startOrStopTask",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.example.com/api/agentTools/startOrStopTask"

req, _ := http.NewRequest("POST", url, nil)

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.example.com/api/agentTools/startOrStopTask")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.example.com/api/agentTools/startOrStopTask")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
The request body, generated cURL example, and response schema are shown in the API panel.
Start or stop an existing Octoparse task through AgentTools.
1

Locate the task

Use searchTasks when the task ID is not already known.
2

Request an action

Send action as start or stop.
3

Continue with export

Use exportData when response guidance indicates data may be available.
searchTasks -> startOrStopTask -> exportData

Request body

taskId and action are required.

Actions

Allowed action values are start and stop.
start_requested and stop_requested mean the request was accepted.already_running and already_stopped mean no state change was needed.start_rejected, stop_rejected, and invalid require client-side handling or user review.
Follow retryGuidance, suggestedNextCall, workflow, and toolHint instead of hard-coding polling intervals.