---
title: "Create an SMS template"
method: POST
path: "/api/templates/sms/upsert"
tags: ["templates"]
---

# Create an SMS template

`POST /api/templates/sms/upsert`

Create an SMS template if it doesn't exist yet, otherwise update all SMS templates that match the name provided.

## Request body

- UpsertSMSTemplateModel
  - `campaignDataFields` object — Campaign-level data fields available as {{field}} merge parameters during message rendering. These fields are overridden by user and event data fields of the same name.
  - `clientTemplateId` string, required — ID used by the client to identify a template. If multiple templates exist with the ID, all will be updated
  - `creatorUserId` string — Specify a specific creator user id (email). The email must be an existing member of the project. Defaults to the organization creator.
  - `googleAnalyticsCampaignName` string — Google analytics utm_campaign value
  - `imageUrl` string — Image Url
  - `isDefaultLocale` boolean — Ask your Iterable CSM to enroll you in the beta for this feature. Sets the locale associated with the request content as the template’s default. If empty or flexible default locales are not enabled for the project, the project’s default locale is assigned.
  - `linkParams` LinkParam[] — Parameters to append to each URL in html contents
    - `key` string, required — Link parameter key
    - `value` string, required — Link parameter value
  - `locale` string — The locale for the content in this request. Leave empty for default locale. Iterable will automatically send the content with locale that matches a 'locale' field in the user profile.
  - `message` string — SMS message
  - `messageTypeId` integer — Message Type Id
  - `name` string — Name of the template

## Response `200`

successful operation

## Other responses

- `400` — Invalid parameters
- `401` — Invalid API key

---

[API](https://skmtc.net/iterable/apis/iterable-api.md) · [All operations](https://skmtc.net/iterable/apis/iterable-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/iterable/iterable-api/revisions/afaab604b58c/schema)
