Skip to main content
GET
/
v1
/
templates
Listar templates aprobados de la company
curl --request GET \
  --url https://api.keebai.com/v1/templates \
  --header 'Authorization: Bearer <token>'
{
  "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/template without keeping that list on your side.

Endpoint

GET https://api.keebai.com/v1/templates

Required scope

templates:read

Headers

HeaderRequiredValue
AuthorizationYesBearer kbai_pk_<token>

Query params

ParamTypeDefaultDescription
pagenumber0Page number, 0-indexed.
limitnumber50Items per page, up to 100.
statusstringAPPROVEDPENDING, IN_REVIEW, APPROVED, REJECTED, PAUSED, DISABLED, IN_APPEAL.
channel_idstringObjectId 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"

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
}
FieldTypeDescription
items[].idstringInternal ObjectId of the template.
items[].namestringTemplate name exactly as registered in Meta. This is what you pass as template_name when sending.
items[].languagestringLanguage code.
items[].statusstringTemplate status in Meta.
items[].categorystringMARKETING, UTILITY, AUTHENTICATION.
items[].parameter_formatstringNAMED or POSITIONAL. We recommend new integrations stick to NAMED.
items[].variablesstring[]Named variables detected in the template body. The keys of the variables object you send in POST /v1/messages/template must match this list.
pagenumberReturned page.
limitnumberItems per page.
totalnumberTotal 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": "Lucio", "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

Authorization
string
header
required

Personal Access Token con prefijo kbai_pk_. Generar desde el portal con permiso developer.manage_tokens.

Query Parameters

page
number
default:0
limit
number
default:50
Required range: x <= 100
status
enum<string>
default:APPROVED
Available options:
PENDING,
IN_REVIEW,
REJECTED,
APPROVED,
PAUSED,
DISABLED,
IN_APPEAL
channel_id
string

Response

200 - application/json
items
object[]
required
page
number
required
limit
number
required
total
number
required