Skip to main content
PUT
/
v1
/
ai
/
routines
/
{routineId}
Update an AI Routine
curl --request PUT \
  --url https://{instance}.omniapp.co/api/v1/ai/routines/{routineId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "prompt": "<string>",
  "schedule": "<string>",
  "description": "<string>",
  "modelId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "isActive": true
}
'
{
  "branchId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "createdAt": "<string>",
  "description": "<string>",
  "destination": {
    "type": "email",
    "recipientEmails": [
      "blob.ross@blobsrus.com",
      "blob.the.builder@blobsrus.com"
    ],
    "userGroupIds": [
      "550e8400-e29b-41d4-a716-446655440000"
    ]
  },
  "disabled": true,
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "lastRun": {
    "completedAt": "<string>",
    "label": "Delivered",
    "state": "COMPLETE"
  },
  "modelId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "name": "<string>",
  "prompt": "<string>",
  "recipientCount": 123,
  "schedule": "<string>",
  "systemDisabled": true,
  "systemDisabledReason": "<string>",
  "timezone": "<string>",
  "topicName": "<string>",
  "updatedAt": "<string>"
}

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

id
string<uuid>
required

The UUID of the routine.

Query Parameters

userId
string<uuid>

Requires an Organization API key. Target user membership ID.

Body

application/json
name
string
required

Display name for the routine

Required string length: 1 - 255
prompt
string
required

The AI prompt that will be executed when the routine runs

Minimum string length: 1
schedule
string
required

Cron expression or human-readable schedule (e.g., "daily", "weekly", "0 9 * * 1")

description
string | null

Optional description of what the routine does

modelId
string<uuid> | null

Optional model ID to scope the routine to a specific data model

isActive
boolean

Whether the routine is active and will execute on schedule

Response

Routine updated successfully

branchId
string<uuid> | null
required

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

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

Email delivery configuration for the routine.

disabled
boolean
required

Whether the owner has paused the routine.

id
string<uuid>
required

The unique identifier of the routine.

lastRun
object
required

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

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.

prompt
string
required

Natural language prompt Omni runs on each scheduled run.

recipientCount
integer
required

Number of distinct deliverable recipients after expanding user groups and removing duplicates.

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.