---
title: "Duplicate an SMS fragment"
method: POST
path: "/shop/sms-fragments/{smsFragmentId}/copy"
tags: ["SmsFragments"]
---

# Duplicate an SMS fragment

`POST /shop/sms-fragments/{smsFragmentId}/copy`

Creates a copy of an existing `SmsFragment` with new fields applied
from the request body. Useful when seeding similar messaging
content (e.g. variants for A/B testing, or per-offering overrides
of a shared template).

Requires the `SETTINGS_MANAGE` permission on the source fragment's
site, plus the `create` permission on `SmsFragment`. The copy is
created at the source's site.

## Request body

- object
  - `name` string — Internal label for the new copy. Conventionally the source's name suffixed with "(Copy)" or a variant tag.
  - `message_type` 'basket_confirmed' | 'basket_cancelled_with_charge' | 'basket_cancelled_without_charge' | 'basket_reminder' | 'basket_follow_up' | 'pay_by_link_request' — The type of message the SMS Fragment applies to. Defaults to the source's value.
  - `message` string, nullable — Contents of the SMS Fragment.
  - `priority` integer, nullable — Priority of the SMS Fragment. Fragments are concatenated in ascending priority order to build the final message.
  - `offerings` OfferingIdentifier[] — Offerings the SMS Fragment applies to. Empty/omitted means the fragment applies to no specific offerings (use the global fallback).
    - `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.

## Response `201`

The SMS Message Fragment was successfully retrieved

- object
  - `data` SmsFragment, required
    - `id` string, uuid, required — The ID of the SMS Fragment.
    - `name` string, required — The name of the SMS Fragment.
    - `message_type` 'basket_confirmed' | 'basket_cancelled_with_charge' | 'basket_cancelled_without_charge' | 'basket_reminder' | 'basket_follow_up' | 'pay_by_link_request' | 'billing_details_request', required — The type of message the SMS Fragment applies to.
    - `message` string, required — The contents of the SMS Fragment.
    - `priority` integer, required — The priority of the SMS Fragment. Fragments will be added to messages in ascending order.
    - `offerings` OfferingIdentifier[], required — An array of offerings which the SMS Fragment applies to. If empty, the SMS Fragment applies to no offerings.
      - `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.
    - `site_id` string, uuid, required — The ID of the site the SMS Fragment is associated with.
    - `organisation_id` string, uuid, required — The ID of the organisation the SMS Fragment is associated with.

## Other responses

- `401` — The user is unauthenticated
- `403` — The authenticated user does not have permission.
- `404` — The resource couldn't be found
- `422` — The request didn't pass validation

---

[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)
