---
title: "Create an in-app template"
method: POST
path: "/api/templates/inapp/upsert"
tags: ["templates"]
---

# Create an in-app template

`POST /api/templates/inapp/upsert`

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

## Request body

- UpsertInAppTemplateModel
  - `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.
  - `expirationDateTime` string, date-time — Absolute expiration of message
  - `expirationDuration` string — Relative expiration of message
  - `html` string — Html of the in-app notification
  - `inAppDisplaySettings` InAppDisplaySettings
    - `bgColor` BgColor
      - `alpha` number — The opacity range of the background between 0-1
      - `hex` string — The hex color of the background. Format: #FFFFFF
    - `bottom` InAppDisplaySetting
    - `left` InAppDisplaySetting
    - `right` InAppDisplaySetting
    - `shouldAnimate` boolean — Enables In App Animations
    - `top` InAppDisplaySetting
  - `inboxMetadata` InboxMetadata
    - `icon` string — The icon to display in the inbox
    - `subtitle` string — The subtitle to display in the inbox
    - `title` string — The title to display in the inbox
  - `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.
  - `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.
  - `messageTypeId` integer — Message Type Id
  - `name` string — Name of the template
  - `payload` JsObject
    - `underlying` object, required
  - `webInAppDisplaySettings` WebInAppDisplaySettings
    - `position` PositionOption

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