# Notifications tools

[All tool areas](/docs/tools.md). Each tool acts within your access.

## Notifications

### get_notifications

List every message Lokl sends for this organization (to guests, and to staff), each with the organization's setting that turns it on or off, the settings that time it, and how many places (an entity, location, product, product at a location, or session) set it differently. Change one with update_settings at the organization level.

Reads · Members of an organization · Needs settings:read

No input.

#### Output

- `guests` — array; required. 
  - `guests[]` — object; optional. 
    - `guests[].setting` — object; required. 
      - `guests[].setting.key` — string; required. 
      - `guests[].setting.description` — string; required. 
      - `guests[].setting.help` — string or null; optional. Plain staff help in dashboard input units, or null when no help is provided. Optional in the schema, always sent.
      - `guests[].setting.value` — any value; required. 
      - `guests[].setting.source` — object; required. 
        - `guests[].setting.source.level` — string; required.  Allowed: "default", "organization", "entity", "location", "product", "productLocation", "session"
        - `guests[].setting.source.id` — string or null; required. 
        - `guests[].setting.source.locationId` — string; optional. 
      - `guests[].setting.overriddenHere` — boolean; required. 
      - `guests[].setting.canSetHere` — boolean; required. 
      - `guests[].setting.plan` — object; optional. For a setting that turns on a feature of some plans only: the feature, the lowest plan that includes it, and whether the organization's plan does. Turning it on is refused when it doesn't; turning it off never is. Given by get_settings and update_settings
        - `guests[].setting.plan.feature` — string; required. 
        - `guests[].setting.plan.requiredTier` — string; required.  Allowed: "starter", "growth", "scale"
        - `guests[].setting.plan.included` — boolean; required. 
      - `guests[].setting.label` — string; required. 
      - `guests[].setting.setBelow` — integer; required. How many places below the organization set their own value for it minimum: 0; maximum: 9007199254740991
    - `guests[].timing` — array; required. 
      - `guests[].timing[]` — object; optional. 
        - `guests[].timing[].key` — string; required. 
        - `guests[].timing[].description` — string; required. 
        - `guests[].timing[].help` — string or null; optional. Plain staff help in dashboard input units, or null when no help is provided. Optional in the schema, always sent.
        - `guests[].timing[].value` — any value; required. 
        - `guests[].timing[].source` — object; required. 
          - `guests[].timing[].source.level` — string; required.  Allowed: "default", "organization", "entity", "location", "product", "productLocation", "session"
          - `guests[].timing[].source.id` — string or null; required. 
          - `guests[].timing[].source.locationId` — string; optional. 
        - `guests[].timing[].overriddenHere` — boolean; required. 
        - `guests[].timing[].canSetHere` — boolean; required. 
        - `guests[].timing[].plan` — object; optional. For a setting that turns on a feature of some plans only: the feature, the lowest plan that includes it, and whether the organization's plan does. Turning it on is refused when it doesn't; turning it off never is. Given by get_settings and update_settings
          - `guests[].timing[].plan.feature` — string; required. 
          - `guests[].timing[].plan.requiredTier` — string; required.  Allowed: "starter", "growth", "scale"
          - `guests[].timing[].plan.included` — boolean; required. 
        - `guests[].timing[].label` — string; required. 
        - `guests[].timing[].setBelow` — integer; required. How many places below the organization set their own value for it minimum: 0; maximum: 9007199254740991
