Update automation
Updates an existing automation. Executor may remain the existing human executor. This PUT expects the full automation payload again (including title, executorUserId, and triggers). For event triggers, matching filters must be stored in triggers[].definition.filters, not executionConfig. userPrompt accepts HTML or Markdown (automation prompt format: basic nodes, mentions, images; no files or videos).
PUT
/automations/{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/jsonexecutionConfigobjectrequiredExecution config (agent-specific or workflow metadata). Not used for trigger matching filters; event trigger filters belong in `triggers[].definition.filters`.
executionTypestringrequiredExecution type (agent or workflow). Currently only agent is supported.
Allowed:
agentworkflowexecutorUserIdstringrequiredUser id of the executing agent. Must be a bot/agent user — automations always execute as an agent, never as a human user.
isEnabledbooleanWhether the automation is enabled
scopestringrequiredScope (personal or workspace). Personal requires managePersonalAutomations; workspace requires manageWorkspaceAutomations.
Allowed:
personalworkspacetitlestringrequiredAutomation title
triggersAutomationTriggerDto[]requiredTriggers (daily, weekly, monthly, customCron, webhook, organizationCreated, projectCreated, taskCreated, objectCreated, slackMessageInPublicChannel, slackReactionAdded). At least one required. For webhook, POST JSON to {WORKC_URL}/api/automations/webhooks/{webhookSecret} (no auth). For slackMessageInPublicChannel, see definition.channelId (Slack public channel ID) and optional text filters in AutomationTriggerDto. For slackReactionAdded, see definition.emojiName and optional definition.channelId. For event triggers, filters belong inside `triggers[].definition.filters`, not `executionConfig`.
Show propertiesHide properties
Array of
AutomationTriggerDtodefinitionobjectPer-trigger settings. **slackMessageInPublicChannel** — required `channelId`: Slack **public channel ID** (`C…`), not the human-readable name. Optional `textPattern` (message must contain this substring, case-insensitive) and `useRegex` (if true, `textPattern` is a JavaScript regex). Example: `{"channelId":"C012ABCDE","textPattern":"bug","useRegex":false}`. **slackReactionAdded** — required `emojiName`: Slack emoji short name. Colons and common pasted/natural forms are accepted and normalized (`eyes`, `:eyes:`, `+1`, `:+1:`, `thumbsup`, `thumbs up`). Optional `channelId` limits the trigger to one channel. Example: `{"emojiName":":+1:","channelId":"C012ABCDE"}`. On run, the agent receives `triggerEventPayload.slack`: `channelId`, `channelType`, `userId`, `text`, `ts`, `threadTs` — use with Slack integration tools to reply in-thread (`threadTs ?? ts`) and add/remove reactions on `ts`. **organizationCreated / projectCreated / taskCreated / objectCreated** — optional `filters` (FilterStripModel). Field names and `value` shapes must match the **list grid** for that entity: use `action-details` on **`GET /tasks/grid`** for `taskCreated`, **`GET /projects`** for `projectCreated`, **`GET /organizations`** for `organizationCreated`, internal **`GET …/objects/grid`** for `objectCreated` (not interchangeable). For event triggers, `definition.filters` must be a full FilterStripModel object such as `{"quickSearch":"","filters":[...]}`. **Schedules** — timeOfDay (HH:mm), weekday (0-6), dayOfMonth (1-31), cronExpression (customCron). **webhook** — no required fields.
isEnabledbooleanWhether the trigger is enabled
sortOrdernumberSort order for multiple triggers
typestringrequiredTrigger variant: daily, weekly, monthly, customCron, webhook, organizationCreated, projectCreated, taskCreated, objectCreated, slackMessageInPublicChannel, or slackReactionAdded. slackMessageInPublicChannel fires on new messages in a monitored **public** Slack channel; the workspace must have Slack connected and the agent must be in that channel.
Allowed:
dailyweeklymonthlycustomCronwebhookorganizationCreatedprojectCreatedtaskCreatedobjectCreatedslackMessageInPublicChannelslackReactionAddeduserPromptobject | nullrequiredUser prompt for agent (HTML or Markdown). Automation prompt format: basic nodes, mentions, images; no files or videos.
Responses
200
createdAtstring<date-time>requiredCreation timestamp
createdBystringrequiredCreator user ID
executionConfigobjectrequiredExecution config
executionTypestringrequiredExecution type
Allowed:
agentworkflowexecutorUserIdstringrequiredExecutor user ID
idstringrequiredAutomation ID
isEnabledbooleanrequiredWhether automation is enabled
ownerUserIdobject | nullrequiredOwner user ID (for personal scope)
scopestringrequiredScope
Allowed:
personalworkspacetitlestringrequiredAutomation title
triggersobject[]requiredTriggers. For type webhook, webhookSecret is present after save; use POST {base}/api/automations/webhooks/{webhookSecret} to run. For type slackMessageInPublicChannel, definition contains channelId (Slack C…) and optional textPattern/useRegex. For type slackReactionAdded, definition contains emojiName and optional channelId.
Show propertiesHide properties
Array of
objectdefinitionobjectidstringisEnabledbooleansortOrdernumbertypestringAllowed:
dailyweeklymonthlycustomCronwebhookorganizationCreatedprojectCreatedtaskCreatedobjectCreatedslackMessageInPublicChannelslackReactionAddedwebhookSecretstring | nullOnly for webhook triggers. Present after save. Inbound webhook: POST {base}/api/automations/webhooks/{webhookSecret} with Content-Type: application/json. No auth; secret authenticates. Request body is passed to the agent as context.
updatedAtstring<date-time>requiredLast update timestamp
updatedByobject | nullrequiredLast updater user ID
userPromptobject | nullrequiredUser prompt for agent (HTML, automation prompt format: basic nodes, mentions, images; no files or videos)
workspaceIdstringrequiredWorkspace ID
401Unauthorized - Invalid or missing authentication token
403Forbidden - Insufficient API scopes or permissions
Request
curl -X PUT "https://leadtime.app/api/public/automations/string" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"executionConfig": {},
"executionType": "agent",
"executorUserId": "123e4567-e89b-12d3-a456-426614174000",
"isEnabled": true,
"scope": "personal",
"title": "Daily standup reminder",
"triggers": [
{
"definition": {
"channelId": "C012ABCDE",
"textPattern": "bug",
"useRegex": false
},
"isEnabled": true,
"sortOrder": 0,
"type": "daily"
}
],
"userPrompt": "<p>Summarize yesterday progress</p>"
}'const response = await fetch("https://leadtime.app/api/public/automations/string", {
method: "PUT",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"executionConfig": {},
"executionType": "agent",
"executorUserId": "123e4567-e89b-12d3-a456-426614174000",
"isEnabled": true,
"scope": "personal",
"title": "Daily standup reminder",
"triggers": [
{
"definition": {
"channelId": "C012ABCDE",
"textPattern": "bug",
"useRegex": false
},
"isEnabled": true,
"sortOrder": 0,
"type": "daily"
}
],
"userPrompt": "<p>Summarize yesterday progress</p>"
})
});import requests
response = requests.put(
"https://leadtime.app/api/public/automations/string",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
json={
"executionConfig": {},
"executionType": "agent",
"executorUserId": "123e4567-e89b-12d3-a456-426614174000",
"isEnabled": True,
"scope": "personal",
"title": "Daily standup reminder",
"triggers": [
{
"definition": {
"channelId": "C012ABCDE",
"textPattern": "bug",
"useRegex": False
},
"isEnabled": True,
"sortOrder": 0,
"type": "daily"
}
],
"userPrompt": "<p>Summarize yesterday progress</p>"
},
)Response
{
"createdAt": "2024-01-01T00:00:00Z",
"createdBy": "string",
"executionConfig": {},
"executionType": "agent",
"executorUserId": "string",
"id": "string",
"isEnabled": true,
"ownerUserId": {},
"scope": "personal",
"title": "string",
"triggers": [
{
"definition": {},
"id": "string",
"isEnabled": true,
"sortOrder": 0,
"type": "daily",
"webhookSecret": "string"
}
],
"updatedAt": "2024-01-01T00:00:00Z",
"updatedBy": {},
"userPrompt": {},
"workspaceId": "string"
}Unauthorized - Invalid or missing authentication token
Forbidden - Insufficient API scopes or permissions