Skip to main content
PATCH
Update an AI Routine
Supplying destination replaces the full recipient configuration — switching to a different destination type (email, Slack, or webhook) clears the previous destination’s state, such as a linked Slack credential or email recipients.

Authorizations

Authorization
string
header
required

Can be either an Organization API Key or Personal Access Token (PAT).

Include in the Authorization header as: Bearer YOUR_TOKEN

Path Parameters

routineId
string<uuid>
required

The UUID of the routine.

Query Parameters

userId
string<uuid>

Organization API key required. The membership ID of the user to act as.

Body

application/json
agentId
string<uuid> | null

Sets the agent the routine runs through, under the same rules as on create, judged for the routine's owner. A routine that has a condition, or that is personalized for each recipient, returns 400 — remove the condition in the same request with condition: null.

Pass null to run as the organization's main AI agent again. Omit to leave the stored agent unchanged.

Example:

"0b1f6c1e-2d3a-4f5b-8c7d-9e0a1b2c3d4e"

condition
object | null

Replaces the delivery condition: Omni authors and verifies the condition query, resets the comparison baseline, and cancels any in-progress condition evaluation so a run started under the old condition cannot deliver.

Pass null to remove the condition, making the routine deliver on every scheduled run.

Omit to leave the stored condition unchanged.

name
string

New customer-visible name of the routine. Used as the email subject for email destinations, shown on Slack deliveries, and sent as name in webhook payloads.

Required string length: 1 - 512
description
string | null

Display-only notes about the routine. Pass null to clear it.

Maximum string length: 2000
destination
object

Replaces the routine's full recipient configuration with the supplied destination. Pass `null`` to clear the current destination, meaning the routine won't deliver any results.

prompt
string

New natural language prompt for the routine: what Omni runs and delivers on each scheduled run. Run a skill as part of the routine by including a skill's /identifier, which will resolve as the routine owner when the routine fires.

Minimum string length: 1
schedule
string

New six-field cron expression (minute, hour, day-of-month, month, day-of-week, year; use ? for an unspecified day field). Minimum frequency is once per hour.

Minimum string length: 1
timezone
string

New IANA timezone identifier used to evaluate the schedule.

Minimum string length: 1
llm
object | null

The LLM the routine runs on. Must be an approved LLM in AI Hub > General > LLM settings that the routine owner has access to. Use the List available LLMs endpoint to retrieve a list of available LLMs.

At run time, Omni checks the pinned LLM against the owner's LLM audience, or against each recipient's audience for a personalized routine, and falls back to the organization default for whoever it excludes.

Omit to leave the LLM unchanged; pass null to use the organization default.

Example:

Response

Routine updated successfully

agentId
string<uuid> | null
required

ID of the agent the routine runs through, or null when it runs as the organization's main AI agent.

branchId
string<uuid> | null
required

Branch of the shared model the prompt runs against, or null.

condition
object | null
required

The delivery condition. Null for a routine that delivers on every scheduled run.

createdAt
string
required

ISO 8601 timestamp when the routine was created.

description
string | null
required

Display-only notes about the routine, or null.

destination
object
required

Single delivery destination for the routine, or null when the routine runs without a delivery.

disabled
boolean
required

Whether the owner has paused the routine.

id
string<uuid>
required

The unique identifier of the routine.

lastRun
object | null
required

Most recent completed run, or null if the routine has never completed a run.

llm
object | null
required

The LLM the routine runs on, or null when it uses the organization default. If the LLM is no longer approved, the run uses the organization default.

Example:
modelId
string<uuid>
required

The shared model the prompt runs against.

name
string
required

Customer-visible name of the routine. Used as the email subject for email destinations, shown on Slack deliveries, and sent as name in webhook payloads.

prompt
any
required

Natural language prompt Omni runs on each scheduled run.

recipientCount
integer
required

Number of distinct deliverable recipients. For email, user groups are expanded to members and duplicates removed; for Slack, the channel or the listed users. A webhook destination always counts as 1. 0 when the routine doesn't have a delivery destination.

schedule
string
required

Six-field cron expression (minute, hour, day-of-month, month, day-of-week, year; use ? for an unspecified day field).

systemDisabled
boolean
required

Whether Omni disabled the routine because it could no longer run successfully or safely.

systemDisabledReason
string | null
required

Reason Omni disabled the routine, or null.

timezone
string
required

IANA timezone identifier used to evaluate the schedule.

topicName
string | null
required

Topic scoping query generation, or null.

updatedAt
string
required

ISO 8601 timestamp when the routine was last updated.