Skip to content

Create Work Routine

POST
/work/routines

Create one routine.

deliveryConversationId must be a conversation this credential can read — otherwise a routine would be a way to post into a room its author cannot see, and it is refused with the same 403 reading that room would give.

triggerKind: "schedule" takes weekdays + localTime + timezone; triggerKind: "event" takes a trigger config and an optional eventPolicy instead. The creator comes from the authenticated principal.

Authorizations

Parameters

Header Parameters

X-Target-Org-Id
Any of:
string

Request Body required

One routine to create. Identity is never expressible here.

object
agentId
required

Agent that runs the routine

string
deliveryConversationId
required

Conversation the routine posts into; must be readable by the caller

string
enabled

Whether the routine starts active

boolean
default: true
eventPolicy
Any of:
object
key
additional properties
any
instruction
required

What the agent is asked to do each run

string
localTime
Any of:
string
timezone

IANA timezone the local time is read in

string
default: UTC
title
required

What the routine is called

string
trigger
Any of:
object
key
additional properties
any
triggerKind

schedule or event

string
default: schedule
weekdays
Any of:
Array<integer>

Responses

201

Successful Response

object
data
required

One routine, as the create and update operations return it.

object
routine
required

The routine as stored after the write

object
agentId
Any of:
string
deliveryConversationId
Any of:
string
enabled
Any of:
boolean
id
Any of:
string
instruction
Any of:
string
lastRunAt
Any of:
string
lastStatus
Any of:
string
localTime
Any of:
string
timezone
Any of:
string
title
Any of:
string
triggerKind
Any of:
string
weekdays
Any of:
Array<integer>
key
additional properties
any
pagination
Any of:
object
has_next
required

Whether there are more pages

boolean
limit
required

Items per page

integer
next_cursor
Any of:
string
page
required

Current page number (1-indexed)

integer
total
required

Total number of items

integer

422

Validation Error

object
detail
Array<object>
object
loc
required
Array
msg
required
string
type
required
string