Update Agent State
curl --request PUT \
--url https://{controlPlaneURL}/api/svc/v1/agents/{id}/state \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"state": "active"
}
'import requests
url = "https://{controlPlaneURL}/api/svc/v1/agents/{id}/state"
payload = { "state": "active" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({state: 'active'})
};
fetch('https://{controlPlaneURL}/api/svc/v1/agents/{id}/state', 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://{controlPlaneURL}/api/svc/v1/agents/{id}/state",
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([
'state' => 'active'
]),
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://{controlPlaneURL}/api/svc/v1/agents/{id}/state"
payload := strings.NewReader("{\n \"state\": \"active\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://{controlPlaneURL}/api/svc/v1/agents/{id}/state")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"state\": \"active\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{controlPlaneURL}/api/svc/v1/agents/{id}/state")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"state\": \"active\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"name": "<string>",
"fqn": "<string>",
"tenantName": "<string>",
"accountId": "<string>",
"latestVersion": 123,
"type": "<string>",
"source": "truefoundry",
"controlMode": "governed",
"state": "active",
"createdBySubject": {
"subjectId": "<string>",
"subjectType": "user",
"subjectSlug": "<string>",
"subjectDisplayName": "<string>",
"subjectPatName": "<string>",
"subjectControllerName": "<string>",
"subjectExternalIdentitySlug": "<string>"
},
"id": "jqfwg345gi25n5ju2yz5iz6m",
"providerIntegrationId": "<string>",
"latestVersionDetails": {
"agentId": "<string>",
"fqn": "<string>",
"manifest": {
"type": "truefoundry-agent",
"name": "<string>",
"description": "<string>",
"model": {
"name": "<string>",
"params": {
"max_tokens": 1,
"reasoning_effort": "<string>",
"temperature": 1,
"top_p": 0.5,
"top_k": 1,
"parallel_tool_calls": true
}
},
"tags": {},
"skills": [
{
"type": "truefoundry-skills-registry",
"fqn": "<string>",
"preload": false
}
],
"mcp_servers": [
{
"type": "truefoundry-mcp-registry",
"name": "<string>",
"preload": false,
"enable_tools": [
"@all"
],
"disable_tools": [
"<string>"
],
"preload_tools": [
"<string>"
],
"require_approval_for_tools": [
"@write",
"@destructive"
]
}
],
"instructions": "<string>",
"messages": [
{
"type": "user.message",
"content": "<string>"
}
],
"variables": {},
"sample_inputs": [
{
"text": "<string>",
"variables": {}
}
],
"response_format": {
"type": "text"
},
"config": {
"iteration_limit": 100,
"sandbox": {
"enabled": true,
"file_downloads": true,
"network_policy": {
"auth_inject": [
{
"type": "git",
"match": {
"hosts": [
"<string>"
]
},
"auth_data": {
"type": "basic",
"username": "<string>",
"password": "<string>"
}
}
]
}
},
"dynamic_sub_agents": {
"enabled": true
},
"context_management": {
"compaction": {
"enabled": true,
"compaction_threshold_tokens": 50000
},
"large_tool_response": {
"enabled": true
}
},
"generative_ui": {
"enabled": true
},
"ask_user_questions": {
"enabled": true
}
},
"collaborators": [
{
"subject": "<string>",
"role_id": "<string>"
}
],
"ownedBy": {
"account": "<string>"
}
},
"version": 123,
"id": "jqfwg345gi25n5ju2yz5iz6m",
"metadata": {
"promptVariables": {}
},
"createdBySubject": {
"subjectId": "<string>",
"subjectType": "user",
"subjectSlug": "<string>",
"subjectDisplayName": "<string>",
"subjectPatName": "<string>",
"subjectControllerName": "<string>",
"subjectExternalIdentitySlug": "<string>"
}
},
"manifest": {},
"metadata": {},
"agentIdentityId": "<string>",
"jwtId": "<string>",
"jwts": [
{
"id": "<string>",
"subjectType": "<string>",
"subjectId": "<string>",
"expiry": "2023-11-07T05:31:56Z",
"tokenType": "jwt",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"metadata": {},
"lastAccessedAt": "2023-11-07T05:31:56Z"
}
],
"createdBy": "<string>"
}
}{
"statusCode": 123,
"message": "<string>",
"code": 123,
"details": [
{}
]
}{
"statusCode": 123,
"message": "<string>",
"code": 123,
"details": [
{}
]
}{
"statusCode": 123,
"message": "<string>",
"code": 123,
"details": [
{}
]
}{
"statusCode": 123,
"message": "<string>",
"code": 123,
"details": [
{}
]
}{
"statusCode": 123,
"message": "<string>",
"code": 123,
"details": [
{}
]
}Agent
Update Agent State
Update state for an agent (state: active or blocked).
PUT
/
api
/
svc
/
v1
/
agents
/
{id}
/
state
Update Agent State
curl --request PUT \
--url https://{controlPlaneURL}/api/svc/v1/agents/{id}/state \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"state": "active"
}
'import requests
url = "https://{controlPlaneURL}/api/svc/v1/agents/{id}/state"
payload = { "state": "active" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({state: 'active'})
};
fetch('https://{controlPlaneURL}/api/svc/v1/agents/{id}/state', 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://{controlPlaneURL}/api/svc/v1/agents/{id}/state",
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([
'state' => 'active'
]),
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://{controlPlaneURL}/api/svc/v1/agents/{id}/state"
payload := strings.NewReader("{\n \"state\": \"active\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://{controlPlaneURL}/api/svc/v1/agents/{id}/state")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"state\": \"active\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{controlPlaneURL}/api/svc/v1/agents/{id}/state")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"state\": \"active\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"name": "<string>",
"fqn": "<string>",
"tenantName": "<string>",
"accountId": "<string>",
"latestVersion": 123,
"type": "<string>",
"source": "truefoundry",
"controlMode": "governed",
"state": "active",
"createdBySubject": {
"subjectId": "<string>",
"subjectType": "user",
"subjectSlug": "<string>",
"subjectDisplayName": "<string>",
"subjectPatName": "<string>",
"subjectControllerName": "<string>",
"subjectExternalIdentitySlug": "<string>"
},
"id": "jqfwg345gi25n5ju2yz5iz6m",
"providerIntegrationId": "<string>",
"latestVersionDetails": {
"agentId": "<string>",
"fqn": "<string>",
"manifest": {
"type": "truefoundry-agent",
"name": "<string>",
"description": "<string>",
"model": {
"name": "<string>",
"params": {
"max_tokens": 1,
"reasoning_effort": "<string>",
"temperature": 1,
"top_p": 0.5,
"top_k": 1,
"parallel_tool_calls": true
}
},
"tags": {},
"skills": [
{
"type": "truefoundry-skills-registry",
"fqn": "<string>",
"preload": false
}
],
"mcp_servers": [
{
"type": "truefoundry-mcp-registry",
"name": "<string>",
"preload": false,
"enable_tools": [
"@all"
],
"disable_tools": [
"<string>"
],
"preload_tools": [
"<string>"
],
"require_approval_for_tools": [
"@write",
"@destructive"
]
}
],
"instructions": "<string>",
"messages": [
{
"type": "user.message",
"content": "<string>"
}
],
"variables": {},
"sample_inputs": [
{
"text": "<string>",
"variables": {}
}
],
"response_format": {
"type": "text"
},
"config": {
"iteration_limit": 100,
"sandbox": {
"enabled": true,
"file_downloads": true,
"network_policy": {
"auth_inject": [
{
"type": "git",
"match": {
"hosts": [
"<string>"
]
},
"auth_data": {
"type": "basic",
"username": "<string>",
"password": "<string>"
}
}
]
}
},
"dynamic_sub_agents": {
"enabled": true
},
"context_management": {
"compaction": {
"enabled": true,
"compaction_threshold_tokens": 50000
},
"large_tool_response": {
"enabled": true
}
},
"generative_ui": {
"enabled": true
},
"ask_user_questions": {
"enabled": true
}
},
"collaborators": [
{
"subject": "<string>",
"role_id": "<string>"
}
],
"ownedBy": {
"account": "<string>"
}
},
"version": 123,
"id": "jqfwg345gi25n5ju2yz5iz6m",
"metadata": {
"promptVariables": {}
},
"createdBySubject": {
"subjectId": "<string>",
"subjectType": "user",
"subjectSlug": "<string>",
"subjectDisplayName": "<string>",
"subjectPatName": "<string>",
"subjectControllerName": "<string>",
"subjectExternalIdentitySlug": "<string>"
}
},
"manifest": {},
"metadata": {},
"agentIdentityId": "<string>",
"jwtId": "<string>",
"jwts": [
{
"id": "<string>",
"subjectType": "<string>",
"subjectId": "<string>",
"expiry": "2023-11-07T05:31:56Z",
"tokenType": "jwt",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"metadata": {},
"lastAccessedAt": "2023-11-07T05:31:56Z"
}
],
"createdBy": "<string>"
}
}{
"statusCode": 123,
"message": "<string>",
"code": 123,
"details": [
{}
]
}{
"statusCode": 123,
"message": "<string>",
"code": 123,
"details": [
{}
]
}{
"statusCode": 123,
"message": "<string>",
"code": 123,
"details": [
{}
]
}{
"statusCode": 123,
"message": "<string>",
"code": 123,
"details": [
{}
]
}{
"statusCode": 123,
"message": "<string>",
"code": 123,
"details": [
{}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
System-generated agent ID.
Example:
"jqfwg345gi25n5ju2yz5iz6m"
Body
application/json
Lifecycle state of the agent.
Available options:
active, blocked Example:
"active"
Response
Agent updated successfully
Agent
Show child attributes
Show child attributes
Was this page helpful?