# Create a template in project

Creates a new template with the request data.

Endpoint: POST /v1/projects/{projectId}/kakaotalk/senders/{plusFriendId}/templates
Version: 1.2.91
Security: BasicAuth, BearerAuth, OAuth2Production

## Path parameters:

  - `projectId` (string, required)
    The unique ID of the project. You can find this on the Sinch Dashboard.

  - `plusFriendId` (string, required)
    The unique ID of the sender.

## Request fields (application/json):

  - `details` (object, required)
    Template details and information.

  - `details.name` (string, required)
    Button name

  - `details.language` (string, required)
    Template language
    Enum: "AF", "AR", "AZ", "BG", "BN", "CA", "CS", "DA", "DE", "EL", "EN", "EN_GB", "EN_US", "ES", "ES_AR", "ES_ES", "ES_MX", "ET", "FA", "FI", "FIL", "FR", "GA", "GU", "HA", "HE", "HI", "HR", "HU", "ID", "IT", "JA", "KA", "KK", "KN", "KO", "KY_KG", "LO", "LT", "LV", "MK", "ML", "MR", "MS", "NB", "NL", "PA", "PL", "PT_BR", "PT_PT", "RO", "RU", "RW_RW", "SK", "SL", "SQ", "SR", "SV", "SW", "TA", "TE", "TH", "TR", "UK", "UR", "UZ", "VI", "ZH_CN", "ZH_HK", "ZH_TW", "ZU"

  - `details.content` (string, required)
    Template body Not required for draft.

  - `details.messageType` (string)
    Types of template message
    Enum: "AD_INCLUDED", "BASIC", "EXTRA_INFORMATION", "MIXED"

  - `details.emphasizeType` (string)
    Types of emphasized template
    Enum: "EMPHASIZE_TYPE_IMAGE", "EMPHASIZE_TYPE_NONE", "EMPHASIZE_TYPE_TEXT"

  - `details.categoryCode` (string)
    Template category code

  - `details.securityFlag` (boolean)
    Security template
  Set for security messages such as OTP
  If set, message text is unexposed to all devices except for the main device at the time of sending

  - `details.extra` (string)
    Additional template information

  - `details.title` (string)
    Template Title (No more than 50 characters,
    Android: To be abbreviated if it exceeds 2 lines with more than 23 characters,
    iOS: To be abbreviated if it exceeds 2 lines with more than 27 characters)

  - `details.subtitle` (string)
    Auxiliary Template Phrase (No more than 50 characters,
    Android: To be abbreviated if it exceeds 18 characters,
    iOS: To be abbreviated if it exceeds 21 characters)

  - `details.imageName` (string)
    Image name (name of uploaded file)

  - `details.imageUrl` (string)
    Image URL
- Supported mime types: image/jpeg or image/png.
- Maximum file size: 500KB.
- Minimum image dimensions: 500 x 250 px.
- Aspect ratio: 2 x 1.

  - `details.buttons` (array)
    List of buttons Field 'type' must have unique values across items.

  - `details.buttons.ordering` (number, required)
    Button sequence

  - `details.buttons.type` (string, required)
    Button type
    Enum: "APP_LINK", "BOT_FOR_CONSULTATION", "BOT_KEYWORD", "BOT_TRANSFER", "BUSINESS_FORM", "CHANNEL_ID_ADDED", "DELIVERY_SEARCH", "IMAGE_SECURE_TRANSMISSION_PLUGIN_ID", "MESSAGE_DELIVERY", "ONE_CLICK_PAYMENT_PLUGIN", "PERSONAL_INFORMATION_USE_PLUGIN_ID", "WEB_LINK"

  - `details.buttons.name` (string, required)
    Button name Not required for draft.

  - `details.buttons.linkMo` (string)
    Mobile web link

  - `details.buttons.linkPc` (string)
    PC web link

  - `details.buttons.schemeIos` (string)
    iOS app link

  - `details.buttons.schemeAndroid` (string)
    Android app link

  - `status` (string)
    Create as draft or submit. Defaults to submit.
    Enum: "DRAFT", "SUBMIT"

  - `saveDraftOnFailure` (boolean)
    Flag to save template as draft if submission fails. Defaults to false.

