Skip to main content
POST
/
v2
/
workflow
/
run-task-by-template
Run an official workflow template (create a task)
curl --request POST \
  --url https://api.browseract.com/v2/workflow/run-task-by-template \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "proxyRegion": "US",
  "workflow_template_id": "tpl_123456789",
  "input_parameters": [
    {
      "name": "url",
      "value": "https://example.com"
    }
  ]
}
'
import requests

url = "https://api.browseract.com/v2/workflow/run-task-by-template"

payload = {
"proxyRegion": "US",
"workflow_template_id": "tpl_123456789",
"input_parameters": [
{
"name": "url",
"value": "https://example.com"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
proxyRegion: 'US',
workflow_template_id: 'tpl_123456789',
input_parameters: [{name: 'url', value: 'https://example.com'}]
})
};

fetch('https://api.browseract.com/v2/workflow/run-task-by-template', 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.browseract.com/v2/workflow/run-task-by-template",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'proxyRegion' => 'US',
'workflow_template_id' => 'tpl_123456789',
'input_parameters' => [
[
'name' => 'url',
'value' => 'https://example.com'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

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

curl_close($curl);

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

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

func main() {

url := "https://api.browseract.com/v2/workflow/run-task-by-template"

payload := strings.NewReader("{\n \"proxyRegion\": \"US\",\n \"workflow_template_id\": \"tpl_123456789\",\n \"input_parameters\": [\n {\n \"name\": \"url\",\n \"value\": \"https://example.com\"\n }\n ]\n}")

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

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

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.browseract.com/v2/workflow/run-task-by-template")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"proxyRegion\": \"US\",\n \"workflow_template_id\": \"tpl_123456789\",\n \"input_parameters\": [\n {\n \"name\": \"url\",\n \"value\": \"https://example.com\"\n }\n ]\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.browseract.com/v2/workflow/run-task-by-template")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"proxyRegion\": \"US\",\n \"workflow_template_id\": \"tpl_123456789\",\n \"input_parameters\": [\n {\n \"name\": \"url\",\n \"value\": \"https://example.com\"\n }\n ]\n}"

response = http.request(request)
puts response.read_body
{
  "id": "task_123456789",
  "profile_id": "profile_abc123"
}
{
"code": 123,
"msg": "Invalid task_id",
"data": {},
"ts": 1699335116000,
"time": "2023-11-07T05:31:56Z",
"traceId": "b4bb01c1b2b14f11a6a2d7c1c8b0e3a1"
}
{
"code": 123,
"msg": "Invalid task_id",
"data": {},
"ts": 1699335116000,
"time": "2023-11-07T05:31:56Z",
"traceId": "b4bb01c1b2b14f11a6a2d7c1c8b0e3a1"
}

Authorizations

Authorization
string
header
required

Send your API key in the Authorization header as Bearer <API_KEY>.

Body

application/json

Request body used to start a new task from an official workflow template.

workflow_template_id
string
required

The official workflow template ID to run.

Example:

"tpl_123456789"

proxyRegion
string

Optional. Proxy region code. Defaults to US.

Example:

"US"

input_parameters
object[]

Input parameters for this run.

Example:
[
{
"name": "url",
"value": "https://example.com"
}
]
callback_url
string

Optional. See RunWorkflowTaskRequest.callback_url.

Maximum string length: 2048
Example:

"https://your-server.com/webhooks/workflow-callback"

status_change_callback_url
string

Optional. See RunWorkflowTaskRequest.status_change_callback_url.

Maximum string length: 2048
Example:

"https://your-server.com/webhooks/task-status-change-callback"

Response

OK

Response returned after successfully creating a task.

id
string
required

The unique task_id. Use it to poll status/results or to stop/resume the task.

Example:

"task_123456789"

profile_id
string

Returned only when save_browser_data is true. Use it to reuse browser data (e.g., cookies) in later runs.

Example:

"profile_abc123"