> ## Documentation Index
> Fetch the complete documentation index at: https://modem.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Get template

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




## OpenAPI

````yaml /api-reference/openapi.json get /automation-templates/{slug}
openapi: 3.1.1
info:
  description: >-
    The public Modem API. Authenticate with an organization API key:
    `Authorization: Bearer modem_…`.
  title: Modem API
  version: 1.0.0
servers:
  - description: Production
    url: https://api.modem.dev/v1
security:
  - bearerAuth: []
paths:
  /automation-templates/{slug}:
    get:
      tags:
        - Automations
      summary: Get template
      description: >
        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.
      operationId: automations.getTemplate
      parameters:
        - in: path
          name: slug
          required: true
          schema:
            pattern: ^[a-z0-9-]+$
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  description:
                    anyOf:
                      - type: string
                      - type: 'null'
                  modelLevel:
                    description: >-
                      Model quality/speed tier persisted for automation
                      execution.
                    enum:
                      - high
                      - low
                      - med
                    title: Scheduled Task Model Level
                    type: string
                  name:
                    type: string
                  outputChannels:
                    anyOf:
                      - items:
                          properties:
                            channel:
                              enum:
                                - discord
                                - email
                                - slack
                              type: string
                            destinations:
                              anyOf:
                                - items:
                                    minLength: 1
                                    type: string
                                  type: array
                                - type: 'null'
                            mode:
                              enum:
                                - any-internal
                                - any
                                - specific
                              type: string
                          required:
                            - channel
                            - destinations
                            - mode
                          type: object
                        type: array
                      - type: 'null'
                  prompt:
                    type: string
                  relatedTemplates:
                    items:
                      type: string
                    type: array
                  requiredIntegrations:
                    items:
                      type: string
                    type: array
                  schedule:
                    anyOf:
                      - properties:
                          expr:
                            description: Standard cron expression string.
                            minLength: 1
                            title: Cron Expression
                            type: string
                          type:
                            const: cron
                        required:
                          - expr
                          - type
                        type: object
                      - properties:
                          rrule:
                            description: iCalendar recurrence rule (RFC 5545) string.
                            minLength: 1
                            title: RRule
                            type: string
                          type:
                            const: rrule
                        required:
                          - rrule
                          - type
                        type: object
                      - properties:
                          at:
                            description: ISO 8601 timestamp for one-time execution.
                            minLength: 1
                            title: At Time
                            type: string
                          type:
                            const: at
                        required:
                          - at
                          - type
                        type: object
                      - properties:
                          'n':
                            description: Number of time units between executions.
                            exclusiveMinimum: 0
                            title: Interval
                            type: integer
                          type:
                            const: every
                          unit:
                            description: Time unit for interval scheduling.
                            enum:
                              - hours
                              - minutes
                            title: Time Unit
                            type: string
                        required:
                          - 'n'
                          - type
                          - unit
                        type: object
                      - properties:
                          channelIds:
                            description: >-
                              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).
                            items:
                              format: uuid
                              type: string
                            minItems: 1
                            title: Channel IDs
                            type: array
                          delaySeconds:
                            description: >-
                              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).
                            maximum: 604800
                            minimum: 1
                            title: Delay (seconds)
                            type: integer
                          event:
                            description: >-
                              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.
                            minLength: 1
                            title: Event Name (legacy single-event form)
                            type: string
                          events:
                            description: >-
                              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.
                            items:
                              minLength: 1
                              type: string
                            maxItems: 20
                            minItems: 1
                            title: Event Names
                            type: array
                          productIds:
                            description: >-
                              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).
                            items:
                              format: uuid
                              type: string
                            minItems: 1
                            title: Product IDs
                            type: array
                          type:
                            const: event
                        required:
                          - type
                        type: object
                    description: Defines when an automation should run.
                    title: Schedule Specification
                  slug:
                    pattern: ^[a-z0-9-]+$
                    type: string
                  subtitle:
                    anyOf:
                      - type: string
                      - type: 'null'
                required:
                  - description
                  - modelLevel
                  - name
                  - outputChannels
                  - prompt
                  - relatedTemplates
                  - requiredIntegrations
                  - schedule
                  - slug
                  - subtitle
                type: object
          description: OK
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Invalid request (validation failed).
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Missing or invalid API key.
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: The API key does not have access to this resource.
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: The requested resource was not found.
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Rate limit exceeded.
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Internal server error.
components:
  schemas:
    Error:
      properties:
        code:
          description: Machine-readable error code, e.g. `NOT_FOUND`.
          examples:
            - NOT_FOUND
          type: string
        data:
          description: Optional structured error details.
        defined:
          description: True if the error was declared in the procedure contract.
          type: boolean
        message:
          description: Human-readable error message.
          type: string
        status:
          description: HTTP status code.
          examples:
            - 404
          type: integer
      required:
        - code
        - defined
        - message
        - status
      type: object
  securitySchemes:
    bearerAuth:
      description: Organization API key (`modem_…`).
      scheme: bearer
      type: http

````