Skip to main content
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
}

Path Parameters

id
string
required

Agent UUID

Body

application/json
name
string

Agent name

Required string length: 2 - 100
Example:

"Customer Support Bot"

description
string

Agent description

Required string length: 10 - 500
Example:

"AI-powered customer support agent"

category
enum<string>

Agent category

Available options:
SALES,
CUSTOMER_SUPPORT,
VOICE,
OPERATIONS,
FINANCIAL_PREVENTION,
FINANCIAL_RECOVERY,
MARKETING,
ANALYTICS
Example:

"CUSTOMER_SUPPORT"

subcategory
enum<string>

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"

status
enum<string>
default:INACTIVE

Agent status

Available options:
ACTIVE,
INACTIVE,
ERROR,
DEPLOYING
Example:

"INACTIVE"

Agent logo URL

Maximum string length: 500
Example:

"https://example.com/logo.png"

repositoryUrl
string

Repository URL

Maximum string length: 500
Example:

"https://github.com/user/agent-repo"

endpointUrl
string

Agent endpoint URL

Maximum string length: 500
Example:

"https://api.example.com/agent/endpoint"

code
string

Agent source code

Example:

"export function main() { return \"Hello World\"; }"

fileTree
object

File tree structure for IDE-like interface

Example:
[
{
"name": "src",
"type": "folder",
"children": [
{
"name": "index.ts",
"type": "file",
"content": "export function main() { return \"Hello World\"; }"
}
]
}
]
language
string
default:typescript

Programming language

Maximum string length: 50
Example:

"typescript"

branch
string
default:main

Git branch

Maximum string length: 100
Example:

"main"

commit
string

Git commit hash

Maximum string length: 100
Example:

"abc123def456"

tags
string[]

Agent tags

Example:
["ai", "customer-support", "chatbot"]
templateId
enum<string>

Template ID for project initialization (from /public/templates)

Available options:
starter,
rag-agent,
webhook-handler
Maximum string length: 50
Example:

"starter"

lastDeploy
string<date-time>

Last deployment timestamp

Example:

"2025-01-01T00:00:00.000Z"

newEngine
boolean

Use new executor-engine (Go) instead of legacy execution-engine (NestJS)

Example:

true

Response

200 - application/json

Agent updated successfully.

id
string
required

Agent unique identifier

Example:

"123e4567-e89b-12d3-a456-426614174000"

name
string
required

Agent name

Example:

"Customer Support Bot"

description
string
required

Agent description

Example:

"AI-powered customer support agent"

category
enum<string>
required

Agent category

Available options:
SALES,
CUSTOMER_SUPPORT,
VOICE,
OPERATIONS,
FINANCIAL_PREVENTION,
FINANCIAL_RECOVERY,
MARKETING,
ANALYTICS
Example:

"CUSTOMER_SUPPORT"

status
enum<string>
required

Agent status

Available options:
ACTIVE,
INACTIVE,
ERROR,
DEPLOYING
Example:

"ACTIVE"

code
string
required

Agent source code

Example:

"export function main() { return \"Hello World\"; }"

language
string
required

Programming language

Example:

"typescript"

branch
string
required

Git branch

Example:

"main"

tags
string[]
required

Agent tags

Example:
["ai", "customer-support", "chatbot"]
createdAt
string<date-time>
required

Creation timestamp

Example:

"2025-01-01T00:00:00.000Z"

updatedAt
string<date-time>
required

Last update timestamp

Example:

"2025-01-01T00:00:00.000Z"

tenantId
string
required

Tenant ID that the agent belongs to

Example:

"123e4567-e89b-12d3-a456-426614174000"

userId
string
required

User ID that owns the agent

Example:

"123e4567-e89b-12d3-a456-426614174000"

subcategory
enum<string>

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"

lastDeploy
string<date-time>

Last deployment timestamp

Example:

"2025-01-01T00:00:00.000Z"

Agent logo URL

Example:

"https://example.com/logo.png"

repositoryUrl
string

Repository URL

Example:

"https://github.com/user/agent-repo"

endpointUrl
string

Agent endpoint URL (populated by provisioning service)

Example:

"https://chatbot.acme.runflow.ai"

fileTree
object

File tree structure for IDE-like interface

Example:
[
{
"name": "src",
"type": "folder",
"children": [
{
"name": "index.ts",
"type": "file",
"content": "export function main() { return \"Hello World\"; }"
}
]
}
]
commit
string

Git commit hash

Example:

"abc123def456"

stagingCommit
string

Staging commit hash (latest deploy to staging)

Example:

"2025-01-01T00-00-00-000Z"

stagingEndpointUrl
string

Staging endpoint URL

Example:

"https://staging.runflow.ai/agent/abc123"

_count
object

Agent related statistics

Example:
{
"executions": 15,
"dataSources": 3,
"triggers": 2
}
repositoryName
string

Repository name

Example:

"agent-repo"

scheduleArn
string

AWS Scheduler ARN

Example:

"arn:aws:scheduler:us-east-1:123456789012:schedule/default/my-schedule"

newEngine
boolean

Use new executor-engine (Go) instead of legacy execution-engine (NestJS)

Example:

true