---
title: "List message fragments"
method: GET
path: "/shop/message-fragments"
tags: ["MessageFragments"]
---

# List message fragments

`GET /shop/message-fragments`

Retrieves the message fragments configured for the given site.
Without `offering_id`, results are sorted alphabetically by
`name`. When `offering_id` is supplied, results are filtered to
fragments that apply to that offering and sorted by
`message_type` then ascending `priority` - the order they will
be rendered into the customer email.

## Query parameters

- `site_id` string, uuid, required
- `offering_id` string, mongo-id
- `page` integer
- `per_page` integer

## Response `200`

The message fragments were successfully retrieved.

- object
  - `data` MessageFragment[], required
    - `id` string, mongo-id, required — Unique identifier of the message fragment.
    - `name` string, required — Internal label for the fragment, shown in the admin UI when authoring email templates. Not visible to customers.
    - `message_type` 'basket_cancelled' | 'basket_confirmed' | 'basket_follow_up' | 'basket_item_cancelled' | 'basket_reminder' | 'order_summary' | 'pay_by_link_request' | 'appointment_enquiry_confirmed' | 'visit_prompt' | 'membership_welcome' | 'membership_cancelled' | 'voucher_recipient' | 'membership_enquiry_confirmed' | 'new_order' | 'new_enquiry', required — Which transactional email this fragment is included in. Fragments are only rendered into the matching message type.
    - `message` string, nullable, required — The body of the fragment. Accepts a restricted subset of HTML (basic block and inline tags) which is sanitised on save. Liquid-style placeholders such as `{{ customer.first_name }}` and `{{ booking.starts_at }}` are interpolated when the email is rendered.
    - `priority` integer, nullable, required — Render order within a message. Fragments are concatenated in ascending `priority` order, so lower numbers appear earlier in the email body. Use to control which paragraph leads.
    - `offerings` OfferingIdentifier[], required — Offerings this fragment applies to. When empty, the fragment applies to every offering at the site (a global fallback). When non-empty, the fragment is only included if the message's booking contains at least one matching offering.
      - `offering_id` string, mongo-id, required — The ID of the offering.
      - `offering_name` string, required — The name of the offering.
      - `offering_type` 'appointment' | 'appointment_enquiry' | 'area_booking' | 'course' | 'hotel_room_reservation' | 'membership' | 'package' | 'product' | 'session' | 'table_reservation' | 'voucher', required — Discriminator describing what kind of sellable item an `Offering` represents. The value determines which downstream schema (`Appointment`, `Session`, `Package`, etc.) the offering's `offering_id` resolves against, and which checkout/booking flow applies.
    - `permitted_membership_type_ids` string[], nullable, required — Optional list of `MembershipType` IDs. When set, the fragment is only rendered for customers who hold an active membership of one of these types - useful for member-only welcome copy, loyalty perks, or upgrade prompts. Empty/null means no membership filter applies.
    - `site_id` string, uuid, required — Site the fragment belongs to. Fragments are authored per-site so each location can tailor its email copy.
    - `organisation_id` string, uuid, required — Organisation that owns the site.
  - `meta` PaginationMeta, required — Counts and positional information for the current page of a list response. Use `current_page` and `last_page` to drive pagination UI, `total` for result counts, and `per_page` to confirm the page size the server actually applied (which may differ from the requested value when capped).
    - `from` integer, required — The item number from which this results set starts from
    - `to` integer, required — The item number from which this results set ends at
    - `total` integer, required — The total number of results
    - `current_page` integer, required — The current page number
    - `last_page` integer, required — The page number of the last result set
    - `per_page` integer, required — The number of results per page
    - `path` string, required — The path of this api request
  - `links` PaginationLinks, required — Hypermedia navigation links for paging through a list response. Each property is a fully-qualified URL that preserves the original query string (filters, sort, page size) and only swaps the `page` parameter. `next` and `prev` are `null` at the ends of the result set; `first` and `last` are always present.
    - `first` string, required — The url of the first page for the paginated results set
    - `next` string, nullable, required — The url of the next page for the paginated results set
    - `prev` string, nullable, required — The url of the previous page for the paginated results set
    - `last` string, required — The url of the last page for the paginated results set

## Other responses

- `401` — The user is unauthenticated
- `403` — The authenticated user does not have permission.

---

[API](https://skmtc.dev/try/apis/trybe-api.md) · [All operations](https://skmtc.dev/try/apis/trybe-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/try/trybe-api/revisions/f37f92702da5/schema)
