Zum Inhalt springen
Leadtime
Deutsch
Esc
navigateopen⌘Jpreview

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/agents
Authorization
AuthorizationOAuth2 access token · headerrequired
Scopes:api:write
or
AuthorizationBearer token (JWT) · headerrequired
Query parameters
fieldsToReturnstring
Comma-separated list of top-level response fields to return. Overrides the endpoint compact default unless responseShape=full is used.
responseShapestring
Advanced 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:compactfull
Header parameters
LT-Response-Shapestring
Advanced override. Set to full only when you need the complete endpoint response, including nested fields that are not selectable with fieldsToReturn.
Allowed:full
Request body
requiredapplication/json
avatarConfigobject
Generated avatar configuration JSON.
connectionProviderstring
Optional 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:selfHostedclaudeManagedcursorCloudgeminiManagedgeminiAgentRuntimenative
namestringrequired
Agent display name.
nativeConfigobject
Optional native custom-agent config for connectionProvider=native. Instructions and selected workspace skills can also be configured later through /agents/{id}/native.
roleIdstring
Role 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"
}'
Response
No example response.