- `staff` — array; required. 
  - `staff[]` — object; optional. 
    - `staff[].notification` — string; required.  Allowed: "staff\_digest", "daily\_brief", "kitchen\_sheet", "refund\_problems", "billing"
    - `staff[].label` — string; required. 
    - `staff[].description` — string; required. 
    - `staff[].recipients` — string; required. 
    - `staff[].required` — boolean; required. 
    - `staff[].setting` — object or null; required. 
      - `staff[].setting.key` — string; required. 
      - `staff[].setting.description` — string; required. 
      - `staff[].setting.help` — string or null; optional. Plain staff help in dashboard input units, or null when no help is provided. Optional in the schema, always sent.
      - `staff[].setting.value` — any value; required. 
      - `staff[].setting.source` — object; required. 
        - `staff[].setting.source.level` — string; required.  Allowed: "default", "organization", "entity", "location", "product", "productLocation", "session"
        - `staff[].setting.source.id` — string or null; required. 
        - `staff[].setting.source.locationId` — string; optional. 
      - `staff[].setting.overriddenHere` — boolean; required. 
      - `staff[].setting.canSetHere` — boolean; required. 
      - `staff[].setting.plan` — object; optional. For a setting that turns on a feature of some plans only: the feature, the lowest plan that includes it, and whether the organization's plan does. Turning it on is refused when it doesn't; turning it off never is. Given by get_settings and update_settings
        - `staff[].setting.plan.feature` — string; required. 
        - `staff[].setting.plan.requiredTier` — string; required.  Allowed: "starter", "growth", "scale"
        - `staff[].setting.plan.included` — boolean; required. 
      - `staff[].setting.label` — string; required. 
      - `staff[].setting.setBelow` — integer; required. How many places below the organization set their own value for it minimum: 0; maximum: 9007199254740991
    - `staff[].timing` — array; required. 
      - `staff[].timing[]` — object; optional. 
        - `staff[].timing[].key` — string; required. 
        - `staff[].timing[].description` — string; required. 
        - `staff[].timing[].help` — string or null; optional. Plain staff help in dashboard input units, or null when no help is provided. Optional in the schema, always sent.
        - `staff[].timing[].value` — any value; required. 
        - `staff[].timing[].source` — object; required. 
          - `staff[].timing[].source.level` — string; required.  Allowed: "default", "organization", "entity", "location", "product", "productLocation", "session"
          - `staff[].timing[].source.id` — string or null; required. 
          - `staff[].timing[].source.locationId` — string; optional. 
        - `staff[].timing[].overriddenHere` — boolean; required. 
        - `staff[].timing[].canSetHere` — boolean; required. 
        - `staff[].timing[].plan` — object; optional. For a setting that turns on a feature of some plans only: the feature, the lowest plan that includes it, and whether the organization's plan does. Turning it on is refused when it doesn't; turning it off never is. Given by get_settings and update_settings
          - `staff[].timing[].plan.feature` — string; required. 
          - `staff[].timing[].plan.requiredTier` — string; required.  Allowed: "starter", "growth", "scale"
          - `staff[].timing[].plan.included` — boolean; required. 
        - `staff[].timing[].label` — string; required. 
        - `staff[].timing[].setBelow` — integer; required. How many places below the organization set their own value for it minimum: 0; maximum: 9007199254740991

### list_messages

List the messages Lokl sends (the send log), newest first: the notification (to guests: booking.confirmation, booking.reminder, booking.change, booking.menu_reminder and booking.menu_reminder_last, booking.day_of, booking.follow_up, booking.cancellation, booking.refund, booking.manage_link, booking.session_moved, booking.credit, booking.session_refund, booking.session_message; to staff: staff.refund_failed, staff.refund_exceeded (the card was refunded in the payment provider after part of it was already given back as a credit or gift certificate), and kitchen.sheet and kitchen.canceled, which belong to a session and are shown only across the organization), who it's to, when it was due and sent, and its status (scheduled, sent, skipped with the reason, failed). A skipped message's reason `suppressed` means its address bounced for good or complained (list_suppressions). Once sent, the email provider reports what happened to it: `deliveryStatus` (delivered, delayed, bounced with `bounceType` hard or soft, complained, failed) and when. Filter by order or status; page back with `before`. Which guest notifications go out, and the reminder's timing, are settings (confirmationEmail, reminderEmail, reminderHoursBefore, cancellationEmail, refundEmail, sessionMovedEmail, creditEmail, sessionRefundEmail, kitchenSheetEmail, changeEmail, menuReminderEmail with menuReminderDaysBefore, dayOfEmail with dayOfHour, followUpEmail with followUpHoursAfter and the googleReviewUrl and tripAdvisorReviewUrl it links).

Reads · Members of an organization · Needs bookings:read

#### Input

- `orderId` — string; optional. The order's id, from list_bookings or list_orders
- `status` — string; optional.  Allowed: "scheduled", "sent", "skipped", "failed"
- `limit` — integer; optional. The most results to return (default 50) minimum: 1; maximum: 100; default: 50
- `before` — string; optional. A message id; returns messages older than it

#### Output

- `messages` — array; required. 
  - `messages[]` — object; optional. 
    - `messages[].id` — string; required. 
    - `messages[].notification` — string; required. 
    - `messages[].channel` — string; required.  Allowed: "email"
    - `messages[].recipient` — string or null; required. Null without customers:contact
    - `messages[].orderId` — string or null; required. 
    - `messages[].bookingCode` — string or null; required. 
    - `messages[].status` — string; required.  Allowed: "scheduled", "sent", "skipped", "failed"
    - `messages[].sendAt` — string; required.  format: "date-time"
    - `messages[].sentAt` — string or null; required.  format: "date-time"
    - `messages[].skipReason` — string or null; required. 
    - `messages[].error` — string or null; required. What went wrong, which can name the address. Null without customers:contact
    - `messages[].deliveryStatus` — string or null; optional. What the email provider reported about a sent message; null until it does Allowed: "delayed", "delivered", "failed", "bounced", "complained"
    - `messages[].deliveryAt` — string or null; optional. When the provider reported deliveryStatus format: "date-time"
    - `messages[].bounceType` — string or null; optional. For a bounce: hard (the address doesn't exist) or soft (a full mailbox, say) Allowed: "hard", "soft"
    - `messages[].deliveryDetail` — string or null; optional. The provider's short word for why it bounced or was delayed. Null without customers:contact
- `nextBefore` — string or null; required. 
