Get Templates

GET Method

The GET Template API allows you to fetch all the WhatsApp templates that are created using the Kaleyra APIs/UI associated with a WhatsApp Business Account (WABA) ID.

Prerequisites

  1. Before you get started, Create an API Key. To view the API Key and the SID, see View API Key and SID.
    A prerequisite for using Kaleyra WhatsApp APIs is to have an active WhatsApp plan on Kaleyra platform.
  2. To set up a WhatsApp account on Kaleyra platform, see Manual Signup
    and Embedded Signup.
  3. An active WhatsApp for Business API plan that includes:
    • A WhatsApp business number.
    • An associated profile with the business number.
    • A WhatsApp verified and approved profile.
    • A WABA ID onboarded on Kaleyra WhatsApp API V2.

Base URL

https://<api_domain>/v2/<SID>

API Domain and Value

api_domainValue
IN podapi.in.kaleyra.io
SG Podapi.ap.kaleyra.io
EU Podapi.eu.kaleyra.io
NA podapi.na.kaleyra.io

API request to get WhatsApp templates

To get a list of all the WhatsApp templates associated with a waba-id, use the <api_domain>/v2/<sid>/whatsapp/<waba-id>/message_templates endpoint.

Request Format

The following is the request format to get the WhatsApp templates:

curl --location --request GET https://<api_domain>/v2/<sid>/whatsapp/<waba-id>/message_templates \ 

Sample Request Format

The following is the sample request format to get the WhatsApp templates:

curl --location --request GET https://api.in.kaleyra.io/v2/HXAP16XXXXXX97IN/whatsapp/xxxxx48869xxxxx/message_templates

URL Parameters and Header Parameters

Following is the list of header parameters:

Parameter / HeadersData TypeDescriptionExampleMandatory?
sidStringAccount SID (Security Identifier).HXAP16XXXXXX97INYes
waba-idStringWhatsApp business account id.xxxxx48869xxxxxYes
Content-TypeStringIndicates the format of the content the API will be processing.The only allowed value is application/json.Yes
api-keyStringAPI key generated from Kaleyra platform account.Axxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx3Yes

Following is the list of query parameters:

Parameter

Data Type

Description

Example

Mandatory?

name

String

Fetches the template by name linked to the WABA provided.

Marketing_template

No

whatsapp_template_id

String

Fetches the template by unique WhatsApp Template ID.

ID83258xxxxx42871

No

status

String

Fetches the templates based on the status linked to the given WABA ID.
The following are the accepted values:

  • APPROVED
  • PENDING
  • REJECTED
  • PAUSED
  • DISABLED

Note: To fetch templates for multiple statuses, you can pass comma separated values.

approved

Yes

category

String

Fetches the templates based on category linked to the given WABA ID.
The following are the accepted values:

  • MARKETING
  • UTILITY
  • AUTHENTICATION

Note: To fetch templates for multiple categories, you can pass comma separated values.

Marketing

Yes

limit

Integer

Allows you to limit the number of templates being given as output. The default value is 25.

10

No

offset

Integer

If the GET response cannot be displayed on a single page, you can use the offset value to view the templates after that. The default value is 0.

0

No

fields

String

Allows you to fetch only particular fields for templates. The following are the accepted values:

  • name
  • language
  • status
  • category
  • components
  • whatsapp_template_id
  • previous_category
  • message_send_ttl_seconds
  • sub_category
  • reason

name

No

Sample Success Response

The following success message appears with the status 200 Accepted:

{
    "code": "WA200",
    "message": "Request Processed Successfully",
    "data": [
        {
            "allow_category_change": true,
            "category": "Marketing",
            "company_id": "app_company",
            "components": [
                {"type": "app_company",
      					"format": "TEXT",
      					"text": "Our sale is on!"
                }
            ],
            "language": "en_US",
            "name": "Mrkt_template",
            "previous_category": "marketing",
            "status": "approved",
            "waba_id": "xxxxx48869xxxxx",
            "whatsapp_template_id": "83258xxxxx42871"
        }
    ],
    "error": {},
    "limit": 10,
    "offset": 0,
    "count": 50
}

