Skip to main content
POST
/
v1
/
ai
/
routines
Create an AI Routine
curl --request POST \
  --url https://{instance}.omniapp.co/api/v1/ai/routines \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "destination": {
    "type": "email",
    "recipientEmails": [
      "blob.ross@blobsrus.com",
      "blob.the.builder@blobsrus.com"
    ],
    "userGroupIds": [
      "550e8400-e29b-41d4-a716-446655440000"
    ]
  },
  "modelId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "name": "<string>",
  "prompt": "<string>",
  "schedule": "<string>",
  "timezone": "<string>",
  "branchId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "description": "<string>",
  "topicName": "<string>"
}
'
{
  "id": "880e8400-e29b-41d4-a716-446655440003"
}

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

Query Parameters

userId
string<uuid>

Requires an Organization API key. Target user membership ID.

Body

application/json
destination
object
required

Email delivery configuration for the routine.

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.

schedule
string
required

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

timezone
string
required

IANA timezone identifier used to evaluate the schedule.

branchId
string<uuid> | null

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

description
string | null

Display-only notes about the routine, or null.

topicName
string | null

Topic scoping query generation, or null.

Response

Routine created successfully

id
string<uuid>

The unique identifier for the newly created routine.

Example:

"880e8400-e29b-41d4-a716-446655440003"