Create an agent
Creates an agent. For normal user-created custom agents, set connectionProvider to native. Use claudeManaged only when the user explicitly asks for Anthropic/Claude Managed, cursorCloud only for Cursor Cloud, and selfHosted only for external wrappers/webhooks. Native custom-agent instructions and workspace skills are configured through the native settings endpoint.
POST
/agentsAuthorization
AuthorizationOAuth2 access token · headerrequiredScopes:
api:writeor
AuthorizationBearer token (JWT) · headerrequiredQuery 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 to initialize. Use native for normal user-created 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:
selfHostedclaudeManagedcursorCloudgeminiManagedgeminiAgentRuntimenativenamestringrequiredAgent display name.
nativeConfigobjectOptional native custom-agent config for connectionProvider=native. Instructions and selected workspace skills can also be configured later through /agents/{id}/native.
roleIdstringRole id to assign. Defaults to the workspace Agent role.
Responses
201
401Unauthorized - Invalid or missing authentication token
403Forbidden - Insufficient API scopes or permissions
Request
curl -X POST "https://leadtime.app/api/public/agents" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"avatarConfig": {},
"connectionProvider": "selfHosted",
"name": "Company Manager",
"nativeConfig": {},
"roleId": "string"
}'const response = await fetch("https://leadtime.app/api/public/agents", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"avatarConfig": {},
"connectionProvider": "selfHosted",
"name": "Company Manager",
"nativeConfig": {},
"roleId": "string"
})
});import requests
response = requests.post(
"https://leadtime.app/api/public/agents",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
json={
"avatarConfig": {},
"connectionProvider": "selfHosted",
"name": "Company Manager",
"nativeConfig": {},
"roleId": "string"
},
)Response
No example response.
Unauthorized - Invalid or missing authentication token
Forbidden - Insufficient API scopes or permissions