Save Claude Managed Agent settings for an agent
Saves Claude Managed settings. Prefer providerApiKeyId from /agents/provider-api-keys when a saved Anthropic key exists. Put Leadtime-managed model, editor-field instructions, and custom MCP servers under config.managedAgent. Instructions are a standard Leadtime editor field: send HTML, Markdown, or ProseMirror IDoc JSON, and Leadtime converts it to internal IDoc before syncing HTML to Claude. Put GitHub repository defaults under config.githubRepositoryDefaults. Use config.toolMode=basic by default when the agent only needs task context, comments, and status updates while doing external work or analysis. Use config.toolMode=full only when the agent is meant to perform broad Leadtime workspace actions such as creating or editing projects, tasks, organizations, contacts, forms, planning data, settings, or other company-management records. Re-read this endpoint after saving to verify the selected model, tool mode, MCP servers, and repositories.
/agents/{id}/claudeAuthorizationOAuth2 access token · headerrequiredapi:writeAuthorizationBearer token (JWT) · headerrequiredidstringrequiredfieldsToReturnstringresponseShapestringcompactfullLT-Response-Shapestringfullapplication/jsonanthropicApiKeystring | nullconfigobjectShow propertiesHide properties
agentIdstring | nullagentSourcestringleadtimeManagedexistingallowNetworkAccessbooleancustomGuidancestring | nullenvironmentIdstring | nullexposeRawApiCredentialToAgentbooleangithubRepositoryDefaultsClaudeManagedGithubRepositoryDto[]Show propertiesHide properties
ClaudeManagedGithubRepositoryDtocloneUrlstring | nullrequiredfullNamestringrequiredidnumberrequirednamestringrequiredprivatebooleanrequiredurlstringrequiredmanagedAgentobjectShow propertiesHide properties
instructionsstring | objectShow propertiesHide properties
stringobjectmcpServersClaudeManagedMcpServerDto[]Show propertiesHide properties
ClaudeManagedMcpServerDtoauthModestringnonebeareroauthbearerTokenstring | nullcredentialConfiguredbooleanidstringnamestringoauthCredentialobject | nullShow propertiesHide properties
accessTokenstring | nullclientIdstring | nullclientSecretstring | nullexpiresAtstring | nullrefreshTokenstring | nullscopestring | nulltokenEndpointstring | nulltokenEndpointAuthTypestring | nullnoneclient_secret_basicclient_secret_posturlstringrequiredmodelIdstringskillsClaudeManagedSkillRefDto[]Show propertiesHide properties
ClaudeManagedSkillRefDtoskillIdstringrequiredtypestringrequiredanthropiccustomversionstring | nulltoolModestringbasicfulluserVaultIdsstring[]enabledbooleanproviderApiKeyIdstring | nullcurl -X POST "https://leadtime.app/api/public/agents/string/claude" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"anthropicApiKey": "string",
"config": {
"agentId": "string",
"agentSource": "leadtimeManaged",
"allowNetworkAccess": true,
"customGuidance": "string",
"environmentId": "string",
"exposeRawApiCredentialToAgent": true,
"githubRepositoryDefaults": [
{
"cloneUrl": "string",
"fullName": "string",
"id": 0,
"name": "string",
"private": true,
"url": "string"
}
],
"managedAgent": {
"instructions": "string",
"mcpServers": [
{
"authMode": "none",
"bearerToken": "string",
"credentialConfigured": true,
"id": "string",
"name": "string",
"oauthCredential": {
"accessToken": "string",
"clientId": "string",
"clientSecret": "string",
"expiresAt": "string",
"refreshToken": "string",
"scope": "string",
"tokenEndpoint": "string",
"tokenEndpointAuthType": "none"
},
"url": "string"
}
],
"modelId": "claude-sonnet-4-6",
"skills": [
{
"skillId": "string",
"type": "anthropic",
"version": "string"
}
]
},
"toolMode": "basic",
"userVaultIds": [
"string"
]
},
"enabled": true,
"providerApiKeyId": "string"
}'const response = await fetch("https://leadtime.app/api/public/agents/string/claude", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"anthropicApiKey": "string",
"config": {
"agentId": "string",
"agentSource": "leadtimeManaged",
"allowNetworkAccess": true,
"customGuidance": "string",
"environmentId": "string",
"exposeRawApiCredentialToAgent": true,
"githubRepositoryDefaults": [
{
"cloneUrl": "string",
"fullName": "string",
"id": 0,
"name": "string",
"private": true,
"url": "string"
}
],
"managedAgent": {
"instructions": "string",
"mcpServers": [
{
"authMode": "none",
"bearerToken": "string",
"credentialConfigured": true,
"id": "string",
"name": "string",
"oauthCredential": {
"accessToken": "string",
"clientId": "string",
"clientSecret": "string",
"expiresAt": "string",
"refreshToken": "string",
"scope": "string",
"tokenEndpoint": "string",
"tokenEndpointAuthType": "none"
},
"url": "string"
}
],
"modelId": "claude-sonnet-4-6",
"skills": [
{
"skillId": "string",
"type": "anthropic",
"version": "string"
}
]
},
"toolMode": "basic",
"userVaultIds": [
"string"
]
},
"enabled": true,
"providerApiKeyId": "string"
})
});import requests
response = requests.post(
"https://leadtime.app/api/public/agents/string/claude",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
json={
"anthropicApiKey": "string",
"config": {
"agentId": "string",
"agentSource": "leadtimeManaged",
"allowNetworkAccess": True,
"customGuidance": "string",
"environmentId": "string",
"exposeRawApiCredentialToAgent": True,
"githubRepositoryDefaults": [
{
"cloneUrl": "string",
"fullName": "string",
"id": 0,
"name": "string",
"private": True,
"url": "string"
}
],
"managedAgent": {
"instructions": "string",
"mcpServers": [
{
"authMode": "none",
"bearerToken": "string",
"credentialConfigured": True,
"id": "string",
"name": "string",
"oauthCredential": {
"accessToken": "string",
"clientId": "string",
"clientSecret": "string",
"expiresAt": "string",
"refreshToken": "string",
"scope": "string",
"tokenEndpoint": "string",
"tokenEndpointAuthType": "none"
},
"url": "string"
}
],
"modelId": "claude-sonnet-4-6",
"skills": [
{
"skillId": "string",
"type": "anthropic",
"version": "string"
}
]
},
"toolMode": "basic",
"userVaultIds": [
"string"
]
},
"enabled": True,
"providerApiKeyId": "string"
},
)