## Response 201 fields (application/json):

  - `code` (string, required)
    Registered delivery template code

  - `id` (string)
    The unique ID of the template.

  - `state` (string)
    The current state of the template.
    Enum: "APPROVED", "REJECTED"

  - `changes` (object)
    Any pending changes to the template.

  - `changes.status` (string, required)
    Current status of the pending changes
    Enum: "DRAFT", "IN_PROGRESS", "REJECTED"

  - `changes.details` (array, required) — one of:
    Template details and information.
    - KakaotalkTemplateDetailsDto:
      - `language` (string, required)
        Template language
        Enum: "AF", "AR", "AZ", "BG", "BN", "CA", "CS", "DA", "DE", "EL", "EN", "EN_GB", "EN_US", "ES", "ES_AR", "ES_ES", "ES_MX", "ET", "FA", "FI", "FIL", "FR", "GA", "GU", "HA", "HE", "HI", "HR", "HU", "ID", "IT", "JA", "KA", "KK", "KN", "KO", "KY_KG", "LO", "LT", "LV", "MK", "ML", "MR", "MS", "NB", "NL", "PA", "PL", "PT_BR", "PT_PT", "RO", "RU", "RW_RW", "SK", "SL", "SQ", "SR", "SV", "SW", "TA", "TE", "TH", "TR", "UK", "UR", "UZ", "VI", "ZH_CN", "ZH_HK", "ZH_TW", "ZU", "UNRECOGNIZED"
      - `messageType` (string, required)
        Types of template message
        Enum: "AD_INCLUDED", "BASIC", "EXTRA_INFORMATION", "MIXED", "TEMPLATE_MESSAGE_TYPE_UNSPECIFIED", "UNRECOGNIZED"
      - `emphasizeType` (string, required)
        Types of emphasized template
        Enum: "EMPHASIZE_TYPE_IMAGE", "EMPHASIZE_TYPE_NONE", "EMPHASIZE_TYPE_TEXT", "EMPHASIZE_TYPE_UNSPECIFIED", "UNRECOGNIZED"
      - `categoryCode` (string, required)
        Template category code
      - `securityFlag` (boolean, required)
        Security template
      - `name` (string, required)
        Button name
      - `buttons` (array, required)
        List of buttons
      - `buttons.ordering` (number)
        Button sequence
      - `buttons.type` (string)
        Button type
        Enum: "APP_LINK", "BOT_FOR_CONSULTATION", "BOT_KEYWORD", "BOT_TRANSFER", "BUSINESS_FORM", "BUTTON_TYPE_UNSPECIFIED", "CHANNEL_ID_ADDED", "DELIVERY_SEARCH", "IMAGE_SECURE_TRANSMISSION_PLUGIN_ID", "MESSAGE_DELIVERY", "ONE_CLICK_PAYMENT_PLUGIN", "PERSONAL_INFORMATION_USE_PLUGIN_ID", "WEB_LINK", "UNRECOGNIZED"
      - `buttons.name` (string)
        Button name
      - `buttons.linkMo` (string)
        Mobile web link
      - `buttons.linkPc` (string)
        PC web link
      - `buttons.schemeIos` (string)
        iOS app link
      - `buttons.schemeAndroid` (string)
        Android app link
      - `content` (string)
        Template body
      - `extra` (string)
        Additional template information
      - `ad` (string)
        Request for consent of receiving within template or simple ad phrases
      - `title` (string)
        Template title
      - `subtitle` (string)
        Auxiliary template phrase
      - `imageName` (string)
        Image name (name of uploaded file)
      - `imageUrl` (string)
        Image URL
    - KakaotalkTemplateChangesDetailsDto:
      - `language` (string)
        Template language
        Enum: same as `language` in "KakaotalkTemplateDetailsDto" (72 values)
      - `messageType` (string)
        Types of template message
        Enum: same as `messageType` in "KakaotalkTemplateDetailsDto" (6 values)
      - `emphasizeType` (string)
        Types of emphasized template
        Enum: same as `emphasizeType` in "KakaotalkTemplateDetailsDto" (5 values)
      - `categoryCode` (string)
        Template category code
      - `securityFlag` (boolean)
        Security template
      - `name` (string)
        Button name
      - `content` (string)
        Template body
      - `extra` (string)
        Additional template information
      - `ad` (string)
        Request for consent of receiving within template or simple ad phrases
      - `title` (string)
        Template title
      - `subtitle` (string)
        Auxiliary template phrase
      - `imageName` (string)
        Image name (name of uploaded file)
      - `imageUrl` (string)
        Image URL
      - `buttons` (array)
        List of buttons
      - `buttons.ordering` (number)
        Button sequence
      - `buttons.type` (string)
        Button type
        Enum: same as `buttons.type` in "KakaotalkTemplateDetailsDto" (14 values)
      - `buttons.name` (string)
        Button name
      - `buttons.linkMo` (string)
        Mobile web link
      - `buttons.linkPc` (string)
        PC web link
      - `buttons.schemeIos` (string)
        iOS app link
      - `buttons.schemeAndroid` (string)
        Android app link

  - `details` (object)
    Template details and information.

  - `details.language` (string, required)
    Template language
    Enum: same as `language` in "KakaotalkTemplateDetailsDto" (72 values)

  - `details.messageType` (string, required)
    Types of template message
    Enum: same as `messageType` in "KakaotalkTemplateDetailsDto" (6 values)

  - `details.emphasizeType` (string, required)
    Types of emphasized template
    Enum: same as `emphasizeType` in "KakaotalkTemplateDetailsDto" (5 values)

  - `details.categoryCode` (string, required)
    Template category code

  - `details.securityFlag` (boolean, required)
    Security template

  - `details.name` (string, required)
    Button name

  - `details.buttons` (array, required)
    List of buttons

  - `details.buttons.ordering` (number)
    Button sequence

  - `details.buttons.type` (string)
    Button type
    Enum: same as `buttons.type` in "KakaotalkTemplateDetailsDto" (14 values)

  - `details.buttons.name` (string)
    Button name

  - `details.buttons.linkMo` (string)
    Mobile web link

  - `details.buttons.linkPc` (string)
    PC web link

  - `details.buttons.schemeIos` (string)
    iOS app link

  - `details.buttons.schemeAndroid` (string)
    Android app link

  - `details.content` (string)
    Template body

  - `details.extra` (string)
    Additional template information

  - `details.ad` (string)
    Request for consent of receiving within template or simple ad phrases

  - `details.title` (string)
    Template title

  - `details.subtitle` (string)
    Auxiliary template phrase

  - `details.imageName` (string)
    Image name (name of uploaded file)

  - `details.imageUrl` (string)
    Image URL

  - `created` (string)
    The UTC Date Time in ISO 8601 for when the template was created.

  - `modified` (string)
    The UTC Date Time in ISO 8601 for when the template was last modified.

