AI Routines

Get a single routine, including its persisted condition query and the status of its most recent completed run. Verification results belong to the POST or PATCH operation that generated a condition and are not returned by GET.

get/api/v1/ai/routines/{id}

Request

  • Base URL
    https://omniapp.co (the document declares no server; this is the origin it was published from)
  • URL
    https://omniapp.co/api/v1/ai/routines/{id}
  • Auth
    HTTP bearer

Path parameters

idstring uuid required

The UUID of the routine.

Query parameters

userIdstring uuid

Target user ID (for org-scoped API keys)

Response

Routine details.

branchIdstring uuid nullable required

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

createdAtstring required

ISO 8601 timestamp when the routine was created.

descriptionstring nullable required

Display-only notes about the routine, or null.

disabledboolean required

Whether the owner has paused the routine.

idstring uuid required

The unique identifier of the routine.

modelIdstring uuid required

The model the prompt runs against.

namestring 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.

promptstring required

Natural language prompt Omni runs on each scheduled run.

recipientCountinteger 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 counts as 1.

schedulestring required

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

systemDisabledboolean required

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

systemDisabledReasonstring nullable required

Reason Omni disabled the routine, or null.

timezonestring required

IANA timezone identifier used to evaluate the schedule.

topicNamestring nullable required

Topic scoping query generation, or null.

updatedAtstring required

ISO 8601 timestamp when the routine was last updated.

Example response

{
  "condition": {
    "conditionPrompt": "there are failed orders",
    "conditionType": "RESULTS_PRESENT",
    "query": {
      "aiGenerated": true,
      "calculations": [],
      "column_totals": {},
      "fields": [
        "orders.id"
      ],
      "fill_fields": [],
      "filters": {
        "orders.status": {
          "case_insensitive": true,
          "kind": "EQUALS",
          "type": "string",
          "values": [
            "failed"
          ]
        }
      },
      "limit": 1,
      "modelId": "770e8400-e29b-41d4-a716-446655440002",
      "pivots": [],
      "row_totals": {},
      "sorts": [],
      "table": "orders",
      "userEditedSQL": "SELECT ${orders.id}\nFROM ${orders}\nWHERE UPPER(${orders.status}) = UPPER('failed')\nLIMIT 1",
      "version": 9
    }
  },
  "destination": {
    "recipientEmails": [
      "alice@example.com",
      "bob@example.com"
    ],
    "type": "email",
    "userGroupIds": [
      "X9kQ2mPz"
    ]
  },
  "lastRun": {
    "label": "Delivered",
    "state": "COMPLETE"
  }
}

Changes

    • breaking

      added to the response property oneOf list for the response status

    • info

      added webhook discriminator mapping keys to the response property for the response status

    • breaking

      the ////// response's property format changed from uuid to no format for status