Skip to main content
POST
/
tasks
/
{task_id}
/
runs
Run Existing Task
curl --request POST \
  --url https://api.webagent.cloud/tasks/{task_id}/runs \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "json_schema": "<string>",
  "prompt": "<string>",
  "model": "<string>",
  "provider": "<string>",
  "webhook_url": "<string>",
  "response_format": "<string>",
  "auth_context_id": "<string>",
  "initial_url": "<string>",
  "session_timeout": 123,
  "wait_for_completion": true
}
'
{
  "id": "<string>",
  "task_id": "<string>",
  "status": "pending",
  "result": "<unknown>",
  "is_done": true,
  "is_successful": true
}

Authorizations

x-api-key
string
header
required

Path Parameters

task_id
string
required

Body

application/json

Request model for creating a run from an existing task. All fields are optional and override the task's default values if provided.

json_schema

The JSON schema for the task result (overrides task json_schema)

prompt
string | null

The task to be performed by the agent (overrides task prompt)

model
string | null

The model to use (overrides task model)

provider
string | null

The provider to use (overrides task provider)

webhook_url
string | null

The webhook URL to send the result to (overrides task webhook_url)

response_format
string | null

Whether to return the result as text or JSON (overrides task response_format)

auth_context_id
string | null

The id of associated auth context (overrides task auth_context_id)

initial_url
string | null

The initial URL to navigate to before executing the task (overrides task initial_url)

session_timeout
integer | null

The timeout for the task in seconds

wait_for_completion
boolean | null

Whether to wait for the task to complete before returning the response. If false, the task will be executed in the background and the response will contain only the task ID.

Response

Successful Response

Represents a Run.

id
string
required

The ID of the created task run

task_id
string
required

The ID of the created task

status
enum<string>
default:pending

The status of the agent's task

Available options:
success,
failure,
pending
result
any | null

The final result of the agent's task

is_done
boolean | null

Whether the agent has completed its task

is_successful
boolean | null

Whether the agent was successful in completing its task