## Response 400 fields (application/json):

  - `body` (ProjectNotInitializedErrorTitle (object) or TemplateInvalidCategoryCodeErrorTitle (object) or InvalidPayloadErrorTitle (object)) — one of:
    - ProjectNotInitializedErrorTitle:
      - `errorCode` (string)
        Error code allows to programmatically handle errors.
        Example: "project_not_initialized"
      - `message` (string)
        Human readable message.
        Example: "Project not initialized for KakaoTalk."
      - `resolution` (string)
        Human readable message with an explanation of how to solve the error.
        Example: "Verify that the project ID is correct and that it has been onboarded for KakaoTalk."
    - TemplateInvalidCategoryCodeErrorTitle:
      - `errorCode` (string)
        Error code allows to programmatically handle errors.
        Example: "template_invalid_category_code"
      - `message` (string)
        Human readable message.
        Example: "Invalid template category code."
      - `resolution` (string)
        Human readable message with an explanation of how to solve the error.
        Example: "Verify that the template category code used is supported for the provided project."
    - InvalidPayloadErrorTitle:
      - `errorCode` (string)
        Error code allows to programmatically handle errors.
        Example: "invalid_payload"
      - `message` (string)
        Human readable message.
        Example: "Invalid payload."
      - `resolution` (string)
        Human readable message with an explanation of how to solve the error.
        Example: "Correct payload and submit again."

