Create Template

Use this API to create WhatsApp message templates, including text, media, call-to-action, quick reply, authentication, catalog, carousel, limited-time offer, multi-product, payment, and flow templates.

Endpoint details

FieldValue
URLhttps://apis.rmlconnect.net/wba/template/create
Authorizationjwt
API Keyjwt
Header parameter nameAuthorization
Request Body schemaapplication/json

Template type overview

Call To Action

Create templates with phone number and URL buttons.

Quick Reply Templates

Create templates with quick reply button options.

Media Template

Create templates with image, video, or document headers.

Text Template

Create text-based WhatsApp templates.

Auth Copycode

Create authentication templates with copy code OTP buttons.

Auth Autofill

Create authentication templates with one-tap autofill details.

Catalog Template

Create catalog templates.

Copy Code Template

Create copy code templates.

Carousel Template

Create carousel templates with cards and buttons.

Limited Time Offer Template

Create limited-time offer templates.

Multi Product Message Template

Create multi-product message templates.

Payment Order Details Template

Create payment order details templates.

Flow Creation Template

Create templates that launch a WhatsApp Flow.

Base request sample

{
  "components": {
    "body": {
      "text": "{body text}"
    },
    "buttons": {
      "elements": [
        {
          "contact_no": "{phone number with + and country code}",
          "label": "{phone number label}"
        },
        {
          "label": "{url label}",
          "type": "static/dynamic",
          "website": "{url with https}"
        }
      ],
      "type": "call_to_action"
    },
    "footer": {
      "text": "{footer text}"
    },
    "header": {
      "example": "{sample media url}",
      "type": "image/video/document"
    }
  },
  "language": [
    "{lang code}"
  ],
  "template_category": "ACCOUNT_UPDATE",
  "template_name": "{template name}",
  "template_type": "template"
}

Request body schema

FieldTypeDescription
componentsobject (wbatemplatecreate_components)The message components describe the template contents and include placeholders for dynamic variables.
languageArray of stringsLanguage code of language in which message text is written, such as "en" for English.
template_categorystringThe best notification category that fits your WhatsApp template. For example, MARKETING, AUTHENTICATION, UTILITY.
template_namestringUnique name of the WhatsApp message template that has only lowercase alphanumeric characters.
template_typestringThe type of media template that WhatsApp allows.

Template examples

2). Call To Action

Request Sample

{
  "template_name": "{template name}",
  "language": [
    "{lang code}"
  ],
  "template_type": "template",
  "template_category": "{template category}",
  "components": {
    "header": {
      "type": "image/video/document",
      "example": "{sample media url}"
    },
    "body": {
      "text": "{body text}"
    },
    "footer": {
      "text": "{footer text}"
    },
    "buttons": {
      "type": "call_to_action",
      "elements": [
        {
          "label": "{phone number label}",
          "contact_no": "{phone number with + and country code}"
        },
        {
          "label": "{url label}/{url label/{{1}}}",
          "type": "static/dynamic",
          "website": "{url with https}/{url with https/{{1}}}"
        }
      ]
    }
  }
}

Request Body schema

FieldTypeDescription
template_namestringName of the template.
languageArray of stringsLanguage code of language in which message text is written, such as "en" for English.
template_typestringThe type of media template that WhatsApp allows.
template_categorystringThe category of the template. Must be one of: MARKETING, UTILITY, AUTHENTICATION.
componentsobjectObject containing the components of the template.
3). Quick Reply Templates

Request Sample

{
  "template_name": "{template name}",
  "language": [
    "{lang code}"
  ],
  "template_type": "template",
  "template_category": "{template category}",
  "components": {
    "header": {
      "type": "image/video/document",
      "example": "{sample media url}"
    },
    "body": {
      "text": "{body text}"
    },
    "footer": {
      "text": "{footer text}"
    },
    "buttons": {
      "type": "quick_reply",
      "elements": [
        {
          "label": "{button 1 label}"
        },
        {
          "label": "{button 2 label}"
        },
        {
          "label": "{button 3 label}"
        }
      ]
    }
  }
}
4). Media Template

Request Sample

