---
title: "Create 2FA Email message template"
method: POST
path: "/2fa/2/applications/{appId}/email/messages"
tags: ["platform", "2fa", "2fa-configuration", "manage-message-templates"]
---

# Create 2FA Email message template

`POST /2fa/2/applications/{appId}/email/messages`

## Request

- Base URL: `https://api.infobip.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.infobip.com/2fa/2/applications/{appId}/email/messages`
- Auth: one of:
  - HTTP basic
  - API key in header `Authorization`
  - API key in header `Authorization`
  - OAuth 2
    - Client credentials
    - Token URL: `https://api.infobip.com/auth/1/oauth2/token`

Once you have your [2FA application](#channels/sms/create-2fa-application), create one or more [Email message templates](https://www.infobip.com/docs/email/templates) where your PIN will be dynamically included when you send the PIN message over Email.

## Path parameters

- `appId` string, required

## Request body

- C3b21d2ffef2552e10577daa67c904ac80618665b001ef386a4faefc515e78f3CreateEmailMessageRequest
  - `emailTemplateId` integer, required: Email template ID that should reference a previously created [Broadcast template](https://www.infobip.com/docs/email/templates).
  - `from` string: The sender of the 2FA message, an email address with an optional sender name (e.g. `company@example.com` or `Jane Smith <jane.smith@somecompany.com>`).
  - `landingPageId` string: The ID of an opt out landing page to be used and displayed once an end user clicks the unsubscribe link. If not present, default opt out landing page will be displayed. Create a landing page in your Infobip account and use its ID, e.g., `1_23456`.
  - `pinLength` integer: PIN code length.
  - `pinType` 'NUMERIC' | 'ALPHA' | 'HEX' | 'ALPHANUMERIC'

## Response `200`

successful response

- C3b21d2ffef2552e10577daa67c904ac80618665b001ef386a4faefc515e78f3EmailMessage
  - `applicationId` string: The ID of the application that represents your service (e.g. 2FA for login, 2FA for changing the password, etc.) for which the requested message has been created.
  - `emailTemplateId` integer: Email template ID that should reference a previously created Email template.
  - `from` string: The sender of the 2FA message, an email address with an optional sender name (e.g. `company@example.com` or `Jane Smith <jane.smith@somecompany.com>`).
  - `landingPageId` string: Opt out landing page ID that should reference a previously created landing page template.
  - `messageId` string: The ID of the message template (message body with the PIN placeholder) that is sent to the recipient.
  - `pinLength` integer: PIN code length.
  - `pinType` 'NUMERIC' | 'ALPHA' | 'HEX' | 'ALPHANUMERIC'

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `429`: Too Many Requests
- `500`: Internal Server Error
- `4XX`: Error responses
- `5XX`: Error responses

---

[API](https://skmtc.dev/infobip/apis/infobip-openapi-specification.md) - [All operations](https://skmtc.dev/infobip/apis/infobip-openapi-specification/llms.txt) - [OpenAPI document](https://skmtc.dev/infobip/apis/infobip-openapi-specification/revisions/9dcbbaf902de?raw)
