Automations

Update Automation

Update Automation

Body (JSON):

{
 "name": "Updated Marketing Analysis",
 "description": "Enhanced automation with schedule and new assistant type",
 "isActive": true,
 "runType": "schedule",
 "schedule": {
 "timePeriod": "last7days",
 "repeatAt": "09:30"
 },
 "trigger": {
 "type": "folders",
 "folderIds": ["folder123", "folder456"]
 },
 "action": {
 "type": "magic-prompt",
 "magicPrompt": {
 "title": "Weekly Marketing Report",
 "assistantType": "marketer",
 "prompt": "Analyze marketing data and provide insights, trends, and recommendations",
 "assistantTemplateId": "marketing-template-001"
 }
 },
 "fieldId": "marketing-field-123"
}

Key Points:

• Path Parameter Required: automationId must be included in the URL path • Partial Updates Supported: You can update only specific fields, not all fields are required • Run Type Changes: When changing to "schedule", include the schedule object with timePeriod and repeatAt • Trigger & Action Required: Both trigger and action objects appear to be required in the request body • Assistant Type: The assistantType is for custom Assistant selected • Status Control: Use isActive: true/false to enable or disable the automation • Optional Fields: fieldId is optional and only used with magic-prompt actions • Schedule Time Periods: Available options - "today", "yesterday", "last7days", "last14days", "thisWeek" • Action Types: Support for "magic-prompt" and "translation" action types • Trigger Types: Support for "folders", "tags", and "keywords" trigger types • Assistant Types: Available options - "researcher", "marketer", "sales", "general", "recruiter", "custom"

Request rules. The same rules as creating an automation. schedule is required only when runType is schedule, and then both schedule.timePeriod and schedule.repeatAt are required. Each step's config object has to match that step's stepType.

put/automations/{automationId}

Request

  • Base URL: https://api.speakai.co/v1
  • URL: https://api.speakai.co/v1/automations/{automationId}
  • Auth: API key in header x-speakai-key and API key in header x-access-token

Path parameters

automationIdstring required

Request body

namestring required

Name the automation. This is what you see in the automations list. required, max length 150

descriptionstring

Describe what the automation does. You can send an empty string. optional, max length 1000, empty string allowed

isActiveboolean

Turn the automation on or off. Leave it out and the automation keeps whatever active state it already has. optional. The declared default is true, but that default never reaches the controller, which does if (isActive !== undefined) setter.$set.isActive = isActive. Omitting the field therefore leaves the stored value untouched; it does NOT reactivate a paused automation.

runOnceOnlystring

Ignore this field. The server accepts it and then never reads it, so whatever you send has no effect. optional. unconstrained.strip, so any JSON type passes validation. The controller reads runOnceOnly only off the existing stored record, never off your request body, so you cannot set or clear it through this endpoint.

runType'instant' | 'schedule' | ''

Choose whether the automation runs as soon as its trigger fires or on a schedule. optional, empty string accepted. The controller writes SCHEDULE only when runType strictly equals "schedule" and writes INSTANT otherwise, so omitting it on a scheduled automation converts it back to instant and unsets its schedule.

fieldIdstring

Ignore this field. The server validates it and then never reads it, so setting it has no effect. optional. updateAutomation does not destructure a top-level fieldId from req.body.

isUpdatedboolean

Ignore this field. The server always flags the automation as updated for the scheduler on every update, whatever you send. optional. The controller hardcodes isUpdated: true in its $set and never reads the client value.

Response

Success

Changes

No recorded changes to this operation across all 2 revisions of this API.