{
  "template_name": "{template name}",
  "language": [
    "{lang code}"
  ],
  "template_type": "template",
  "template_category": "ACCOUNT_UPDATE",
  "components": {
    "header": {
      "type": "image/video/document",
      "example": "{sample media url}"
    },
    "body": {
      "text": "{body text}"
    },
    "footer": {
      "text": "{footer text}"
    }
  }
}
5). Text Template

Request Sample

{
  "template_name": "{template name}",
  "language": [
    "{lang code}"
  ],
  "template_type": "template",
  "template_category": "{template category}",
  "components": {
    "body": {
      "text": "{body text}"
    },
    "footer": {
      "text": "{footer text}"
    }
  }
}
6). Auth Copycode

Request Sample

{
  "template_name": "{template name}",
  "language": [
    "{lang code}"
  ],
  "template_type": "template",
  "template_category": "AUTHENTICATION",
  "components": {
    "body": {
      "add_security_recommendation": "true/false"
    },
    "footer": {
      "code_expiration_minutes": {
        "code expiry upto 90mins": "string"
      }
    },
    "buttons": {
      "type": "OTP",
      "otp_type": "COPY_CODE",
      "text": "Copy Code"
    }
  }
}
7). Auth Autofill

Request Sample

{
  "template_name": "{template_name}",
  "language": [
    "{lang code}"
  ],
  "template_type": "template",
  "template_category": "AUTHENTICATION",
  "components": {
    "body": {
      "add_security_recommendation": "true/false"
    },
    "footer": {
      "code_expiration_minutes": {
        "upto 90 mins possible": "string"
      }
    },
    "buttons": {
      "type": "OTP",
      "otp_type": "ONE_TAP",
      "text": "Copy Code",
      "autofill_text": "Autofill",
      "package_name": "{package name of App}",
      "signature_hash": "{signature_hash of App}"
    }
  }
}
8). Catalog Template

Request Sample

{
  "template_name": "{template name}",
  "language": [
    "en"
  ],
  "template_category": "{template category}",
  "template_type": "{template type}",
  "components": {
    "body": {
      "text": "{body text}",
      "example": [
        "{example}"
      ]
    },
    "buttons": {
      "type": "{button type}",
      "elements": [
        {
          "type": "{button elements type}"
        }
      ]
    },
    "footer": {
      "text": "Thank You"
    }
  }
}
9). Copy Code Template

Request Sample

{
  "template_name": "{template name}",
  "language": [
    "en"
  ],
  "template_category": "{template category}",
  "template_type": "{ template type }",
  "components": {
    "body": {
      "text": "{body text}",
      "example": [
        "10"
      ]
    },
    "header": {
      "type": "{header type}",
      "text": "{header text}"
    },
    "buttons": {
      "type": "{button type}",
      "elements": [
        {
          "type": "{button element type}",
          "label": "{button element label}",
          "website": "{sample url}"
        },
        {
          "type": "{button element type}",
          "example": "{button text example}"
        }
      ]
    },
    "footer": {
      "text": "{footer text}"
    }
  }
}
10). Carousel Template

Request Sample

{
  "template_name": "{template name}",
  "language": [
    "{lang code}"
  ],
  "template_category": "{template category}",
  "template_type": "{template type}",
  "components": {
    "body": {
      "text": "{body text}",
      "example": [
        "100"
      ]
    },
    "cards": {
      "header_type": "{ card header type}",
      "header_example": "xxxxx://xxxxxxxxxxxx/200/300?xxxxxxxx",
      "button_types": [
        "{button type 1}",
        "{button type 2}"
      ],
      "elements": [
        {
          "body": {
            "text": "{element body text}",
            "example": [
              "{example 1}",
              "{example 2}"
            ]
          },
          "buttons": [
            {
              "type": "{element button type}",
              "text": "{element button text}"
            },
            {
              "type": "{element button type}",
              "label": "{element button label}",
              "website": "xxxxx://xxxxxxx/{{1}}",
              "website_example": "xxxxx://xxxxxxxxxx/client"
            }
          ]
        },
        {
          "body": {
            "text": "{element body text}",
            "example": [
              "{example 1}",
              "{example 2}"
            ]
          },
          "buttons": [
            {
              "type": "{element button type}",
              "text": "{element button text}"
            },
            {
              "type": "{element button type}",
              "label": "{element button label}",
              "website": "xxxxx://xxxxxxxx/{{1}}",
              "website_example": "xxxxx://xxxxxxx/student"
            }
          ]
        }
      ]
    }
  }
}
11). Limited Time Offer Template

