curl --request POST \
--url https://{your-prod-endpoint}/v1/lang-graph/threads/{threadId}/runs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-doctor: <x-doctor>' \
--data '
{
"input": {
"messages": [
{
"role": "user",
"content": "Hello, how can you help me today?"
}
]
},
"config": {
"configurable": {
"thread_id": "thread-abc123"
}
}
}
'import requests
url = "https://{your-prod-endpoint}/v1/lang-graph/threads/{threadId}/runs"
payload = {
"input": { "messages": [
{
"role": "user",
"content": "Hello, how can you help me today?"
}
] },
"config": { "configurable": { "thread_id": "thread-abc123" } }
}
headers = {
"x-doctor": "<x-doctor>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-doctor': '<x-doctor>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
input: {messages: [{role: 'user', content: 'Hello, how can you help me today?'}]},
config: {configurable: {thread_id: 'thread-abc123'}}
})
};
fetch('https://{your-prod-endpoint}/v1/lang-graph/threads/{threadId}/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://{your-prod-endpoint}/v1/lang-graph/threads/{threadId}/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([
'input' => [
'messages' => [
[
'role' => 'user',
'content' => 'Hello, how can you help me today?'
]
]
],
'config' => [
'configurable' => [
'thread_id' => 'thread-abc123'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-doctor: <x-doctor>"
],
]);
$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://{your-prod-endpoint}/v1/lang-graph/threads/{threadId}/runs"
payload := strings.NewReader("{\n \"input\": {\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello, how can you help me today?\"\n }\n ]\n },\n \"config\": {\n \"configurable\": {\n \"thread_id\": \"thread-abc123\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-doctor", "<x-doctor>")
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://{your-prod-endpoint}/v1/lang-graph/threads/{threadId}/runs")
.header("x-doctor", "<x-doctor>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"input\": {\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello, how can you help me today?\"\n }\n ]\n },\n \"config\": {\n \"configurable\": {\n \"thread_id\": \"thread-abc123\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{your-prod-endpoint}/v1/lang-graph/threads/{threadId}/runs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-doctor"] = '<x-doctor>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"input\": {\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello, how can you help me today?\"\n }\n ]\n },\n \"config\": {\n \"configurable\": {\n \"thread_id\": \"thread-abc123\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"run_id": "run-xyz789",
"thread_id": "thread-abc123",
"status": "pending",
"created_at": "2023-10-09T10:00:00.000Z"
}{
"success": false,
"error": "Bad Request",
"details": "Either medical_note or pdf_file must be provided"
}{
"success": false,
"error": "Bad Request",
"details": "Either medical_note or pdf_file must be provided"
}{
"success": false,
"error": "Not Found",
"details": "Thread with id 'thread-abc123' not found"
}Execute conversation run
Executes a conversation run within an existing thread to process AI interactions. This is the core AI processing endpoint - sends messages to the AI assistant and initiates processing. Used for both real-time chat interactions and clinical note extraction from transcriptions. The run executes asynchronously and can be monitored via the join endpoint.
curl --request POST \
--url https://{your-prod-endpoint}/v1/lang-graph/threads/{threadId}/runs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-doctor: <x-doctor>' \
--data '
{
"input": {
"messages": [
{
"role": "user",
"content": "Hello, how can you help me today?"
}
]
},
"config": {
"configurable": {
"thread_id": "thread-abc123"
}
}
}
'import requests
url = "https://{your-prod-endpoint}/v1/lang-graph/threads/{threadId}/runs"
payload = {
"input": { "messages": [
{
"role": "user",
"content": "Hello, how can you help me today?"
}
] },
"config": { "configurable": { "thread_id": "thread-abc123" } }
}
headers = {
"x-doctor": "<x-doctor>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-doctor': '<x-doctor>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
input: {messages: [{role: 'user', content: 'Hello, how can you help me today?'}]},
config: {configurable: {thread_id: 'thread-abc123'}}
})
};
fetch('https://{your-prod-endpoint}/v1/lang-graph/threads/{threadId}/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://{your-prod-endpoint}/v1/lang-graph/threads/{threadId}/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([
'input' => [
'messages' => [
[
'role' => 'user',
'content' => 'Hello, how can you help me today?'
]
]
],
'config' => [
'configurable' => [
'thread_id' => 'thread-abc123'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-doctor: <x-doctor>"
],
]);
$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://{your-prod-endpoint}/v1/lang-graph/threads/{threadId}/runs"
payload := strings.NewReader("{\n \"input\": {\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello, how can you help me today?\"\n }\n ]\n },\n \"config\": {\n \"configurable\": {\n \"thread_id\": \"thread-abc123\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-doctor", "<x-doctor>")
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://{your-prod-endpoint}/v1/lang-graph/threads/{threadId}/runs")
.header("x-doctor", "<x-doctor>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"input\": {\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello, how can you help me today?\"\n }\n ]\n },\n \"config\": {\n \"configurable\": {\n \"thread_id\": \"thread-abc123\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{your-prod-endpoint}/v1/lang-graph/threads/{threadId}/runs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-doctor"] = '<x-doctor>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"input\": {\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello, how can you help me today?\"\n }\n ]\n },\n \"config\": {\n \"configurable\": {\n \"thread_id\": \"thread-abc123\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"run_id": "run-xyz789",
"thread_id": "thread-abc123",
"status": "pending",
"created_at": "2023-10-09T10:00:00.000Z"
}{
"success": false,
"error": "Bad Request",
"details": "Either medical_note or pdf_file must be provided"
}{
"success": false,
"error": "Bad Request",
"details": "Either medical_note or pdf_file must be provided"
}{
"success": false,
"error": "Not Found",
"details": "Thread with id 'thread-abc123' not found"
}Autorizaciones
Bearer token for API authentication
Encabezados
Boolean flag to determine assistant type (true = chat/scribe, false = extraction)
Doctor identifier for tracking and auditing
Patient identifier for tracking and auditing
Parámetros de ruta
The thread identifier to execute the run in
Cuerpo
Respuesta
Run created successfully
Unique run identifier
"run-xyz789"
Associated thread identifier
"thread-abc123"
Current status of the run
pending, running, completed, failed "pending"
Timestamp when run was created
"2023-10-09T10:00:00.000Z"