curl --request POST \
--url https://api.devic.ai/v1/agents/threads/{threadId}/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"message": "Also include a summary of the previous steps"
}
'import requests
url = "https://api.devic.ai/v1/agents/threads/{threadId}/messages"
payload = { "message": "Also include a summary of the previous steps" }
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({message: 'Also include a summary of the previous steps'})
};
fetch('https://api.devic.ai/v1/agents/threads/{threadId}/messages', 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.devic.ai/v1/agents/threads/{threadId}/messages",
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([
'message' => 'Also include a summary of the previous steps'
]),
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.devic.ai/v1/agents/threads/{threadId}/messages"
payload := strings.NewReader("{\n \"message\": \"Also include a summary of the previous steps\"\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.devic.ai/v1/agents/threads/{threadId}/messages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"message\": \"Also include a summary of the previous steps\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devic.ai/v1/agents/threads/{threadId}/messages")
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 \"message\": \"Also include a summary of the previous steps\"\n}"
response = http.request(request)
puts response.read_body{
"tokenUsage": {
"inputTokens": 1250,
"outputTokens": 450,
"inputCachedTokens": 320,
"outputCachedTokens": 80,
"totalTokens": 1700,
"totalCachedTokens": 400,
"cost": {
"inputCost": 0.00125,
"outputCost": 0.0045,
"inputCachedCost": 0.00016,
"outputCachedCost": 0.008,
"totalCost": 0.00641
},
"provider": "open-ai",
"model": "gpt-4o-mini-2024-07-18"
},
"metadata": {
"propmptTemplateParams": {},
"tenantToken": "<string>"
},
"tenantId": "tenant-123",
"isSubthread": false,
"parentThreadId": "64f5a5b8c123456789abcdef",
"parentAgentId": "64f5a5b8c123456789abcdef",
"subThreadToolCallId": "call_abc123",
"pendingHandOffSubThreadIds": [
"<string>"
],
"handOffSubThreadIds": [
"<string>"
],
"tasks": [
{}
],
"pendingAsyncToolCalls": [
{
"toolCallId": "<string>",
"toolName": "<string>",
"sentAt": 123,
"resolved": true,
"callbackUrl": "<string>"
}
],
"pausedReason": "<string>",
"pausedUntil": 1721551200000,
"pausedTimestampMS": 1721550000000,
"coreMemories": [
"<string>"
],
"recalledMemories": [
"<string>"
]
}Continue a thread with a user message
Appends a user message to an existing thread to continue it. The effect depends on the current thread state: a completed/failed/waiting thread is re-queued and re-run with the message appended; a still-running or queued thread receives the message on its next turn (right after the pending tool response). Threads waiting for approval, handed off to a subagent, or still being created cannot be continued this way.
curl --request POST \
--url https://api.devic.ai/v1/agents/threads/{threadId}/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"message": "Also include a summary of the previous steps"
}
'import requests
url = "https://api.devic.ai/v1/agents/threads/{threadId}/messages"
payload = { "message": "Also include a summary of the previous steps" }
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({message: 'Also include a summary of the previous steps'})
};
fetch('https://api.devic.ai/v1/agents/threads/{threadId}/messages', 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.devic.ai/v1/agents/threads/{threadId}/messages",
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([
'message' => 'Also include a summary of the previous steps'
]),
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.devic.ai/v1/agents/threads/{threadId}/messages"
payload := strings.NewReader("{\n \"message\": \"Also include a summary of the previous steps\"\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.devic.ai/v1/agents/threads/{threadId}/messages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"message\": \"Also include a summary of the previous steps\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devic.ai/v1/agents/threads/{threadId}/messages")
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 \"message\": \"Also include a summary of the previous steps\"\n}"
response = http.request(request)
puts response.read_body{
"tokenUsage": {
"inputTokens": 1250,
"outputTokens": 450,
"inputCachedTokens": 320,
"outputCachedTokens": 80,
"totalTokens": 1700,
"totalCachedTokens": 400,
"cost": {
"inputCost": 0.00125,
"outputCost": 0.0045,
"inputCachedCost": 0.00016,
"outputCachedCost": 0.008,
"totalCost": 0.00641
},
"provider": "open-ai",
"model": "gpt-4o-mini-2024-07-18"
},
"metadata": {
"propmptTemplateParams": {},
"tenantToken": "<string>"
},
"tenantId": "tenant-123",
"isSubthread": false,
"parentThreadId": "64f5a5b8c123456789abcdef",
"parentAgentId": "64f5a5b8c123456789abcdef",
"subThreadToolCallId": "call_abc123",
"pendingHandOffSubThreadIds": [
"<string>"
],
"handOffSubThreadIds": [
"<string>"
],
"tasks": [
{}
],
"pendingAsyncToolCalls": [
{
"toolCallId": "<string>",
"toolName": "<string>",
"sentAt": 123,
"resolved": true,
"callbackUrl": "<string>"
}
],
"pausedReason": "<string>",
"pausedUntil": 1721551200000,
"pausedTimestampMS": 1721550000000,
"coreMemories": [
"<string>"
],
"recalledMemories": [
"<string>"
]
}Authorizations
An API key from your Devic console, sent as Authorization: Bearer <key>. An embedded front end sends a tenant-session token instead, so no API key reaches the browser, and an OAuth integration sends its access token. Missing, invalid or expired credentials get a 401. See Authentication.
Headers
Body
The user message to append to the thread to continue it (string or object). Behaviour depends on the current thread state: a running/queued thread receives it on its next turn (after the pending tool response); a completed/failed/waiting thread is re-queued to run again with the message appended.
"Also include a summary of the previous steps"
Response
Message added to the thread