Request Sample

{
  "template_name": "{template_name}",
  "language": [
    "{lang code}"
  ],
  "template_type": "template",
  "template_category": "MARKETING",
  "components": {
    "limited_time_offer": {
      "text": "{lto text}",
      "has_expiration": true
    },
    "body": {
      "text": "{body text}"
    },
    "buttons": {
      "type": "{button type}",
      "elements": [
        {
          "type": "{button element type}",
          "example": "{button element example}"
        },
        {
          "label": "{button element label}",
          "type": "{button element type}",
          "website": "xxxxx://xxxxxxxx/",
          "website_example": "xxxxx://xxxxxxxxxx/student"
        }
      ]
    }
  }
}
12). Multi Product Message Template

Request Sample

{
  "template_name": "{template_name}",
  "language": [
    "{lang code}"
  ],
  "template_type": "{template type}",
  "template_category": "{template category}",
  "components": {
    "header": {
      "type": "{header type}",
      "text": "{header text}"
    },
    "body": {
      "text": "{body text}"
    },
    "buttons": {
      "type": "{button  type}",
      "elements": [
        {
          "text": "{button element text}"
        }
      ]
    }
  }
}
13). Payment Order Details Template

Request Sample

{
  "template_name": "{template_name}",
  "language": [
    "{lang code}"
  ],
  "template_type": "{template type}",
  "template_category": "{template category}",
  "template_sub_category": "{template sub category}",
  "components": {
    "header": {
      "type": "{header type}",
      "text": "{header text}"
    },
    "body": {
      "text": "{body text}"
    },
    "footer": {
      "text": "{fotter text}"
    },
    "buttons": {
      "type": "{button  type}",
      "elements": [
        {
          "text": "{button element text}"
        }
      ]
    }
  }
}
14). Flow Creation Template

Request Sample

{
  "template_name": "{template_name}",
  "language": [
    "{lang code}"
  ],
  "template_type": "{template type}",
  "template_category": "{template category}",
  "components": {
    "header": {
      "type": "{header type}",
      "text": "{header text}"
    },
    "body": {
      "text": "{body text}"
    },
    "buttons": {
      "type": "{button  type}",
      "elements": [
        {
          "text": "{button element text}",
          "flow_id": "{flow id}",
          "navigation_screen": "{Flows Json screen name}",
          "flow_action": "{flow action}"
        }
      ]
    }
  }
}

Responses

200 Success

Response

{
  "id": "79804437842xxxx",
  "status": "APPROVED",
  "category": "MARKETING"
}

Response Schema: application/json

FieldTypeDescription
idstringThe unique identification of a template.
statusstringThe status of the template.
categorystringThe template category. Must be one of: MARKETING, UTILITY, AUTHENTICATION.
400 Bad Request

Response

{
  "message": "template with name : testdocum1 and language : ['en'] already exists."
}

Response Schema: application/json

FieldTypeDescription
messagestringThe message response.
401 Authentication Failure

Response

{
  "message": "unable to process campaign request",
  "reason": "jwt token expired",
  "status": "failure"
}

Response Schema: application/json

FieldTypeDescription
messagestringThe message response.
reasonstringThe reason for not processing a request.
statusstringThe status of the template.
404 Page Not Found

Response

{
  "message": "The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again."
}

Response Schema: application/json

FieldTypeDescription
messagestringThe message response.
422 Unprocessable Entity (WebDAV)

Response

{
  "template_category": [
    "Must be one of: MARKETING, UTILITY, AUTHENTICATION."
  ]
}

Response Schema: application/json

FieldTypeDescription
template_categoryArray of stringsThe template category. Must be one of: MARKETING, UTILITY, AUTHENTICATION.
500 Internal Server Error

Response

{
  "message": "Internal Server Error"
}

Response Schema: application/json

FieldTypeDescription
messagestringThe message response.


Did this page help you?