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

# List Default Rules

> Your rules for every restaurant: which email goes out for which event, and when

Guide: [Rules](https://docs.minimo.it/embedded/automations.md). Errors: [Errors and limits](https://docs.minimo.it/embedded/errors.md).


## OpenAPI

````yaml get /public/v1/automation-rules
openapi: 3.1.0
info:
  title: API Documentation
  description: Documentation for transactional and subscribe APIs
  version: 1.0.0
servers:
  - url: https://app.minimo.it
security:
  - bearerAuth: []
paths:
  /public/v1/automation-rules:
    servers:
      - url: https://api.minimo.it
    get:
      summary: List default rules
      description: >-
        Your rules for every restaurant. Rules say which master template goes
        out for which event, and when: right away, or at an offset from a date
        in the event (for example 2 hours before the booking). See
        [Rules](/embedded/automations).
      operationId: listAutomationRules
      parameters:
        - name: locale
          in: query
          required: false
          description: Language of the `timing` text in the answer.
          schema:
            type: string
            enum:
              - en
              - it
            default: en
      responses:
        '200':
          description: The rules
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/AutomationRule'
              example:
                data:
                  - key: confirmation
                    name: Booking confirmation
                    event: booking.created
                    template: 1201
                    templateUid: TRF4MS9
                    offset: null
                    dateField: null
                    timing: Immediately
                    enabled: true
                    cancelOn:
                      - booking.cancelled
                    rescheduleOn: []
                    source: default
                  - key: reminder
                    name: Reminder 2 hours before
                    event: booking.created
                    template: 1202
                    templateUid: RMD2HRS
                    offset: '-PT2H'
                    dateField: booking_at
                    timing: 2 hours before
                    enabled: true
                    cancelOn:
                      - booking.cancelled
                    rescheduleOn:
                      - booking.updated
                    source: default
        '401':
          description: >-
            `INVALID_TOKEN`: missing or wrong key, or a key without the
            **Widgets** permission.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
      security:
        - bearerAuth: []
      x-codeSamples:
        - label: cURL
          lang: bash
          source: |-
            curl --request GET \
              --url 'https://api.minimo.it/public/v1/automation-rules' \
              --header 'Authorization: Bearer YOUR_MINIMO_KEY'
        - lang: JavaScript
          source: >-
            const res = await
            fetch('https://api.minimo.it/public/v1/automation-rules', {
              method: 'GET',
              headers: {
                Authorization: 'Bearer YOUR_MINIMO_KEY',
              },
            });

            const { data } = await res.json();

            console.log(data);
        - lang: Python
          source: |-
            import requests

            res = requests.get(
                'https://api.minimo.it/public/v1/automation-rules',
                headers={'Authorization': 'Bearer YOUR_MINIMO_KEY'},
            )
            print(res.status_code, res.text)
components:
  schemas:
    AutomationRule:
      type: object
      properties:
        key:
          type: string
          description: Stable name of the rule.
          example: reminder
        name:
          type: string
          nullable: true
          description: Name the restaurant sees in the widget.
          example: Reminder 2 hours before
        event:
          type: string
          description: Event that schedules the email.
          example: booking.created
        template:
          type: integer
          description: Master template id.
          example: 1202
        templateUid:
          type: string
          description: Master template uid.
          example: RMD2HRS
        offset:
          type: string
          nullable: true
          description: >-
            ISO 8601 duration from `dateField`: `-PT2H` = 2 hours before, `PT2H`
            = 2 hours after. `null` = right away.
          example: '-PT2H'
        dateField:
          type: string
          nullable: true
          description: Path of the date in the event `payload` the offset counts from.
          example: booking_at
        timing:
          type: string
          description: The timing in words.
          example: 2 hours before
        enabled:
          type: boolean
        cancelOn:
          type: array
          items:
            type: string
          example:
            - booking.cancelled
          description: Events that cancel the pending email (same `cancellationKey`).
        rescheduleOn:
          type: array
          items:
            type: string
          example:
            - booking.updated
          description: Events that move the pending email to the new date.
        source:
          type: string
          enum:
            - default
            - override
            - tenant
          description: >-
            `default`: your rule for every restaurant. `override`: a default
            this restaurant changed. `tenant`: the restaurant's own rule.
      required:
        - key
        - name
        - event
        - template
        - templateUid
        - offset
        - dateField
        - timing
        - enabled
        - cancelOn
        - rescheduleOn
        - source
    ApiError:
      type: object
      properties:
        status:
          type: string
          example: FAIL
        message:
          type: string
          description: The error code to test in your code.
          example: INVALID_PARAMETERS
        userMessage:
          type: string
          description: >-
            When present, a sentence that says what to fix. You can show or log
            it.
          example: Set the origins allowed to embed the widgets first.
      description: >-
        Every error has this shape. See [Errors and limits](/embedded/errors)
        for every code.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: mn-API_CLIENT_ID-API_KEY

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.