Update agent (CLI/SDK)
curl --request PUT \
--url https://api.runflow.ai/api/v1/runtime/agents/{id} \
--header 'Content-Type: application/json' \
--data '
{
"name": "Customer Support Bot",
"description": "AI-powered customer support agent",
"category": "CUSTOMER_SUPPORT",
"subcategory": "TIER_1_SUPPORT",
"status": "INACTIVE",
"logo": "https://example.com/logo.png",
"repositoryUrl": "https://github.com/user/agent-repo",
"endpointUrl": "https://api.example.com/agent/endpoint",
"code": "export function main() { return \"Hello World\"; }",
"fileTree": [
{
"name": "src",
"type": "folder",
"children": [
{
"name": "index.ts",
"type": "file",
"content": "export function main() { return \"Hello World\"; }"
}
]
}
],
"language": "typescript",
"branch": "main",
"commit": "abc123def456",
"tags": [
"ai",
"customer-support",
"chatbot"
],
"templateId": "starter",
"lastDeploy": "2025-01-01T00:00:00.000Z",
"newEngine": true
}
'import requests
url = "https://api.runflow.ai/api/v1/runtime/agents/{id}"
payload = {
"name": "Customer Support Bot",
"description": "AI-powered customer support agent",
"category": "CUSTOMER_SUPPORT",
"subcategory": "TIER_1_SUPPORT",
"status": "INACTIVE",
"logo": "https://example.com/logo.png",
"repositoryUrl": "https://github.com/user/agent-repo",
"endpointUrl": "https://api.example.com/agent/endpoint",
"code": "export function main() { return \"Hello World\"; }",
"fileTree": [
{
"name": "src",
"type": "folder",
"children": [
{
"name": "index.ts",
"type": "file",
"content": "export function main() { return \"Hello World\"; }"
}
]
}
],
"language": "typescript",
"branch": "main",
"commit": "abc123def456",
"tags": ["ai", "customer-support", "chatbot"],
"templateId": "starter",
"lastDeploy": "2025-01-01T00:00:00.000Z",
"newEngine": True
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Customer Support Bot',
description: 'AI-powered customer support agent',
category: 'CUSTOMER_SUPPORT',
subcategory: 'TIER_1_SUPPORT',
status: 'INACTIVE',
logo: 'https://example.com/logo.png',
repositoryUrl: 'https://github.com/user/agent-repo',
endpointUrl: 'https://api.example.com/agent/endpoint',
code: 'export function main() { return "Hello World"; }',
fileTree: [
{
name: 'src',
type: 'folder',
children: [
{
name: 'index.ts',
type: 'file',
content: 'export function main() { return "Hello World"; }'
}
]
}
],
language: 'typescript',
branch: 'main',
commit: 'abc123def456',
tags: ['ai', 'customer-support', 'chatbot'],
templateId: 'starter',
lastDeploy: '2025-01-01T00:00:00.000Z',
newEngine: true
})
};
fetch('https://api.runflow.ai/api/v1/runtime/agents/{id}', 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.runflow.ai/api/v1/runtime/agents/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Customer Support Bot',
'description' => 'AI-powered customer support agent',
'category' => 'CUSTOMER_SUPPORT',
'subcategory' => 'TIER_1_SUPPORT',
'status' => 'INACTIVE',
'logo' => 'https://example.com/logo.png',
'repositoryUrl' => 'https://github.com/user/agent-repo',
'endpointUrl' => 'https://api.example.com/agent/endpoint',
'code' => 'export function main() { return "Hello World"; }',
'fileTree' => [
[
'name' => 'src',
'type' => 'folder',
'children' => [
[
'name' => 'index.ts',
'type' => 'file',
'content' => 'export function main() { return "Hello World"; }'
]
]
]
],
'language' => 'typescript',
'branch' => 'main',
'commit' => 'abc123def456',
'tags' => [
'ai',
'customer-support',
'chatbot'
],
'templateId' => 'starter',
'lastDeploy' => '2025-01-01T00:00:00.000Z',
'newEngine' => true
]),
CURLOPT_HTTPHEADER => [
"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.runflow.ai/api/v1/runtime/agents/{id}"
payload := strings.NewReader("{\n \"name\": \"Customer Support Bot\",\n \"description\": \"AI-powered customer support agent\",\n \"category\": \"CUSTOMER_SUPPORT\",\n \"subcategory\": \"TIER_1_SUPPORT\",\n \"status\": \"INACTIVE\",\n \"logo\": \"https://example.com/logo.png\",\n \"repositoryUrl\": \"https://github.com/user/agent-repo\",\n \"endpointUrl\": \"https://api.example.com/agent/endpoint\",\n \"code\": \"export function main() { return \\\"Hello World\\\"; }\",\n \"fileTree\": [\n {\n \"name\": \"src\",\n \"type\": \"folder\",\n \"children\": [\n {\n \"name\": \"index.ts\",\n \"type\": \"file\",\n \"content\": \"export function main() { return \\\"Hello World\\\"; }\"\n }\n ]\n }\n ],\n \"language\": \"typescript\",\n \"branch\": \"main\",\n \"commit\": \"abc123def456\",\n \"tags\": [\n \"ai\",\n \"customer-support\",\n \"chatbot\"\n ],\n \"templateId\": \"starter\",\n \"lastDeploy\": \"2025-01-01T00:00:00.000Z\",\n \"newEngine\": true\n}")
req, _ := http.NewRequest("PUT", url, payload)
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.put("https://api.runflow.ai/api/v1/runtime/agents/{id}")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Customer Support Bot\",\n \"description\": \"AI-powered customer support agent\",\n \"category\": \"CUSTOMER_SUPPORT\",\n \"subcategory\": \"TIER_1_SUPPORT\",\n \"status\": \"INACTIVE\",\n \"logo\": \"https://example.com/logo.png\",\n \"repositoryUrl\": \"https://github.com/user/agent-repo\",\n \"endpointUrl\": \"https://api.example.com/agent/endpoint\",\n \"code\": \"export function main() { return \\\"Hello World\\\"; }\",\n \"fileTree\": [\n {\n \"name\": \"src\",\n \"type\": \"folder\",\n \"children\": [\n {\n \"name\": \"index.ts\",\n \"type\": \"file\",\n \"content\": \"export function main() { return \\\"Hello World\\\"; }\"\n }\n ]\n }\n ],\n \"language\": \"typescript\",\n \"branch\": \"main\",\n \"commit\": \"abc123def456\",\n \"tags\": [\n \"ai\",\n \"customer-support\",\n \"chatbot\"\n ],\n \"templateId\": \"starter\",\n \"lastDeploy\": \"2025-01-01T00:00:00.000Z\",\n \"newEngine\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.runflow.ai/api/v1/runtime/agents/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Customer Support Bot\",\n \"description\": \"AI-powered customer support agent\",\n \"category\": \"CUSTOMER_SUPPORT\",\n \"subcategory\": \"TIER_1_SUPPORT\",\n \"status\": \"INACTIVE\",\n \"logo\": \"https://example.com/logo.png\",\n \"repositoryUrl\": \"https://github.com/user/agent-repo\",\n \"endpointUrl\": \"https://api.example.com/agent/endpoint\",\n \"code\": \"export function main() { return \\\"Hello World\\\"; }\",\n \"fileTree\": [\n {\n \"name\": \"src\",\n \"type\": \"folder\",\n \"children\": [\n {\n \"name\": \"index.ts\",\n \"type\": \"file\",\n \"content\": \"export function main() { return \\\"Hello World\\\"; }\"\n }\n ]\n }\n ],\n \"language\": \"typescript\",\n \"branch\": \"main\",\n \"commit\": \"abc123def456\",\n \"tags\": [\n \"ai\",\n \"customer-support\",\n \"chatbot\"\n ],\n \"templateId\": \"starter\",\n \"lastDeploy\": \"2025-01-01T00:00:00.000Z\",\n \"newEngine\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Customer Support Bot",
"description": "AI-powered customer support agent",
"category": "CUSTOMER_SUPPORT",
"status": "ACTIVE",
"code": "export function main() { return \"Hello World\"; }",
"language": "typescript",
"branch": "main",
"tags": [
"ai",
"customer-support",
"chatbot"
],
"createdAt": "2025-01-01T00:00:00.000Z",
"updatedAt": "2025-01-01T00:00:00.000Z",
"tenantId": "123e4567-e89b-12d3-a456-426614174000",
"userId": "123e4567-e89b-12d3-a456-426614174000",
"subcategory": "TIER_1_SUPPORT",
"lastDeploy": "2025-01-01T00:00:00.000Z",
"logo": "https://example.com/logo.png",
"repositoryUrl": "https://github.com/user/agent-repo",
"endpointUrl": "https://chatbot.acme.runflow.ai",
"fileTree": [
{
"name": "src",
"type": "folder",
"children": [
{
"name": "index.ts",
"type": "file",
"content": "export function main() { return \"Hello World\"; }"
}
]
}
],
"commit": "abc123def456",
"stagingCommit": "2025-01-01T00-00-00-000Z",
"stagingEndpointUrl": "https://staging.runflow.ai/agent/abc123",
"_count": {
"executions": 15,
"dataSources": 3,
"triggers": 2
},
"repositoryName": "agent-repo",
"scheduleArn": "arn:aws:scheduler:us-east-1:123456789012:schedule/default/my-schedule",
"newEngine": true
}Runtime API - Agents Management
Update agent (CLI/SDK)
Updates an existing agent via CLI/SDK.
PUT
/
api
/
v1
/
runtime
/
agents
/
{id}
Update agent (CLI/SDK)
curl --request PUT \
--url https://api.runflow.ai/api/v1/runtime/agents/{id} \
--header 'Content-Type: application/json' \
--data '
{
"name": "Customer Support Bot",
"description": "AI-powered customer support agent",
"category": "CUSTOMER_SUPPORT",
"subcategory": "TIER_1_SUPPORT",
"status": "INACTIVE",
"logo": "https://example.com/logo.png",
"repositoryUrl": "https://github.com/user/agent-repo",
"endpointUrl": "https://api.example.com/agent/endpoint",
"code": "export function main() { return \"Hello World\"; }",
"fileTree": [
{
"name": "src",
"type": "folder",
"children": [
{
"name": "index.ts",
"type": "file",
"content": "export function main() { return \"Hello World\"; }"
}
]
}
],
"language": "typescript",
"branch": "main",
"commit": "abc123def456",
"tags": [
"ai",
"customer-support",
"chatbot"
],
"templateId": "starter",
"lastDeploy": "2025-01-01T00:00:00.000Z",
"newEngine": true
}
'import requests
url = "https://api.runflow.ai/api/v1/runtime/agents/{id}"
payload = {
"name": "Customer Support Bot",
"description": "AI-powered customer support agent",
"category": "CUSTOMER_SUPPORT",
"subcategory": "TIER_1_SUPPORT",
"status": "INACTIVE",
"logo": "https://example.com/logo.png",
"repositoryUrl": "https://github.com/user/agent-repo",
"endpointUrl": "https://api.example.com/agent/endpoint",
"code": "export function main() { return \"Hello World\"; }",
"fileTree": [
{
"name": "src",
"type": "folder",
"children": [
{
"name": "index.ts",
"type": "file",
"content": "export function main() { return \"Hello World\"; }"
}
]
}
],
"language": "typescript",
"branch": "main",
"commit": "abc123def456",
"tags": ["ai", "customer-support", "chatbot"],
"templateId": "starter",
"lastDeploy": "2025-01-01T00:00:00.000Z",
"newEngine": True
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Customer Support Bot',
description: 'AI-powered customer support agent',
category: 'CUSTOMER_SUPPORT',
subcategory: 'TIER_1_SUPPORT',
status: 'INACTIVE',
logo: 'https://example.com/logo.png',
repositoryUrl: 'https://github.com/user/agent-repo',
endpointUrl: 'https://api.example.com/agent/endpoint',
code: 'export function main() { return "Hello World"; }',
fileTree: [
{
name: 'src',
type: 'folder',
children: [
{
name: 'index.ts',
type: 'file',
content: 'export function main() { return "Hello World"; }'
}
]
}
],
language: 'typescript',
branch: 'main',
commit: 'abc123def456',
tags: ['ai', 'customer-support', 'chatbot'],
templateId: 'starter',
lastDeploy: '2025-01-01T00:00:00.000Z',
newEngine: true
})
};
fetch('https://api.runflow.ai/api/v1/runtime/agents/{id}', 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.runflow.ai/api/v1/runtime/agents/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Customer Support Bot',
'description' => 'AI-powered customer support agent',
'category' => 'CUSTOMER_SUPPORT',
'subcategory' => 'TIER_1_SUPPORT',
'status' => 'INACTIVE',
'logo' => 'https://example.com/logo.png',
'repositoryUrl' => 'https://github.com/user/agent-repo',
'endpointUrl' => 'https://api.example.com/agent/endpoint',
'code' => 'export function main() { return "Hello World"; }',
'fileTree' => [
[
'name' => 'src',
'type' => 'folder',
'children' => [
[
'name' => 'index.ts',
'type' => 'file',
'content' => 'export function main() { return "Hello World"; }'
]
]
]
],
'language' => 'typescript',
'branch' => 'main',
'commit' => 'abc123def456',
'tags' => [
'ai',
'customer-support',
'chatbot'
],
'templateId' => 'starter',
'lastDeploy' => '2025-01-01T00:00:00.000Z',
'newEngine' => true
]),
CURLOPT_HTTPHEADER => [
"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.runflow.ai/api/v1/runtime/agents/{id}"
payload := strings.NewReader("{\n \"name\": \"Customer Support Bot\",\n \"description\": \"AI-powered customer support agent\",\n \"category\": \"CUSTOMER_SUPPORT\",\n \"subcategory\": \"TIER_1_SUPPORT\",\n \"status\": \"INACTIVE\",\n \"logo\": \"https://example.com/logo.png\",\n \"repositoryUrl\": \"https://github.com/user/agent-repo\",\n \"endpointUrl\": \"https://api.example.com/agent/endpoint\",\n \"code\": \"export function main() { return \\\"Hello World\\\"; }\",\n \"fileTree\": [\n {\n \"name\": \"src\",\n \"type\": \"folder\",\n \"children\": [\n {\n \"name\": \"index.ts\",\n \"type\": \"file\",\n \"content\": \"export function main() { return \\\"Hello World\\\"; }\"\n }\n ]\n }\n ],\n \"language\": \"typescript\",\n \"branch\": \"main\",\n \"commit\": \"abc123def456\",\n \"tags\": [\n \"ai\",\n \"customer-support\",\n \"chatbot\"\n ],\n \"templateId\": \"starter\",\n \"lastDeploy\": \"2025-01-01T00:00:00.000Z\",\n \"newEngine\": true\n}")
req, _ := http.NewRequest("PUT", url, payload)
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.put("https://api.runflow.ai/api/v1/runtime/agents/{id}")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Customer Support Bot\",\n \"description\": \"AI-powered customer support agent\",\n \"category\": \"CUSTOMER_SUPPORT\",\n \"subcategory\": \"TIER_1_SUPPORT\",\n \"status\": \"INACTIVE\",\n \"logo\": \"https://example.com/logo.png\",\n \"repositoryUrl\": \"https://github.com/user/agent-repo\",\n \"endpointUrl\": \"https://api.example.com/agent/endpoint\",\n \"code\": \"export function main() { return \\\"Hello World\\\"; }\",\n \"fileTree\": [\n {\n \"name\": \"src\",\n \"type\": \"folder\",\n \"children\": [\n {\n \"name\": \"index.ts\",\n \"type\": \"file\",\n \"content\": \"export function main() { return \\\"Hello World\\\"; }\"\n }\n ]\n }\n ],\n \"language\": \"typescript\",\n \"branch\": \"main\",\n \"commit\": \"abc123def456\",\n \"tags\": [\n \"ai\",\n \"customer-support\",\n \"chatbot\"\n ],\n \"templateId\": \"starter\",\n \"lastDeploy\": \"2025-01-01T00:00:00.000Z\",\n \"newEngine\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.runflow.ai/api/v1/runtime/agents/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Customer Support Bot\",\n \"description\": \"AI-powered customer support agent\",\n \"category\": \"CUSTOMER_SUPPORT\",\n \"subcategory\": \"TIER_1_SUPPORT\",\n \"status\": \"INACTIVE\",\n \"logo\": \"https://example.com/logo.png\",\n \"repositoryUrl\": \"https://github.com/user/agent-repo\",\n \"endpointUrl\": \"https://api.example.com/agent/endpoint\",\n \"code\": \"export function main() { return \\\"Hello World\\\"; }\",\n \"fileTree\": [\n {\n \"name\": \"src\",\n \"type\": \"folder\",\n \"children\": [\n {\n \"name\": \"index.ts\",\n \"type\": \"file\",\n \"content\": \"export function main() { return \\\"Hello World\\\"; }\"\n }\n ]\n }\n ],\n \"language\": \"typescript\",\n \"branch\": \"main\",\n \"commit\": \"abc123def456\",\n \"tags\": [\n \"ai\",\n \"customer-support\",\n \"chatbot\"\n ],\n \"templateId\": \"starter\",\n \"lastDeploy\": \"2025-01-01T00:00:00.000Z\",\n \"newEngine\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Customer Support Bot",
"description": "AI-powered customer support agent",
"category": "CUSTOMER_SUPPORT",
"status": "ACTIVE",
"code": "export function main() { return \"Hello World\"; }",
"language": "typescript",
"branch": "main",
"tags": [
"ai",
"customer-support",
"chatbot"
],
"createdAt": "2025-01-01T00:00:00.000Z",
"updatedAt": "2025-01-01T00:00:00.000Z",
"tenantId": "123e4567-e89b-12d3-a456-426614174000",
"userId": "123e4567-e89b-12d3-a456-426614174000",
"subcategory": "TIER_1_SUPPORT",
"lastDeploy": "2025-01-01T00:00:00.000Z",
"logo": "https://example.com/logo.png",
"repositoryUrl": "https://github.com/user/agent-repo",
"endpointUrl": "https://chatbot.acme.runflow.ai",
"fileTree": [
{
"name": "src",
"type": "folder",
"children": [
{
"name": "index.ts",
"type": "file",
"content": "export function main() { return \"Hello World\"; }"
}
]
}
],
"commit": "abc123def456",
"stagingCommit": "2025-01-01T00-00-00-000Z",
"stagingEndpointUrl": "https://staging.runflow.ai/agent/abc123",
"_count": {
"executions": 15,
"dataSources": 3,
"triggers": 2
},
"repositoryName": "agent-repo",
"scheduleArn": "arn:aws:scheduler:us-east-1:123456789012:schedule/default/my-schedule",
"newEngine": true
}Body
application/json
Agent subcategory for more specific classification
Available options:
SDR_OUTBOUND, SDR_INBOUND, ACCOUNT_MANAGER, SALES_CLOSER, LEAD_QUALIFIER, TIER_1_SUPPORT, TECHNICAL_SUPPORT, ESCALATION_HANDLER, CHAT_SUPPORT, COLD_CALLING, CUSTOMER_SERVICE_VOICE, APPOINTMENT_SETTER, SURVEY_CALLER, DATA_PROCESSOR, WORKFLOW_AUTOMATOR, QUALITY_CHECKER, REPORT_GENERATOR, FRAUD_DETECTOR, RISK_ASSESSOR, COMPLIANCE_MONITOR, DEBT_COLLECTOR, PAYMENT_NEGOTIATOR, RECOVERY_SPECIALIST, CONTENT_CREATOR, CAMPAIGN_MANAGER, SOCIAL_MEDIA_MANAGER, EMAIL_MARKETER, DATA_ANALYST, PERFORMANCE_TRACKER, INSIGHT_GENERATOR, DASHBOARD_CREATOR Example:
"TIER_1_SUPPORT"
Response
200 - application/json
Agent updated successfully.
Agent subcategory for more specific classification
Available options:
SDR_OUTBOUND, SDR_INBOUND, ACCOUNT_MANAGER, SALES_CLOSER, LEAD_QUALIFIER, TIER_1_SUPPORT, TECHNICAL_SUPPORT, ESCALATION_HANDLER, CHAT_SUPPORT, COLD_CALLING, CUSTOMER_SERVICE_VOICE, APPOINTMENT_SETTER, SURVEY_CALLER, DATA_PROCESSOR, WORKFLOW_AUTOMATOR, QUALITY_CHECKER, REPORT_GENERATOR, FRAUD_DETECTOR, RISK_ASSESSOR, COMPLIANCE_MONITOR, DEBT_COLLECTOR, PAYMENT_NEGOTIATOR, RECOVERY_SPECIALIST, CONTENT_CREATOR, CAMPAIGN_MANAGER, SOCIAL_MEDIA_MANAGER, EMAIL_MARKETER, DATA_ANALYST, PERFORMANCE_TRACKER, INSIGHT_GENERATOR, DASHBOARD_CREATOR Example:
"TIER_1_SUPPORT"