> ## Documentation Index
> Fetch the complete documentation index at: https://docs.heyy.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Create message template



## OpenAPI

````yaml /api-reference/openapi-v3.json post /message_templates
openapi: 3.1.0
info:
  title: Heyy API
  version: 3.0.0
servers:
  - url: https://api.heyy.io/v3
security:
  - bearerAuth: []
paths:
  /message_templates:
    post:
      summary: Create message template
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - type: object
                  properties:
                    channelId:
                      type: string
                      format: uuid
                    name:
                      type: string
                    type:
                      type: string
                      enum:
                        - whatsapp
                    messageContent:
                      type: object
                      properties:
                        body:
                          type: string
                        code:
                          type: string
                        attachments:
                          type: array
                          items:
                            oneOf:
                              - type: object
                                properties:
                                  type:
                                    type: string
                                    enum:
                                      - image
                                  fileId:
                                    type: string
                                    format: uuid
                                required:
                                  - type
                                  - fileId
                              - type: object
                                properties:
                                  type:
                                    type: string
                                    enum:
                                      - video
                                  fileId:
                                    type: string
                                    format: uuid
                                required:
                                  - type
                                  - fileId
                              - type: object
                                properties:
                                  type:
                                    type: string
                                    enum:
                                      - document
                                  fileId:
                                    type: string
                                    format: uuid
                                required:
                                  - type
                                  - fileId
                              - oneOf:
                                  - type: object
                                    properties:
                                      type:
                                        type: string
                                        enum:
                                          - button
                                      buttonType:
                                        type: string
                                        enum:
                                          - quick_reply
                                      text:
                                        type: string
                                    required:
                                      - type
                                      - buttonType
                                      - text
                                  - type: object
                                    properties:
                                      type:
                                        type: string
                                        enum:
                                          - button
                                      buttonType:
                                        type: string
                                        enum:
                                          - url
                                      text:
                                        type: string
                                      url:
                                        type: string
                                        minLength: 1
                                    required:
                                      - type
                                      - buttonType
                                      - text
                                      - url
                                  - type: object
                                    properties:
                                      type:
                                        type: string
                                        enum:
                                          - button
                                      buttonType:
                                        type: string
                                        enum:
                                          - phone_number
                                      text:
                                        type: string
                                      phoneNumber:
                                        type: string
                                    required:
                                      - type
                                      - buttonType
                                      - text
                                      - phoneNumber
                                  - type: object
                                    properties:
                                      type:
                                        type: string
                                        enum:
                                          - button
                                      buttonType:
                                        type: string
                                        enum:
                                          - list_title
                                      text:
                                        type: string
                                    required:
                                      - type
                                      - buttonType
                                      - text
                        header:
                          type: string
                        footer:
                          type: string
                    vendorDetails:
                      type: object
                      properties:
                        type:
                          type: string
                          enum:
                            - whatsapp
                        language:
                          type: string
                          enum:
                            - af
                            - sq
                            - ar
                            - az
                            - bn
                            - bg
                            - ca
                            - zh_CN
                            - zh_HK
                            - zh_TW
                            - hr
                            - cs
                            - da
                            - nl
                            - en
                            - en_GB
                            - en_US
                            - et
                            - fil
                            - fi
                            - fr
                            - ka
                            - de
                            - el
                            - gu
                            - ha
                            - he
                            - hi
                            - hu
                            - id
                            - ga
                            - it
                            - ja
                            - kn
                            - kk
                            - rw_RW
                            - ko
                            - ky_KG
                            - lo
                            - lv
                            - lt
                            - mk
                            - ms
                            - ml
                            - mr
                            - nb
                            - fa
                            - pl
                            - pt_BR
                            - pt_PT
                            - pa
                            - ro
                            - ru
                            - sr
                            - sk
                            - sl
                            - es
                            - es_AR
                            - es_ES
                            - es_MX
                            - sw
                            - sv
                            - ta
                            - te
                            - th
                            - tr
                            - uk
                            - ur
                            - uz
                            - vi
                            - zu
                        category:
                          type: string
                          enum:
                            - authentication
                            - marketing
                            - utility
                        addSecurityRecommendation:
                          type: boolean
                        codeExpirationMinutes:
                          type: integer
                          minimum: 1
                          maximum: 90
                        copyCodeButtonText:
                          type: string
                          maxLength: 25
                        otpType:
                          type: string
                          enum:
                            - copy_code
                            - one_tap
                            - zero_tap
                        autofillButtonText:
                          type: string
                          maxLength: 25
                        zeroTapTermsAccepted:
                          type: boolean
                        supportedApps:
                          type: array
                          items:
                            type: object
                            properties:
                              packageName:
                                type: string
                                minLength: 1
                              signatureHash:
                                type: string
                                minLength: 11
                                maxLength: 11
                            required:
                              - packageName
                              - signatureHash
                          maxItems: 5
                      required:
                        - type
                        - language
                        - category
                  required:
                    - channelId
                    - name
                    - type
                    - messageContent
                    - vendorDetails
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                      createdAt:
                        type: string
                        format: date-time
                      updatedAt:
                        type: string
                        format: date-time
                      name:
                        type: string
                      type:
                        type: string
                        enum:
                          - whatsapp
                      status:
                        type: string
                        enum:
                          - in_review
                          - active
                          - rejected
                          - unavailable
                      vendorId:
                        type: string
                      messageContent:
                        type: object
                        properties:
                          body:
                            type: string
                          code:
                            type: string
                          attachments:
                            type: array
                            items:
                              anyOf:
                                - type: object
                                  properties:
                                    id:
                                      type: string
                                    type:
                                      type: string
                                      enum:
                                        - image
                                        - video
                                        - document
                                    fileId:
                                      type: string
                                    file:
                                      type:
                                        - object
                                        - 'null'
                                      properties:
                                        id:
                                          type: string
                                        createdAt:
                                          type: string
                                        type:
                                          type: string
                                          enum:
                                            - image
                                            - video
                                            - audio
                                            - document
                                        name:
                                          type: string
                                        contentType:
                                          type: string
                                        url:
                                          type: string
                                        size:
                                          type: number
                                      required:
                                        - id
                                        - createdAt
                                        - type
                                        - name
                                        - contentType
                                        - url
                                        - size
                                  required:
                                    - id
                                    - type
                                    - fileId
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      enum:
                                        - button
                                    buttonType:
                                      type: string
                                      enum:
                                        - quick_reply
                                    text:
                                      type: string
                                    id:
                                      type: string
                                  required:
                                    - type
                                    - buttonType
                                    - text
                                    - id
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      enum:
                                        - button
                                    buttonType:
                                      type: string
                                      enum:
                                        - url
                                    text:
                                      type: string
                                    url:
                                      type: string
                                      minLength: 1
                                    id:
                                      type: string
                                  required:
                                    - type
                                    - buttonType
                                    - text
                                    - url
                                    - id
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      enum:
                                        - button
                                    buttonType:
                                      type: string
                                      enum:
                                        - phone_number
                                    text:
                                      type: string
                                    phoneNumber:
                                      type: string
                                    id:
                                      type: string
                                  required:
                                    - type
                                    - buttonType
                                    - text
                                    - phoneNumber
                                    - id
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      enum:
                                        - button
                                    buttonType:
                                      type: string
                                      enum:
                                        - list_title
                                    text:
                                      type: string
                                    id:
                                      type: string
                                  required:
                                    - type
                                    - buttonType
                                    - text
                                    - id
                          header:
                            type: string
                          footer:
                            type: string
                      variables:
                        type: array
                        items:
                          type: string
                      vendorDetails:
                        type: object
                        properties:
                          name:
                            type: string
                          language:
                            type: string
                            enum:
                              - af
                              - sq
                              - ar
                              - az
                              - bn
                              - bg
                              - ca
                              - zh_CN
                              - zh_HK
                              - zh_TW
                              - hr
                              - cs
                              - da
                              - nl
                              - en
                              - en_GB
                              - en_US
                              - et
                              - fil
                              - fi
                              - fr
                              - ka
                              - de
                              - el
                              - gu
                              - ha
                              - he
                              - hi
                              - hu
                              - id
                              - ga
                              - it
                              - ja
                              - kn
                              - kk
                              - rw_RW
                              - ko
                              - ky_KG
                              - lo
                              - lv
                              - lt
                              - mk
                              - ms
                              - ml
                              - mr
                              - nb
                              - fa
                              - pl
                              - pt_BR
                              - pt_PT
                              - pa
                              - ro
                              - ru
                              - sr
                              - sk
                              - sl
                              - es
                              - es_AR
                              - es_ES
                              - es_MX
                              - sw
                              - sv
                              - ta
                              - te
                              - th
                              - tr
                              - uk
                              - ur
                              - uz
                              - vi
                              - zu
                          category:
                            type: string
                            enum:
                              - authentication
                              - marketing
                              - utility
                          status:
                            type: string
                            enum:
                              - pending
                              - in_appeal
                              - approved
                              - rejected
                              - pending_deletion
                              - deleted
                              - disabled
                              - paused
                              - limit_exceeded
                          addSecurityRecommendation:
                            type: boolean
                          codeExpirationMinutes:
                            type: integer
                            minimum: 1
                            maximum: 90
                          copyCodeButtonText:
                            type: string
                          otpType:
                            type: string
                            enum:
                              - copy_code
                              - one_tap
                              - zero_tap
                          autofillButtonText:
                            type: string
                          zeroTapTermsAccepted:
                            type: boolean
                          supportedApps:
                            type: array
                            items:
                              type: object
                              properties:
                                packageName:
                                  type: string
                                signatureHash:
                                  type: string
                              required:
                                - packageName
                                - signatureHash
                        required:
                          - name
                          - language
                          - category
                          - status
                      channelId:
                        type: string
                    required:
                      - id
                      - createdAt
                      - updatedAt
                      - name
                      - type
                      - status
                      - vendorId
                      - messageContent
                      - variables
                      - vendorDetails
                      - channelId
                    additionalProperties: false
                required:
                  - success
                  - data
                additionalProperties: false
              example:
                success: true
                data:
                  id: string
                  createdAt: '2024-01-01T00:00:00.000Z'
                  updatedAt: '2024-01-01T00:00:00.000Z'
                  name: string
                  type: whatsapp
                  status: in_review
                  vendorId: string
                  messageContent:
                    body: string
                    code: string
                    attachments: []
                    header: string
                    footer: string
                  variables: []
                  vendorDetails:
                    name: string
                    language: af
                    category: authentication
                    status: pending
                    addSecurityRecommendation: true
                    codeExpirationMinutes: 0
                    copyCodeButtonText: string
                    otpType: copy_code
                    autofillButtonText: string
                    zeroTapTermsAccepted: true
                    supportedApps: []
                  channelId: string
        '400':
          description: Bad request. The request body or parameters are invalid.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: object
                    properties:
                      messageKey:
                        type: string
                      message:
                        type: string
                      invalidParams:
                        type: object
                        additionalProperties:
                          type: object
                          properties:
                            key:
                              type: string
                            message:
                              type: string
                          required:
                            - key
                            - message
                required:
                  - success
                additionalProperties: false
              example:
                success: false
                error:
                  messageKey: invalid_body_params
                  message: Invalid body params
                  invalidParams:
                    email:
                      key: invalid_string
                      message: Invalid email
        '401':
          description: Unauthorized. A valid API key is required.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: object
                    properties:
                      messageKey:
                        type: string
                      message:
                        type: string
                      invalidParams:
                        type: object
                        additionalProperties:
                          type: object
                          properties:
                            key:
                              type: string
                            message:
                              type: string
                          required:
                            - key
                            - message
                required:
                  - success
                additionalProperties: false
              example:
                success: false
                error:
                  messageKey: unauthorized
                  message: Unauthorized
        '402':
          description: >-
            Payment required. The current billing plan does not allow this
            request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: object
                    properties:
                      messageKey:
                        type: string
                      message:
                        type: string
                      invalidParams:
                        type: object
                        additionalProperties:
                          type: object
                          properties:
                            key:
                              type: string
                            message:
                              type: string
                          required:
                            - key
                            - message
                required:
                  - success
                additionalProperties: false
              example:
                success: false
                error:
                  messageKey: insufficient_billing_plan
                  message: Insufficient billing plan
        '403':
          description: >-
            Forbidden. The API key does not have permission to perform this
            action.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: object
                    properties:
                      messageKey:
                        type: string
                      message:
                        type: string
                      invalidParams:
                        type: object
                        additionalProperties:
                          type: object
                          properties:
                            key:
                              type: string
                            message:
                              type: string
                          required:
                            - key
                            - message
                required:
                  - success
                additionalProperties: false
              example:
                success: false
                error:
                  messageKey: forbidden
                  message: Forbidden
        '404':
          description: Not found. The requested resource does not exist.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: object
                    properties:
                      messageKey:
                        type: string
                      message:
                        type: string
                      invalidParams:
                        type: object
                        additionalProperties:
                          type: object
                          properties:
                            key:
                              type: string
                            message:
                              type: string
                          required:
                            - key
                            - message
                required:
                  - success
                additionalProperties: false
              example:
                success: false
                error:
                  messageKey: contact_not_found
                  message: Contact not found
        '429':
          description: >-
            Too many requests. Retry after the time indicated by the
            X-RateLimit-Reset header.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: object
                    properties:
                      messageKey:
                        type: string
                      message:
                        type: string
                      invalidParams:
                        type: object
                        additionalProperties:
                          type: object
                          properties:
                            key:
                              type: string
                            message:
                              type: string
                          required:
                            - key
                            - message
                required:
                  - success
                additionalProperties: false
              example:
                success: false
                error:
                  messageKey: too_many_requests
                  message: >-
                    Too many requests. Limit is applied per minute per tenant.
                    Please retry after the time indicated by the
                    X-RateLimit-Reset header.
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: object
                    properties:
                      messageKey:
                        type: string
                      message:
                        type: string
                      invalidParams:
                        type: object
                        additionalProperties:
                          type: object
                          properties:
                            key:
                              type: string
                            message:
                              type: string
                          required:
                            - key
                            - message
                required:
                  - success
                additionalProperties: false
              example:
                success: false
                error:
                  messageKey: internal_error
                  message: Oops! Something went wrong
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````