Skip to main content
PUT
Save an automation draft

Authorizations

Authorization
string
header
required

An API key from your Devic console, sent as Authorization: Bearer <key>. An embedded front end sends a tenant-session token instead, so no API key reaches the browser, and an OAuth integration sends its access token. Missing, invalid or expired credentials get a 401. See Authentication.

Headers

X-Devic-User
string

Only with an API key: the userUID or email of a person of the key's account to act as, with that person's permissions. Without it, an API key acts as the account integration ("API"), which sees shared workspaces only. A person's token cannot name someone else.

Path Parameters

wid
string
required

Workspace id (home workspace of the automation)

automationId
string
required

Automation id

Body

application/json
name
string
required

Name, at most 200 characters

instructions
string
required

What each run does, at most 16000 characters: how to resolve the record, find or create the thread, what to post and what to do when the match is ambiguous

targetWorkspaceId
string
required

Destination workspace, from GET .../automations/destinations

version
integer

Current draftVersion. A concurrent save returns 409 AUTOMATION_DRAFT_CHANGED

Required range: x >= 0
targetAssistantId
string

Optional assistant of the destination each run asks to answer

source
object

Omit for an app event. cron needs expression and timezone

connectionId
string

App events: the account the trigger listens on

triggerSlug
string

App events: slug from GET .../automations/triggers

triggerConfig
object

App events: values for the trigger's configuration schema

connections
object[]

Tools granted to the runs, per account. May be empty

Maximum array length: 20
nativeTools
object

Response

Success — wrapped as { success: true, data }