Update an agent
Updates an agent. For normal custom agents, keep or set connectionProvider to native. Do not switch a native custom agent to claudeManaged unless the user explicitly asks for Anthropic/Claude Managed.
PATCH
/agents/{id}Authorization
AuthorizationOAuth2 access token · headerrequiredScopes:
api:writeor
AuthorizationBearer token (JWT) · headerrequiredPath parameters
idstringrequiredQuery parameters
fieldsToReturnstringComma-separated list of top-level response fields to return. Overrides the endpoint compact default unless responseShape=full is used.
responseShapestringAdvanced override. Omit for the endpoint compact default. Use full only when you need the complete endpoint response, including nested fields that are not selectable with fieldsToReturn.
Allowed:
compactfullHeader parameters
LT-Response-ShapestringAdvanced override. Set to full only when you need the complete endpoint response, including nested fields that are not selectable with fieldsToReturn.
Allowed:
fullRequest body
requiredapplication/jsonavatarConfigobjectGenerated avatar configuration JSON.
connectionProviderstringOptional agent connection provider. Keep or set native for normal custom agents running on Leadtime internal agent engine. Use selfHosted for external wrappers/webhooks, cursorCloud for Cursor Cloud, and claudeManaged only for explicit Anthropic/Claude Managed requests.
Allowed:
selfHostedclaudeManagedcursorCloudgeminiManagedgeminiAgentRuntimenativenamestringAgent display name. Omit to keep the current name.
nativeConfigobjectOptional native custom-agent config for connectionProvider=native. Instructions and selected workspace skills can also be configured later through /agents/{id}/native.
removeAvatarbooleanWhen true, removes the agent avatar image.
roleIdstringRole id to assign. Omit to keep the current role.
Responses
200
401Unauthorized - Invalid or missing authentication token
403Forbidden - Insufficient API scopes or permissions
Request
curl -X PATCH "https://leadtime.app/api/public/agents/string" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"avatarConfig": {},
"connectionProvider": "selfHosted",
"name": "Company Manager",
"nativeConfig": {},
"removeAvatar": true,
"roleId": "string"
}'const response = await fetch("https://leadtime.app/api/public/agents/string", {
method: "PATCH",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"avatarConfig": {},
"connectionProvider": "selfHosted",
"name": "Company Manager",
"nativeConfig": {},
"removeAvatar": true,
"roleId": "string"
})
});import requests
response = requests.patch(
"https://leadtime.app/api/public/agents/string",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
json={
"avatarConfig": {},
"connectionProvider": "selfHosted",
"name": "Company Manager",
"nativeConfig": {},
"removeAvatar": True,
"roleId": "string"
},
)Response
No example response.
Unauthorized - Invalid or missing authentication token
Forbidden - Insufficient API scopes or permissions