## Response 401 fields (application/json):

  - `errorCode` (string)
    Error code allows to programmatically handle errors.
    Example: "unauthorized_error"

  - `message` (string)
    Human readable message.
    Example: "Unauthorized error."

  - `resolution` (string)
    Human readable message with an explanation of how to solve the error.
    Example: "Verify that projectId is correct."

## Response 404 fields (application/json):

  - `errorCode` (string)
    Error code allows to programmatically handle errors.
    Example: "sender_not_found"

  - `message` (string)
    Human readable message.
    Example: "Sender not found."

  - `resolution` (string)
    Human readable message with an explanation of how to solve the error.
    Example: "Verify that the parameters are correct."

## Response 409 fields (application/json):

  - `errorCode` (string)
    Error code allows to programmatically handle errors.
    Example: "template_exists"

  - `message` (string)
    Human readable message.
    Example: "Template already exists."

  - `resolution` (string)
    Human readable message with an explanation of how to solve the error.
    Example: "Templates must have unique name. Change name and submit again."

## Response 424 fields (application/json):

  - `body` (TemplateKakaotalkValidationErrorErrorTitle (object)) — one of:
    - TemplateKakaotalkValidationErrorErrorTitle:
      - `errorCode` (string)
        Error code allows to programmatically handle errors.
        Example: "template_kakaotalk_validation_error"
      - `message` (string)
        Human readable message.
        Example: "Template kakaoTalk validation error: Some details from provider"
      - `resolution` (string)
        Human readable message with an explanation of how to solve the error.
        Example: "Please try again later. If template is saved as draft, try to submit the template again. If option \"saveDraftOnFailure\" is specified as \"false\", try the request again."
      - `additionalInformation` (object)
        Additional information for error.
    - TemplateKakaotalkValidationErrorErrorTitle:
      - `errorCode` (string)
        Error code allows to programmatically handle errors.
        Example: "template_kakaotalk_validation_error"
      - `message` (string)
        Human readable message.
        Example: "Template kakaoTalk validation error: Some details from provider"
      - `resolution` (string)
        Human readable message with an explanation of how to solve the error.
        Example: "Please try again later. If template is saved as draft, try to submit the template again. If option \"saveDraftOnFailure\" is specified as \"false\", try the request again."
      - `additionalInformation` (object)
        Additional information for error.
        Example: {"templateCode":"AX5NnkwWABRXG7LjDBGa"}

## Response 500 fields (application/json):

  - `body` (InternalErrorErrorTitle (object)) — one of:
    - InternalErrorErrorTitle:
      - `errorCode` (string)
        Error code allows to programmatically handle errors.
        Example: "internal_error"
      - `message` (string)
        Human readable message.
        Example: "Internal server error."
      - `resolution` (string)
        Human readable message with an explanation of how to solve the error.
        Example: "Please wait and try again, if the error persist please contact support. If template is saved as draft, try to submit the template again. If option \"saveDraftOnFailure\" is specified as \"false\", try the request again."
      - `additionalInformation` (object)
        Additional information for error.
    - InternalErrorErrorTitle:
      - `errorCode` (string)
        Error code allows to programmatically handle errors.
        Example: "internal_error"
      - `message` (string)
        Human readable message.
        Example: "Internal server error."
      - `resolution` (string)
        Human readable message with an explanation of how to solve the error.
        Example: "Please wait and try again, if the error persist please contact support. If template is saved as draft, try to submit the template again. If option \"saveDraftOnFailure\" is specified as \"false\", try the request again."
      - `additionalInformation` (object)
        Additional information for error.
        Example: {"templateCode":"templateCode"}
    - InternalErrorErrorTitle:
      - `errorCode` (string)
        Error code allows to programmatically handle errors.
        Example: "internal_error"
      - `message` (string)
        Human readable message.
        Example: "Internal server error."
      - `resolution` (string)
        Human readable message with an explanation of how to solve the error.
        Example: "Please wait and try again, if the error persist please contact support."


