---
title: "Get template"
method: GET
path: "/automation-templates/{slug}"
tags: ["Automations"]
---

# Get template

`GET /automation-templates/{slug}`

## Request

- Base URL: `https://api.modem.dev/v1`
- URL: `https://api.modem.dev/v1/automation-templates/{slug}`
- Auth: HTTP bearer

Get one template by slug: full prompt, default schedule, model level, output channels, and
required integrations. Clients that support creating automations can pass the slug as
sourceDefaultTaskSlug to link the new automation to its template.

## Path parameters

- `slug` string, required

## Response `200`

OK

- object
  - `description` string, nullable, required
  - `modelLevel` 'high' | 'low' | 'med', required: Model quality/speed tier persisted for automation execution.
  - `name` string, required
  - `outputChannels` object[], nullable, required
    - `channel` 'discord' | 'email' | 'msteams' | 'slack', required
    - `destinations` string[], nullable, required
    - `mode` 'any-internal' | 'any' | 'specific', required
  - `prompt` string, required
  - `relatedTemplates` string[], required
  - `requiredIntegrations` string[], required
  - `schedule` union, required: Defines when an automation should run.
    - object
      - `expr` string, required: Standard cron expression string.
      - `type` 'cron', required
    - object
      - `rrule` string, required: iCalendar recurrence rule (RFC 5545) string.
      - `type` 'rrule', required
    - object
      - `at` string, required: ISO 8601 timestamp for one-time execution.
      - `type` 'at', required
    - object
      - `n` integer, required: Number of time units between executions.
      - `type` 'every', required
      - `unit` 'hours' | 'minutes', required: Time unit for interval scheduling.
    - object
      - `channelIds` string[]: Optional channel scope: message channel UUIDs this automation is limited to. Omit for all channels (global). Only valid when every selected event supports channel scoping (see EVENT_CHANNEL_SCOPING).
      - `condition` string: Optional free-form natural-language condition ("only run when …"), up to 2000 characters, evaluated against each trigger event's payload; the automation runs only for events that satisfy it. Omit to run on every matching event. A condition also satisfies an event that requires a channel or product scope.
      - `conditionMode` 'agent' | 'judge': Server-derived; ignored on input. judge = the condition is decided from the event payload before the run starts; agent = the agent decides it at the start of every run.
      - `conditionSchemaVersion` integer: Server-derived; ignored on input. The version of the event field guide the condition was judged against; absent when it was not judged.
      - `delaySeconds` integer: Optional delay, in seconds, before running the automation after its trigger event fires (e.g. 1800 = 30 minutes after the event). Omit for immediate execution. Maximum 604800 (7 days).
      - `event` string: Legacy single-event trigger (e.g., github.pr.created). Still accepted on read/write for backwards compatibility; prefer `events` for new writes. When both are present, `events` is canonical.
      - `events` string[]: Trigger events for this automation (e.g., ["github.pr.created", "github.pr.dismissed"]). The automation fires once per matching event occurrence. Canonical form — prefer this over the legacy `event` field.
      - `productIds` string[]: Optional product scope: the products this automation is limited to. Omit for all products (global); an empty array is rejected so 'global' has one representation. Acts as a channel preset — at dispatch time the scoped products' currently linked message channels (product_channels) are resolved and the automation fires when the triggering event's channels intersect ANY of them. It additionally instructs the agent to scope the run's output to those products. May be combined with channelIds — both scopes must pass (AND semantics).
      - `targetBranches` string[]: Optional case-sensitive allowlist of GitHub PR base_ref branches. Names match exactly; * matches zero or more characters, including slashes. Only valid for GitHub PR triggers. Omit for all target branches; channel and product scopes must also pass. Nonmatching events are skipped before launching a workflow or agent.
      - `type` 'event', required
  - `slug` string, required
  - `subtitle` string, nullable, required

## Other responses

- `400`: Invalid request (validation failed).
- `401`: Missing or invalid API key.
- `403`: The API key does not have access to this resource.
- `404`: The requested resource was not found.
- `429`: Rate limit exceeded.
- `500`: Internal server error.

---

[API](https://skmtc.dev/modem/apis/modem-api.md) · [All operations](https://skmtc.dev/modem/apis/modem-api/llms.txt) · [OpenAPI document](https://skmtc.dev/modem/apis/modem-api/revisions/34e66c8c00ba?raw)
