---
title: "Get a routine"
method: GET
path: "/api/v1/ai/routines/{id}"
tags: ["AI Routines"]
---

# Get a routine

`GET /api/v1/ai/routines/{id}`

Get a single routine, including the status of its most recent completed run.

## Path parameters

- `id` string, uuid, required — The UUID of the routine.

## Query parameters

- `userId` string, uuid — Target user membership ID (for org-scoped API keys)

## Response `200`

Routine details.

- RoutineResponse
  - `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 — Delivery configuration for the routine.
    - RoutineEmailDestinationResponse
      - `recipientEmails` string[], required — Email addresses configured as direct recipients of each scheduled run, resolved from their current membership.
      - `type` 'email', required — Selects email delivery — each scheduled run is sent to the listed email recipients and user groups.
      - `userGroupIds` string[], required — 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
      - `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 — Customer-visible status of the last completed run.
    - `state` string, required — Machine-readable status of the last completed run.
  - `modelId` string, uuid, required — The model the prompt runs against.
  - `name` string, required — Customer-visible name of the routine. Used as the email subject for email destinations, and shown on Slack deliveries.
  - `prompt` string, 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; a Slack routine is always 1 (its single channel or DM).
  - `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 routine ID.
- `401` — Missing or invalid API key.
- `403` — AI routines or AI query generation are not enabled for the organization, or a user-scoped API key tried to access another user's routine.
- `404` — Routine not found or has been deleted.

---

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