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

# Get WhatsApp Templates

> This API retrieves a list of all active  Meta-approved WhatsApp message templates configured for a specified channel.

### Path Parameters

Required Path parameter is the **Encrypted Channel ID**, which can be found in the **WhatsApp Channel Settings** beneath the channel's name.

### Query Parameters

Query parameters can filter and organize the request:

 **Language**

- Enter the template's language code (en, he, es, etc.)
- Supports comma-separated values

**Category**

- Enter the WhatsApp template category (Marketing, Utility, Authentication)
- Supports comma-separated values

**Pagination (limit and offset)**

These optional query parameters help control and manage the returned WhatsApp templates by splitting them into smaller, manageable chunks.

- **limit** - Number of templates to return per request (default: 50, max: 200)
- **offset** - Page index indicating where to start retrieving results (0, 1, 2, ...). The starting point is calculated as: start_index = offset × limit  (default: 0)

Example:

If there are 50 templates and the limit = 20:

- offset = 0 → returns templates 1–20
- offset = 1 → returns templates 21–40
- offset = 2 → returns templates 41–50

### Response Payload

The response payload may include: 
-  Variable placeholders (e.g., {{1}}, {{2}})
- Header format types (TEXT, IMAGE, VIDEO, DOCUMENT)
- Button types (QUICK_REPLY, URL, PHONE).

**Note:**
- Only templates that are approved by Meta and active in CommBox are returned; Meta's quality status is not included in the response.
- The API returns the template business “friendly name” when defined. If not, it defaults to the official WhatsApp business name.
- Although offset conceptually represents skipped items, in this API it is page-based, not item-based.

### Request Examples:

All active and approved Marketing templates in English:

`GET /whatsapp/templates/Y0nJy1h_buU91T6QNroQ%3d?language=en&category=marketing`

Retrieving 20 active and approved templates – the 2nd batch of 20 out of 50:

 `GET /whatsapp/templates/Y0nJy1h_buU91T6QNroQ%3d?limit=20&offset=1` 

## OpenAPI