Response Parameters

The following is the list of parameters shown in the API response:

ParameterData TypeDescriptionExample
codeStringThe response code for the request sent.WA200
messageStringThe response message corresponding to the response code.Request Processed Successfully.
dataObjectThis object shows the details of the WhatsApp template details.See the specific table below for details.
errorArrayThe error list associated with the response.{ }
limitIntegerThe number of templates shown in the GET response. The default value is 25.10
offsetIntegerIf the GET response cannot be displayed on a single page, you can use the offset value to view the templates after that. The default value is 0.0
countIntegerThe count of the template in the response output.5

Data object Parameters

The following is the list of parameters for Data object in the API response.

ParameterData TypeDescriptionExample
allow_category_changeBooleanThis indicates, if the template allows the category to be changed after the template creation.True
categoryStringThe template categoryMarketing
company_idStringThe company id that is associated with the template.app_company
componentsObjectThis object lists the components of the template.See the specific table below for details.
languageStringThe language used in the template.En_US
nameStringThe name of the template.Marketing_template
previous_categoryStringThe template category that was assigned to the template prior to the category change.Authentication
statusStringThe approval status of the template.Approved
waba_idStringThe waba_id associated with the template15044XXXX142241
Whatsapp_template_idStringThe unique WhatsApp template ID.83258xxxxx42871

Components Object Parameters

The following is the list of parameters for Components object in the API response.

ParameterData TypeDescriptionExample
typeStringThe type of component within the template.Header, Body, Footer, and Buttons
formatStringThe format of the component.Text
textStringThe component text displayed in the component.Our Summer sale is on!
exampleObjectThis object shows an example of the component.See the specific table below for details.

Example Object Parameters

The following is the list of parameters for Example object in the API response.

ParameterData TypeDescriptionExample
Header_textStringThe header component text shown as an example.Our Summer sale is on!

Sample Failure Response

The following are the failure responses:

401 Unauthorized
{
    "code": "RBC001",
    "message": "Incorrect SID or API key.",
    "data": [],
    "error": {
        "error": "Incorrect SID or API key."
    }
}
401 Wrong account
{
    "code": "WA-401",
    "message": "API is not available for given customer.Please contact support for more info",
    "data": {},
    "error": "API is not available for given customer.Please contact support for more info"
}
 
401 Unauthorized WABA
{
    "code": "WA401",
    "message": "Waba_Id is not present or does not belong to the account.",
    "data": {},
    "error": {
        "waba_id": "Waba_Id is not present or does not belong to the account."
    }
}
401 Unauthorized WABA version
{
    "code": "WA401",
    "message": "The waba_id you're using is associated with different Version of our WA API. Please use the appropriate endpoint.",
    "data": {},
    "error": {
        "waba_id": "The waba_id you're using is associated with different Version of our WA API. Please use the appropriate endpoint."
    }
}
400 Invalid Status
{
    "code": "WA400",
    "message": "invalid status given. valid values are : accepted, pending, rejected, paused, disabled",
    "data": [],
    "error": {
        "status": "invalid status given. valid values are : accepted, pending, rejected, paused, disabled"
    }
}
400 Invalid Category
{
    "code": "WA400",
    "message": "invalid category given. valid values are : marketing, utility, authentication",
    "data": [],
    "error": {
        "category": "invalid category given. valid values are : marketing, utility, authentication"
    }
}
400 Invalid limit
{
    "code": "WA400",
    "message": "please provide a valid positive number",
    "data": [],
    "error": {
        "limit": "please provide a valid positive number"
    }
}
400 Invalid Offset
{
    "code": "WA400",
    "message": "please provide a valid positive number",
    "data": [],
    "error": {
        "offset": "please provide a valid positive number"
    }
}
500 Internal Server Error
{
    "code": "WA-500",
    "message": "Please try again later",
    "data": {},
    "error": {
        "error": "Internal server error"
    }
}





© 2026 Kaleyra Inc. All rights reserved.
Trademarks, logos and service marks displayed on this site are registered and unregistered trademarks of Kaleyra Inc.