Listar templates aprobados de la company
curl --request GET \
--url https://api.keebai.com/v1/templates \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.keebai.com/v1/templates"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.keebai.com/v1/templates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.keebai.com/v1/templates",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.keebai.com/v1/templates"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.keebai.com/v1/templates")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.keebai.com/v1/templates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"items": [
{
"id": "<string>",
"name": "<string>",
"language": "<string>",
"status": "<string>",
"category": "<string>",
"variables": [
"<string>"
],
"parameter_format": "<string>"
}
],
"page": 123,
"limit": 123,
"total": 123
}Templates
GET /v1/templates
Lists your tenant’s approved WhatsApp templates with their expected variables, paginated.
GET
/
v1
/
templates
Listar templates aprobados de la company
curl --request GET \
--url https://api.keebai.com/v1/templates \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.keebai.com/v1/templates"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.keebai.com/v1/templates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.keebai.com/v1/templates",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.keebai.com/v1/templates"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.keebai.com/v1/templates")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.keebai.com/v1/templates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"items": [
{
"id": "<string>",
"name": "<string>",
"language": "<string>",
"status": "<string>",
"category": "<string>",
"variables": [
"<string>"
],
"parameter_format": "<string>"
}
],
"page": 123,
"limit": 123,
"total": 123
}Returns the WhatsApp templates for your tenant. By default only
APPROVED ones, but you can filter by status. Each item includes the expected variables extracted from the template body, so you can build the right variables payload for POST /v1/messages with {"type": "template"} without keeping that list on your side.
Endpoint
GET https://api.keebai.com/v1/templates
Required scope
templates:read
Headers
| Header | Required | Value |
|---|---|---|
Authorization | Yes | Bearer kbai_pk_<token> |
Query params
| Param | Type | Default | Description |
|---|---|---|---|
page | number | 0 | Page number, 0-indexed. |
limit | number | 50 | Items per page, up to 100. |
status | string | APPROVED | PENDING, IN_REVIEW, APPROVED, REJECTED, PAUSED, DISABLED, IN_APPEAL. |
channel_id | string | — | ObjectId to filter by a specific channel. If omitted, returns templates across all channels in the tenant. |
Example request
curl "https://api.keebai.com/v1/templates?limit=20" \
-H "Authorization: Bearer kbai_pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
const params = new URLSearchParams({ limit: "20" });
const resp = await fetch(`https://api.keebai.com/v1/templates?${params}`, {
headers: { Authorization: `Bearer ${process.env.KEEBAI_API_TOKEN}` },
});
const { items } = await resp.json();
import os, requests
resp = requests.get(
"https://api.keebai.com/v1/templates",
params={"limit": 20},
headers={"Authorization": f"Bearer {os.environ['KEEBAI_API_TOKEN']}"},
timeout=10,
)
resp.raise_for_status()
items = resp.json()["items"]
Response
200 OK
{
"items": [
{
"id": "65f3a1b2c3d4e5f6a7b8c9d0",
"name": "welcome_v2",
"language": "es",
"status": "APPROVED",
"category": "MARKETING",
"parameter_format": "NAMED",
"variables": ["nombre", "monto"]
},
{
"id": "65f3a1b2c3d4e5f6a7b8c9d1",
"name": "appointment_reminder",
"language": "es",
"status": "APPROVED",
"category": "UTILITY",
"parameter_format": "NAMED",
"variables": ["nombre", "fecha", "hora"]
}
],
"page": 0,
"limit": 20,
"total": 2
}
| Field | Type | Description |
|---|---|---|
items[].id | string | Internal ObjectId of the template. |
items[].name | string | Template name exactly as registered in Meta. This is what you pass as template_name when sending. |
items[].language | string | Language code. |
items[].status | string | Template status in Meta. |
items[].category | string | MARKETING, UTILITY, AUTHENTICATION. |
items[].parameter_format | string | NAMED or POSITIONAL. We recommend new integrations stick to NAMED. |
items[].variables | string[] | Named variables detected in the template body. The keys of the variables object you send in a template message must match this list. |
page | number | Returned page. |
limit | number | Items per page. |
total | number | Total templates matching the filter. |
401 / 403 / 429
Standard auth, scope, and rate limit errors.How to use it in your integration
import os, requests
def fetch_template_meta(template_name: str) -> dict | None:
resp = requests.get(
"https://api.keebai.com/v1/templates",
params={"limit": 100},
headers={"Authorization": f"Bearer {os.environ['KEEBAI_API_TOKEN']}"},
timeout=10,
)
resp.raise_for_status()
for t in resp.json()["items"]:
if t["name"] == template_name:
return t
return None
template = fetch_template_meta("welcome_v2")
if template is None:
raise SystemExit("Template not approved yet")
required_vars = set(template["variables"])
provided = {"nombre": "Juan", "monto": "1500"}
if not required_vars.issubset(provided):
raise ValueError(f"Missing variables: {required_vars - set(provided)}")
Cache the
GET /v1/templates response for a few minutes in your integration. New templates don’t appear in production overnight: you create them in the portal and wait for Meta’s approval.Authorizations
Personal Access Token con prefijo kbai_pk_. Generar desde el portal con permiso developer.manage_tokens.
Query Parameters
Required range:
x <= 100Available options:
PENDING, IN_REVIEW, REJECTED, APPROVED, PAUSED, DISABLED, IN_APPEAL Was this page helpful?
⌘I