````json GET /whatsapp/templates/{ENCRYPTED_STREAM_ID}
{
  "openapi": "3.0.3",
  "info": {
    "title": "CommBox API",
    "x-logo": {
      "url": "https://www.commbox.io/logo/commbox_logo_large.png"
    },
    "version": "2.07",
    "termsOfService": "https://www.commbox.io/end-user-license-agreement-eula/",
    "contact": {
      "name": "commbox",
      "url": "https://www.commbox.io",
      "email": "contactus@commbox.io"
    }
  },
  "servers": [
    {
      "url": "https://api.commbox.io/",
      "description": "Production server"
    }
  ],
  "paths": {
    "/whatsapp/templates/{ENCRYPTED_STREAM_ID}": {
      "get": {
        "tags": [
          "WhatsApp"
        ],
        "summary": "Get WhatsApp Templates",
        "description": "This API retrieves a list of all active  Meta-approved WhatsApp message templates configured for a specified channel.\n\n### Path Parameters\n\nRequired Path parameter is the **Encrypted Channel ID**, which can be found in the **WhatsApp Channel Settings** beneath the channel's name.\n\n### Query Parameters\n\nQuery parameters can filter and organize the request:\n\n **Language**\n\n- Enter the template's language code (en, he, es, etc.)\n- Supports comma-separated values\n\n**Category**\n\n- Enter the WhatsApp template category (Marketing, Utility, Authentication)\n- Supports comma-separated values\n\n**Pagination (limit and offset)**\n\nThese optional query parameters help control and manage the returned WhatsApp templates by splitting them into smaller, manageable chunks.\n\n- **limit** - Number of templates to return per request (default: 50, max: 200)\n- **offset** - Page index indicating where to start retrieving results (0, 1, 2, ...). The starting point is calculated as: start_index = offset × limit  (default: 0)\n\nExample:\n\nIf there are 50 templates and the limit = 20:\n\n- offset = 0 → returns templates 1–20\n- offset = 1 → returns templates 21–40\n- offset = 2 → returns templates 41–50\n\n### Response Payload\n\nThe response payload may include: \n-  Variable placeholders (e.g., {{1}}, {{2}})\n- Header format types (TEXT, IMAGE, VIDEO, DOCUMENT)\n- Button types (QUICK_REPLY, URL, PHONE).\n\n**Note:**\n- Only templates that are approved by Meta and active in CommBox are returned; Meta's quality status is not included in the response.\n- The API returns the template business “friendly name” when defined. If not, it defaults to the official WhatsApp business name.\n- Although offset conceptually represents skipped items, in this API it is page-based, not item-based.\n\n### Request Examples:\n\nAll active and approved Marketing templates in English:\n\n`GET /whatsapp/templates/Y0nJy1h_buU91T6QNroQ%3d?language=en&category=marketing`\n\nRetrieving 20 active and approved templates – the 2nd batch of 20 out of 50:\n\n `GET /whatsapp/templates/Y0nJy1h_buU91T6QNroQ%3d?limit=20&offset=1` ",
        "operationId": "Get_WhatsApp_Templates",
        "parameters": [
          {
            "name": "ENCRYPTED_STREAM_ID",
            "in": "path",
            "description": "The encrypted ID of the channel",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "language",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Language code (en, he, es). Supports comma-separated values"
            }
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Enter Whatsapp template catagories:MARKETING, UTILITY, AUTHENTICATION. Supports comma-separated values"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "Pagination limit per page (default 50, max 200) "
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "Pagination offset per (default 0) "
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Operation successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": 200
                    },
                    "description": {
                      "type": "string",
                      "example": "Operation successful"
                    },
                    "response_time": {
                      "type": "string",
                      "description": "ISO 8601 timestamp of when the response was generated",
                      "example": "2026-02-02T10:30:00.258Z"
                    },
                    "data": {
                      "type": "object",
                      "description": "The main response payload.",
                      "properties": {
                        "templates": {
                          "type": "array",
                          "description": "List of Meta-approved WhatsApp message templates.",
                          "items": {
                            "type": "object",
                            "properties": {
                              "name": {
                                "type": "string",
                                "description": "Template's name",
                                "example": "order_confirmation"
                              },
                              "language": {
                                "type": "string",
                                "description": "Language code of the template.",
                                "example": "en"
                              },
                              "category": {
                                "type": "string",
                                "description": "Template category. Possible values: UTILITY, MARKETING, AUTHENTICATION",
                                "example": "UTILITY"
                              },
                              "status": {
                                "type": "string",
                                "description": "Approval status of the template. Only APPROVED templates are returned.",
                                "example": "APPROVED"
                              },
                              "components": {
                                "type": "object",
                                "properties": {
                                  "header": {
                                    "type": "object",
                                    "description": "Optional header component of the template.",
                                    "properties": {
                                      "format": {
                                        "type": "string",
                                        "example": "TEXT",
                                        "description": "Header format type. Possible values: TEXT, IMAGE, VIDEO, DOCUMENT."
                                      },
                                      "text": {
                                        "type": "string",
                                        "example": "Order {{1}}",
                                        "description": "Header text content, may include variable placeholders."
                                      },
                                      "variables": {
                                        "type": "array",
                                        "example": [
                                          "order_number"
                                        ],
                                        "description": "List of variable names mapped to placeholders in the header text."
                                      }
                                    }
                                  },
                                  "body": {
                                    "type": "object",
                                    "description": "Main body content of the template.",
                                    "properties": {
                                      "text": {
                                        "type": "string",
                                        "example": "Hi {{1}}, order {{2}} is confirmed.",
                                        "description": "Body text content, may include variable placeholders."
                                      },
                                      "variables": {
                                        "type": "array",
                                        "example": [
                                          "customer_name",
                                          "order_id"
                                        ],
                                        "description": "List of variable names mapped to placeholders in the body text, in order."
                                      }
                                    }
                                  },
                                  "footer": {
                                    "type": "object",
                                    "description": "Optional footer component of the template.",
                                    "properties": {
                                      "text": {
                                        "type": "string",
                                        "example": "Reply STOP to unsubscribe",
                                        "description": "Static footer text. Does not support variable placeholders."
                                      }
                                    }
                                  },
                                  "buttons": {
                                    "type": "array",
                                    "description": "Optional list of buttons attached to the template.",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "type": {
                                          "type": "string",
                                          "example": "QUICK_REPLY",
                                          "description": "Button type. Possible values: QUICK_REPLY, URL, PHONE."
                                        },
                                        "text": {
                                          "type": "string",
                                          "example": "Track Order",
                                          "description": "Display label of the button."
                                        }
                                      }
                                    }
                                  }
                                }
                              },
                              "meta_template_id": {
                                "type": "string",
                                "example": "1234567890",
                                "description": "Unique template ID assigned by Meta."
                              }
                            }
                          }
                        },
                        "pagination": {
                          "type": "object",
                          "description": "Pagination metadata for the current response.",
                          "properties": {
                            "total": {
                              "type": "integer",
                              "example": 45,
                              "description": "Total number of approved templates available for this channel."
                            },
                            "limit": {
                              "type": "integer",
                              "example": 50,
                              "description": "Maximum number of templates requested per page."
                            },
                            "offset": {
                              "type": "integer",
                              "example": 0,
                              "description": "Number of templates skipped. 0 indicates the first page."
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request, could not process the input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "400",
                  "description": "Missing parameter templateName",
                  "response_time": "2026-08-06T07:51:52.2581942Z"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - The supplied credentials, if any, are not sufficient to access the resource",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "integer",
                      "example": 401
                    },
                    "description": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "response_time": {
                      "type": "string",
                      "format": "date-time",
                      "example": "2026-02-06T07:51:52.2581942Z"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found - The requested resource is not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "integer",
                      "example": 404
                    },
                    "description": {
                      "type": "string",
                      "example": "Not Found"
                    },
                    "response_time": {
                      "type": "string",
                      "format": "date-time",
                      "example": "2026-02-06T07:51:52.2581942Z"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests - Too many requests have been made in a short period of time (Throttling)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "integer",
                      "example": 429
                    },
                    "description": {
                      "type": "string",
                      "example": "Too Many Requests"
                    },
                    "response_time": {
                      "type": "string",
                      "format": "date-time",
                      "example": "2026-02-06T07:51:52.2581942Z"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server Error - The server could not return the representation due to an internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "integer",
                      "example": 500
                    },
                    "description": {
                      "type": "string",
                      "example": "Internal Server Error"
                    },
                    "response_time": {
                      "type": "string",
                      "format": "date-time",
                      "example": "2026-02-06T07:51:52.2581942Z"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "Error status code as string",
            "example": "400"
          },
          "description": {
            "type": "string",
            "description": "Human-readable description of the error",
            "example": "Missing parameter templateName"
          },
          "response_time": {
            "type": "string",
            "description": "Timestamp of the response",
            "example": "2024-08-06T07:51:52.2581942Z"
          },
          "data": {
            "type": "array",
            "description": "Array of recipient error details",
            "items": {
              "type": "object",
              "properties": {
                "recipient": {
                  "type": "string",
                  "description": "Recipient's phone number",
                  "example": "9725551234"
                },
                "status": {
                  "type": "integer",
                  "description": "Error status code",
                  "example": 400
                },
                "failed": {
                  "type": "string",
                  "description": "Failure reason",
                  "example": "Missing required parameter"
                }
              }
            }
          }
        },
        "required": [
          "status",
          "description",
          "response_time"
        ]
      }
    }
  }
}
````

