Add a follow-up instruction to a running task
curl --request POST \
--url https://api.valyu.ai/v1/deepresearch/tasks/{id}/update \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"instruction": "Also compare the safety profiles across all trials"
}
'import requests
url = "https://api.valyu.ai/v1/deepresearch/tasks/{id}/update"
payload = { "instruction": "Also compare the safety profiles across all trials" }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({instruction: 'Also compare the safety profiles across all trials'})
};
fetch('https://api.valyu.ai/v1/deepresearch/tasks/{id}/update', 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.valyu.ai/v1/deepresearch/tasks/{id}/update",
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([
'instruction' => 'Also compare the safety profiles across all trials'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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.valyu.ai/v1/deepresearch/tasks/{id}/update"
payload := strings.NewReader("{\n \"instruction\": \"Also compare the safety profiles across all trials\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.valyu.ai/v1/deepresearch/tasks/{id}/update")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"instruction\": \"Also compare the safety profiles across all trials\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.valyu.ai/v1/deepresearch/tasks/{id}/update")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"instruction\": \"Also compare the safety profiles across all trials\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Task updated successfully",
"deepresearch_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}Update Task
Reference for adding follow-up instructions to a running task via POST /v1/deepresearch/tasks/{id}/update.
POST
/
v1
/
deepresearch
/
tasks
/
{id}
/
update
Add a follow-up instruction to a running task
curl --request POST \
--url https://api.valyu.ai/v1/deepresearch/tasks/{id}/update \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"instruction": "Also compare the safety profiles across all trials"
}
'import requests
url = "https://api.valyu.ai/v1/deepresearch/tasks/{id}/update"
payload = { "instruction": "Also compare the safety profiles across all trials" }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({instruction: 'Also compare the safety profiles across all trials'})
};
fetch('https://api.valyu.ai/v1/deepresearch/tasks/{id}/update', 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.valyu.ai/v1/deepresearch/tasks/{id}/update",
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([
'instruction' => 'Also compare the safety profiles across all trials'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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.valyu.ai/v1/deepresearch/tasks/{id}/update"
payload := strings.NewReader("{\n \"instruction\": \"Also compare the safety profiles across all trials\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.valyu.ai/v1/deepresearch/tasks/{id}/update")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"instruction\": \"Also compare the safety profiles across all trials\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.valyu.ai/v1/deepresearch/tasks/{id}/update")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"instruction\": \"Also compare the safety profiles across all trials\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Task updated successfully",
"deepresearch_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}Add a follow-up instruction while research is running, before the writing phase begins. Use this to refine the investigation rather than submitting an unrelated second task.
Check the current task state first. An update can be rejected if the task has advanced past the supported phase; show that response to the user rather than implying the instruction was applied.
Authorizations
API key for authentication. Get yours at platform.valyu.ai.
Path Parameters
DeepResearch task ID.
Body
application/json
Follow-up instruction to guide a running research task. Can only be sent before the writing phase begins.
Follow-up instruction for the research agent.
Example:
"Also compare the safety profiles across all trials"
Was this page helpful?