---
title: "Create a push template"
method: POST
path: "/api/templates/push/upsert"
tags: ["templates"]
---

# Create a push template

`POST /api/templates/push/upsert`

Create a push template if it doesn't exist, otherwise update all push templates that match the name provided.

## Request body

- UpsertPushTemplateModel
  - `badge` string — Badge to set for push notification
  - `buttons` PushActionButton[] — Array of buttons that appear to respond to the push. Max of 3.
    - `action` PushAction
      - `data` string — The URL to open if the type is 'openUrl'
      - `type` string — The type of action. Leave empty to open the app, use 'openUrl' to open the url specified in the 'data' field, or enter a custom action handler defined in your app
    - `actionIcon` ActionIcon
      - `iconType` ActionIconType, required
      - `imageName` string, required
    - `buttonType` 'default' | 'destructive' | 'textInput' — Type of button
    - `identifier` string, required — Used to identify the button for event tracking
    - `inputPlaceholder` string — The input placeholder in the text box if this is a Text Input button
    - `inputTitle` string — The submit button text for the text box if this is a Text Input button
    - `openApp` boolean, required — Open the app if the button uses a customAction
    - `requiresUnlock` boolean — Whether the button requires the phone to be unlocked
    - `title` string, required — Title that will appear on the button
  - `cacheDataFeed` boolean — Cache data feed lookups for 1 hour
  - `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.
  - `dataFeedIds` number[] — Ids for data feeds used in template rendering
  - `deeplink` DeeplinkURI
    - `android` string
    - `ios` string
  - `interruptionLevel` 'passive' | 'active' | 'time-sensitive' | 'critical' — An interruption level helps iOS determine when to alert a user about the arrival of a push notification
  - `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.
  - `isSilentPush` boolean — Whether or not this is a silent push notification template
  - `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.
  - `mergeDataFeedContext` boolean — Merge data feed contents into user context, so fields can be referenced by {{field}} instead of [[field]]
  - `message` string — Push message
  - `messageTypeId` integer — Message Type Id
  - `name` string — Name of the template
  - `payload` JsObject
    - `underlying` object, required
  - `relevanceScore` number, double — Relevance score for iOS notifications on iOS 15+. Number is clamped between 0 and 1.0
  - `richMedia` RichMediaURL
    - `android` string
    - `ios` string
  - `sound` string — Sound
  - `title` string — Push message title
  - `wake` boolean — Set the content-available flag on iOS notifications, which will wake the app in the background

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