Queue task run
curl --request POST \
--url https://api.komos.ai/public/v1/tasks/{taskId}/runs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"clientRequestId": "checkout-48219",
"inputs": {
"url": "https://example.com/orders/48219",
"runHeadless": true
}
}
'import requests
url = "https://api.komos.ai/public/v1/tasks/{taskId}/runs"
payload = {
"clientRequestId": "checkout-48219",
"inputs": {
"url": "https://example.com/orders/48219",
"runHeadless": True
}
}
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({
clientRequestId: 'checkout-48219',
inputs: {url: 'https://example.com/orders/48219', runHeadless: true}
})
};
fetch('https://api.komos.ai/public/v1/tasks/{taskId}/runs', 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.komos.ai/public/v1/tasks/{taskId}/runs",
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([
'clientRequestId' => 'checkout-48219',
'inputs' => [
'url' => 'https://example.com/orders/48219',
'runHeadless' => true
]
]),
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.komos.ai/public/v1/tasks/{taskId}/runs"
payload := strings.NewReader("{\n \"clientRequestId\": \"checkout-48219\",\n \"inputs\": {\n \"url\": \"https://example.com/orders/48219\",\n \"runHeadless\": true\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.komos.ai/public/v1/tasks/{taskId}/runs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"clientRequestId\": \"checkout-48219\",\n \"inputs\": {\n \"url\": \"https://example.com/orders/48219\",\n \"runHeadless\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.komos.ai/public/v1/tasks/{taskId}/runs")
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 \"clientRequestId\": \"checkout-48219\",\n \"inputs\": {\n \"url\": \"https://example.com/orders/48219\",\n \"runHeadless\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"run": {
"id": "220a501c-82f4-43e2-8107-3d8e0c0f4c1b",
"taskId": "79c6b1aa-24d1-45b3-8c94-9a2e2a2f55bc",
"status": "COMPLETED",
"triggerType": "api",
"timestamps": {
"createdAt": "2025-10-13T15:02:44.812Z",
"startedAt": "2025-10-13T15:02:47.001Z",
"finishedAt": "2025-10-13T15:03:28.559Z"
},
"progress": {
"currentStep": 5,
"stepsTotal": 5
},
"inputs": {
"url": "https://example.com/orders/48190"
},
"outputs": {
"summary": "Completed order checkout scrape"
},
"logsUrl": "https://api.komos.ai/public/v1/task-runs/220a501c-82f4-43e2-8107-3d8e0c0f4c1b/logs",
"error": null,
"cancelReason": null
}
}{
"run": {
"id": "9c77d908-7bf4-4e7f-9a20-2c5e7fdf2e94",
"taskId": "79c6b1aa-24d1-45b3-8c94-9a2e2a2f55bc",
"status": "PENDING",
"triggerType": "api",
"timestamps": {
"createdAt": "2025-10-14T18:21:52.123Z",
"startedAt": null,
"finishedAt": null
},
"progress": null,
"inputs": {
"url": "https://example.com/orders/48219",
"runHeadless": true
},
"outputs": {},
"logsUrl": "https://api.komos.ai/public/v1/task-runs/9c77d908-7bf4-4e7f-9a20-2c5e7fdf2e94/logs",
"error": null,
"cancelReason": null
}
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}Task runs
Queue Task Run
Start executing a saved Komos task.
POST
/
public
/
v1
/
tasks
/
{taskId}
/
runs
Queue task run
curl --request POST \
--url https://api.komos.ai/public/v1/tasks/{taskId}/runs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"clientRequestId": "checkout-48219",
"inputs": {
"url": "https://example.com/orders/48219",
"runHeadless": true
}
}
'import requests
url = "https://api.komos.ai/public/v1/tasks/{taskId}/runs"
payload = {
"clientRequestId": "checkout-48219",
"inputs": {
"url": "https://example.com/orders/48219",
"runHeadless": True
}
}
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({
clientRequestId: 'checkout-48219',
inputs: {url: 'https://example.com/orders/48219', runHeadless: true}
})
};
fetch('https://api.komos.ai/public/v1/tasks/{taskId}/runs', 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.komos.ai/public/v1/tasks/{taskId}/runs",
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([
'clientRequestId' => 'checkout-48219',
'inputs' => [
'url' => 'https://example.com/orders/48219',
'runHeadless' => true
]
]),
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.komos.ai/public/v1/tasks/{taskId}/runs"
payload := strings.NewReader("{\n \"clientRequestId\": \"checkout-48219\",\n \"inputs\": {\n \"url\": \"https://example.com/orders/48219\",\n \"runHeadless\": true\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.komos.ai/public/v1/tasks/{taskId}/runs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"clientRequestId\": \"checkout-48219\",\n \"inputs\": {\n \"url\": \"https://example.com/orders/48219\",\n \"runHeadless\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.komos.ai/public/v1/tasks/{taskId}/runs")
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 \"clientRequestId\": \"checkout-48219\",\n \"inputs\": {\n \"url\": \"https://example.com/orders/48219\",\n \"runHeadless\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"run": {
"id": "220a501c-82f4-43e2-8107-3d8e0c0f4c1b",
"taskId": "79c6b1aa-24d1-45b3-8c94-9a2e2a2f55bc",
"status": "COMPLETED",
"triggerType": "api",
"timestamps": {
"createdAt": "2025-10-13T15:02:44.812Z",
"startedAt": "2025-10-13T15:02:47.001Z",
"finishedAt": "2025-10-13T15:03:28.559Z"
},
"progress": {
"currentStep": 5,
"stepsTotal": 5
},
"inputs": {
"url": "https://example.com/orders/48190"
},
"outputs": {
"summary": "Completed order checkout scrape"
},
"logsUrl": "https://api.komos.ai/public/v1/task-runs/220a501c-82f4-43e2-8107-3d8e0c0f4c1b/logs",
"error": null,
"cancelReason": null
}
}{
"run": {
"id": "9c77d908-7bf4-4e7f-9a20-2c5e7fdf2e94",
"taskId": "79c6b1aa-24d1-45b3-8c94-9a2e2a2f55bc",
"status": "PENDING",
"triggerType": "api",
"timestamps": {
"createdAt": "2025-10-14T18:21:52.123Z",
"startedAt": null,
"finishedAt": null
},
"progress": null,
"inputs": {
"url": "https://example.com/orders/48219",
"runHeadless": true
},
"outputs": {},
"logsUrl": "https://api.komos.ai/public/v1/task-runs/9c77d908-7bf4-4e7f-9a20-2c5e7fdf2e94/logs",
"error": null,
"cancelReason": null
}
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}Use this endpoint to queue a new asynchronous run for an existing task. Provide a UUID task ID
from the Komos dashboard and optional input overrides that match the task’s input schema.
Request
Path parameters
taskId— UUID for the saved task.
Body fields
inputs(object, optional) — Key/value overrides that map to the task’s declared inputs. Any keys omitted fall back to defaults defined in the task.clientRequestId(string, optional) — Supply a unique value per task to make the request idempotent. Repeating the same value returns200 OKwith the previously created run.
Example
curl -X POST \
https://api.komos.ai/public/v1/tasks/4df7d6f9-56be-4f77-9b18-25ad908a20b7/runs \
-H 'Authorization: Bearer sk_live_example' \
-H 'Content-Type: application/json' \
-d '{
"clientRequestId": "checkout-48219",
"inputs": {
"url": "https://example.com/orders/48219",
"runHeadless": true
}
}'
Responses
202 Accepted— The run was created and queued for execution. The payload contains the run resource withstatus: "PENDING".200 OK— A run with the suppliedclientRequestIdalready exists; the response returns the existing run without enqueuing another execution.400 Bad Request— Invalid task ID or payload shape.401 Unauthorized— Missing or malformed API key.402 Payment Required— Your organization exhausted its run allotment; the response includes usage details.404 Not Found— The task does not exist or is not accessible to the current organization.503 Service Unavailable— A transient queue error prevented dispatch; retry with exponential backoff.
GET /public/v1/task-runs/{runId} or subscribe to
task-run.* webhooks to follow execution.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
UUID of the Komos task to execute.
Body
application/json
Response
Existing run returned because the clientRequestId was reused.
Show child attributes
Show child attributes
Was this page helpful?