---
title: "List AI Routines"
method: GET
path: "/v1/ai/routines"
tags: ["AI Routines"]
---

# List AI Routines

`GET /v1/ai/routines`

List AI Routines for the calling user, newest first. Includes routines paused by the owner or disabled by Omni, but excludes deleted routines. 

Use `pageInfo.nextCursor` from one response as the `cursor` query parameter on the next request.

## Query parameters

- `cursor` string
- `pageSize` integer
- `sortDirection` 'asc' | 'desc'
- `sortField` string
- `userId` string, uuid

## Response `200`

List of AI Routines

- object
  - `pageInfo` PageInfo, required — Pagination information for paginated responses.
    - `hasNextPage` boolean — Indicates if there are more records available.
    - `nextCursor` string, nullable — Cursor for the next page of results. `null` if no more results.
    - `pageSize` integer — Number of records per page.
    - `totalRecords` integer — Total number of records matching the query.
  - `records` Routine[], required — Routines returned for this request, newest first.
    - `branchId` string, uuid, nullable, 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, nullable, required — Display-only notes about the routine, or null.
    - `destination` union, required — Single delivery destination for the routine — email or Slack. To send results to multiple destinations, create one routine per destination.
      - RoutineEmailDestination — Email delivery configuration for the routine.
        - `recipientEmails` string[] — Email addresses that receive each scheduled run of the routine.
        - `type` 'email', required — Selects email delivery — each scheduled run is sent to the listed email recipients and user groups.
        - `userGroupIds` string[] — User group IDs whose active members receive each scheduled run. Omni expands each group to the members' current email addresses when the routine runs.
      - RoutineSlackDestination — Slack delivery configuration for the routine. Requires a Slack workspace connected to Omni; to deliver to a private channel, invite the Omni Slackbot to it first.
        - `recipientId` string, required — The Slack channel ID (e.g. `C01234567`) or user ID (e.g. `U01234567`) that receives each scheduled run. Exactly one recipient per Slack routine.
        - `slackRecipientType` 'channel' | 'users', required — Whether `recipientId` is a Slack channel or a user (delivered as a direct message).
        - `type` 'slack', required — Selects Slack delivery — each scheduled run is posted to one Slack channel or sent as a direct message to one user.
    - `disabled` boolean, required — Whether the owner has paused the routine.
    - `id` string, uuid, required — The unique identifier of the routine.
    - `lastRun` RoutineLastRun, nullable, required — Most recent completed run, or null if the routine has never completed a run.
      - `completedAt` string, nullable, required — ISO 8601 timestamp the last completed run finished.
      - `label` string, required — User-visible status of the last completed run.
      - `state` string, required — Machine-readable status of the last completed 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, nullable, required — Reason Omni disabled the routine, or null.
    - `timezone` string, required — IANA timezone identifier used to evaluate the schedule.
    - `topicName` string, nullable, required — Topic scoping query generation, or null.
    - `updatedAt` string, required — ISO 8601 timestamp when the routine was last updated.

## Other responses

- `400` — Invalid pagination cursor or `userId` value.
- `401` — Missing or invalid API key
- `403` — Forbidden Possible error messages: - `User does not have USE_AI permission` - `AI Routines feature is not enabled (aiScheduledTasks flag required)`
- `404` — Not found. Possible causes: - The `userId` membership was not found in the organization.
- `429` — Too Many Requests - Rate limit exceeded (60 requests/minute)
- `500` — Internal Server Error

---

[API](https://skmtc.net/omni/apis/omni-api.md) · [All operations](https://skmtc.net/omni/apis/omni-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/omni/omni-api/revisions/6b02f7349d0e/schema)
