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

# Get template library

> Browse and filter Meta's global catalog of pre-approved WhatsApp message templates

Query Meta's official library of pre-approved message templates across industries, topics, languages, and use cases. Templates selected from the library can be provisioned into your WhatsApp Business Account immediately without waiting for custom review.

***

### Authentication

This endpoint requires Bearer token authentication.

```http theme={null}
Authorization: Bearer <token>
```

| Header          | Type     | Required | Description                                     | Format           |
| :-------------- | :------- | :------- | :---------------------------------------------- | :--------------- |
| `Authorization` | `string` | **Yes**  | Scoped organization API key or Bearer JWT token | `Bearer <token>` |

***

### Input parameters

<ParamField header="Authorization" type="string" required>
  Bearer token for authentication. Format: `Bearer <token>`.
</ParamField>

<ParamField query="channel_id" type="string" required>
  UUID of the registered WhatsApp channel used to authenticate against Meta Graph API.
</ParamField>

<ParamField query="search" type="string">
  Keyword search term for matching template titles, descriptions, and content.
</ParamField>

<ParamField query="topic" type="string">
  Filter by specific communication topic (e.g. `order_status`, `promotions`, `reservations`).
</ParamField>

<ParamField query="usecase" type="string">
  Filter by business use case (e.g. `lead_nurturing`, `abandoned_cart`, `appointment_booking`).
</ParamField>

<ParamField query="industry" type="string">
  Filter by target industry (e.g. `retail`, `ecommerce`, `financial_services`, `healthcare`).
</ParamField>

<ParamField query="language" type="string">
  Filter by language code (e.g. `en_US`, `es_ES`, `pt_BR`).
</ParamField>

<ParamField query="name" type="string">
  Filter by exact library template name.
</ParamField>

***

### Response Fields

Returns the Meta message template library payload containing template objects:

<ResponseField name="data" type="object[]">
  Array of pre-approved library template objects:

  <Expandable title="Library template attributes">
    <ResponseField name="id" type="string">Meta library template ID.</ResponseField>
    <ResponseField name="name" type="string">Library template slug name.</ResponseField>
    <ResponseField name="language" type="string">Language code.</ResponseField>
    <ResponseField name="category" type="string">Meta category (`MARKETING`, `UTILITY`).</ResponseField>
    <ResponseField name="topic" type="string">Subject topic.</ResponseField>
    <ResponseField name="usecase" type="string">Target use case.</ResponseField>
    <ResponseField name="industry" type="string">Industry classification.</ResponseField>
    <ResponseField name="header" type="object">Pre-configured header component details.</ResponseField>
    <ResponseField name="body" type="string">Pre-approved template message body with variables.</ResponseField>
    <ResponseField name="body_params" type="string[]">Expected positional body parameter keys.</ResponseField>
    <ResponseField name="buttons" type="object[]">Interactive quick-reply or call-to-action buttons.</ResponseField>
  </Expandable>
</ResponseField>

***

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET "https://api.sayvy.ai/api/v1/templates/library?channel_id=8f3b0e2a-71d3-4a5f-9e6b-123456789abc&industry=ecommerce&topic=order_status" \
    -H "Authorization: Bearer <token>"
  ```

  ```python Python theme={null}
  import requests

  url = "https://api.sayvy.ai/api/v1/templates/library"

  params = {
      "channel_id": "8f3b0e2a-71d3-4a5f-9e6b-123456789abc",
      "industry": "ecommerce",
      "topic": "order_status"
  }

  headers = {
      "Authorization": "Bearer <token>"
  }

  response = requests.get(url, params=params, headers=headers)
  print(response.status_code)
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    "https://api.sayvy.ai/api/v1/templates/library?channel_id=8f3b0e2a-71d3-4a5f-9e6b-123456789abc&industry=ecommerce",
    {
      method: "GET",
      headers: {
        "Authorization": "Bearer <token>"
      }
    }
  );

  const data = await response.json();
  console.log(data);
  ```

  ```java Java theme={null}
  HttpRequest request = HttpRequest.newBuilder()
      .uri(URI.create("https://api.sayvy.ai/api/v1/templates/library?channel_id=8f3b0e2a-71d3-4a5f-9e6b-123456789abc&industry=ecommerce"))
      .header("Authorization", "Bearer <token>")
      .GET()
      .build();

  HttpResponse<String> response =
      HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
  System.out.println(response.body());
  ```
</RequestExample>

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "data": [
      {
        "id": "meta_lib_tpl_001928",
        "name": "ecommerce_order_shipped_v1",
        "language": "en_US",
        "category": "UTILITY",
        "topic": "order_status",
        "usecase": "post_purchase",
        "industry": "ecommerce",
        "header": {
          "format": "TEXT",
          "text": "Your Order is on the Way!"
        },
        "body": "Hi {{1}}, your order #{{2}} has shipped via {{3}}. Track your package at: {{4}}",
        "body_params": ["customer_name", "order_id", "carrier", "tracking_url"],
        "buttons": [
          {
            "type": "URL",
            "text": "Track Package",
            "url": "{{1}}"
          }
        ]
      }
    ]
  }
  ```

  ```json 400 Bad Request theme={null}
  {
    "detail": "Could not get access token for this channel."
  }
  ```

  ```json 401 Unauthorized theme={null}
  {
    "detail": "Unauthorized"
  }
  ```
</ResponseExample>

***

<div
  style={{
display: "flex",
alignItems: "center",
justifyContent: "space-between",
backgroundColor: "rgba(255, 255, 255, 0.03)",
border: "1px solid rgba(255, 255, 255, 0.08)",
borderRadius: "16px",
padding: "10px 18px",
marginTop: "40px",
gap: "16px",
flexWrap: "wrap"
}}
>
  <a
    href="/api-reference/templates/sync-templates"
    style={{
display: "inline-flex",
alignItems: "center",
gap: "6px",
color: "#94A3B8",
textDecoration: "none",
fontSize: "14px",
fontWeight: "500",
padding: "4px 8px"
}}
  >
    <span style={{ fontSize: "16px" }}>‹</span> Previous
  </a>

  <div
    style={{
display: "flex",
alignItems: "center",
gap: "16px",
backgroundColor: "rgba(255, 255, 255, 0.04)",
border: "1px solid rgba(255, 255, 255, 0.06)",
borderRadius: "12px",
padding: "8px 16px",
marginLeft: "auto"
}}
  >
    <div style={{ textAlign: "right" }}>
      <div style={{ fontSize: "13px", fontWeight: "700", color: "#F8FAFC" }}>Create from library</div>

      <div style={{ fontSize: "11px", color: "#94A3B8", maxWidth: "260px", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>
        POST /api/v1/templates/library/\{template\_id}/create
      </div>
    </div>

    <div style={{ width: "1px", height: "24px", backgroundColor: "rgba(255, 255, 255, 0.1)" }} />

    <a
      href="/api-reference/templates/create-from-library"
      style={{
  display: "inline-flex",
  alignItems: "center",
  gap: "6px",
  color: "#94A3B8",
  textDecoration: "none",
  fontSize: "14px",
  fontWeight: "500"
}}
    >
      Next <span style={{ fontSize: "16px" }}>›</span>
    </a>
  </div>
</div>
