# Use Meta's WhatsApp template library from the API

> Browse Meta's WhatsApp template library, create a template from library_template_name with button inputs, and pass the parameter checks at send time.

Published 2026-11-04. Z-API Omni team.

Meta's WhatsApp template library is a set of pre-written templates with fixed content. You browse it with `GET /message_template_library`. You copy one into your account with `POST /<WHATSAPP_BUSINESS_ACCOUNT_ID>/message_templates`, passing `library_template_name`, `category: UTILITY` and any button inputs. Meta's example response comes back `APPROVED`. Customizing the template in WhatsApp Manager sends it to review. At send time, Meta checks every parameter value against its type and length.

## What the library contains

Meta's page says the library covers "utility templates for common use cases" and "authentication templates for common identity verification use cases" ([template library, accessed 2026-11-04](https://developers.facebook.com/documentation/business-messaging/whatsapp/templates/template-library)). "Library templates contain fixed content that cannot be edited." What you fill in are the parameters, such as names, addresses and phone numbers.

A template created this way carries a `library_template_name` field. Read it with `GET /<WHATSAPP_BUSINESS_ACCOUNT_ID>/message_templates?name=TEMPLATE_NAME`. Its presence means the template "is subject to type checks and restrictions". The template node reference lists `library_template_name` as a readable field ([message template reference, accessed 2026-11-04](https://developers.facebook.com/docs/graph-api/reference/whats-app-business-hsm/)).

The authentication part is unresolved. The create API says `category` "Must be `UTILITY` for use with Template Library". Meta's [authentication templates page](https://developers.facebook.com/documentation/business-messaging/whatsapp/templates/authentication-templates/authentication-templates) (accessed 2026-11-04) doesn't mention the library. The OTP button fields and a name example like `verify_otp_usecase` hint at authentication support, but no page shows the call. Until Meta documents it, build one-time passcode templates the documented way, as in [authentication templates with a copy code button](/academy/articles/whatsapp-authentication-templates-otp-copy-code/).

Forms are a second unresolved area. Library form templates "are only available to accounts who have had their message limits increased". The supported use cases are Customer Feedback and Delivery Failure. Meta's prose says their buttons show `"type": "FORMS"`, while its sample shows `"type": "FLOW"`. Check for both. Meta's sample button is a `FLOW` button; Flows are covered in [WhatsApp Flows: forms inside the chat](/academy/articles/whatsapp-flows-forms-inside-chat/).

## Browse the library

`GET /message_template_library` takes these filters.

| Parameter | Values |
| --- | --- |
| `search` | Substring matched against content, name, header, body or footer |
| `topic` | `ACCOUNT_UPDATE`, `CUSTOMER_FEEDBACK`, `ORDER_MANAGEMENT`, `PAYMENTS` |
| `usecase` | `ACCOUNT_CREATION_CONFIRMATION`, `AUTO_PAY_REMINDER`, `DELIVERY_CONFIRMATION`, `DELIVERY_FAILED`, `DELIVERY_UPDATE`, `FEEDBACK_SURVEY`, `FRAUD_ALERT`, `LOW_BALANCE_WARNING`, `ORDER_ACTION_NEEDED`, `ORDER_CONFIRMATION`, `ORDER_DELAY`, `ORDER_OR_TRANSACTION_CANCEL`, `ORDER_PICK_UP`, `PAYMENT_ACTION_REQUIRED`, `PAYMENT_CONFIRMATION`, `PAYMENT_DUE_REMINDER`, `PAYMENT_OVERDUE`, `PAYMENT_REJECT_FAIL`, `PAYMENT_SCHEDULED`, `RECEIPT_ATTACHMENT`, `RETURN_CONFIRMATION`, `SHIPMENT_CONFIRMATION`, `STATEMENT_ATTACHMENT`, `STATEMENT_AVAILABLE`, `TRANSACTION_ALERT` |
| `industry` | `E_COMMERCE`, `FINANCIAL_SERVICES` |
| `language` | Locale code, such as `en_US` |
| `name` | Exact template name |

Meta's example request is broken. It calls `/<ID>/message_templates` instead of the library edge, quotes the search value and drops the line continuation. This version follows Meta's syntax block, which puts the edge at the root:

```bash
curl 'https://graph.facebook.com/v26.0/message_template_library?search=payments' \
  -H 'Authorization: Bearer ACCESS_TOKEN'
```

The page doesn't show the response envelope (a `data` array, paging), and doesn't say whether the edge needs a WhatsApp Business Account ID. Each entry looks like Meta's example, cleaned here so it parses. The original has raw line breaks inside `body`, now escaped as `\n`.

```json
{
  "name": "low_balance_warning_1",
  "language": "en_US",
  "category": "UTILITY",
  "topic": "PAYMENTS",
  "usecase": "LOW_BALANCE_WARNING",
  "industry": ["FINANCIAL_SERVICES"],
  "header": "Your account balance is low",
  "body": "Hi {{1}},\nThis is to notify you that your {{2}} in your {{3}} account, ending in {{4}} is below your pre-set {{5}} of {{6}}.\nClick the button to deposit more {{7}}.\n{{8}}",
  "body_params": ["Jim", "available funds", "CS Mutual checking plus", "1234", "limit", "$75.00", "funds", "CS Mutual"],
  "buttons": [
    {"type": "URL", "text": "Make a deposit", "url": "https://www.example.com/"},
    {"type": "PHONE_NUMBER", "text": "Call us", "phone_number": "+18005551234"}
  ],
  "id": "7147013345418927"
}
```

`body_params` holds Meta's example values. The `buttons` array tells you which button inputs the create call will need. Meta's form sample also carries `body_param_types`, such as `["TEXT", "TEXT"]`, which you can use to validate values before sending.

In WhatsApp Manager the same catalog sits under Message Templates, Create Template, then Browse Templates. Hovering over a template shows its parameter values.

## Create a template from the library

The create call takes four fields and two optional input objects.

| Field | Rule |
| --- | --- |
| `name` | Your name for the template, "Maximum 512 characters" |
| `category` | "Must be `UTILITY` for use with Template Library" |
| `language` | The template's locale code |
| `library_template_name` | "The exact name of the Template Library template" |
| `library_template_button_inputs` | Optional, but required when the library template has buttons |
| `library_template_body_inputs` | Optional toggles for the body |

Each button input has a required `type`: `QUICK_REPLY`, `URL`, `PHONE_NUMBER`, `OTP`, `MPM`, `CATALOG`, `FLOW`, `VOICE_CALL` or `APP`. A URL button takes a `url` object with `base_url` and `url_suffix_example`. A phone button takes `phone_number`. OTP buttons use `otp_type` (`COPY_CODE`, `ONE_TAP` or `ZERO_TAP`), `zero_tap_terms_accepted` and `supported_apps` with `package_name` and `signature_hash`.

The body inputs are `add_contact_number`, `add_security_recommendation`, `code_expiration_minutes`, `add_learn_more_link` and `add_track_package_link`. Meta marks the last two "Not widely available and will be ignored if not available."

Meta's example request won't run. It calls v19.0, has no `\` continuations and never closes the quote after `order_update`. It also sends the buttons as a string of single-quoted pseudo-JSON, which collides with the shell's own quotes. This is the same request, fixed, with the buttons as a JSON array:

```bash
curl -X POST 'https://graph.facebook.com/v26.0/WHATSAPP_BUSINESS_ACCOUNT_ID/message_templates' \
  -H 'Authorization: Bearer ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "my_delivery_update",
  "language": "en_US",
  "category": "UTILITY",
  "library_template_name": "delivery_update_1",
  "library_template_button_inputs": [
    {
      "type": "URL",
      "url": {
        "base_url": "https://www.example.com/{{1}}",
        "url_suffix_example": "https://www.example.com/order_update"
      }
    }
  ]
}'
```

Meta's syntax block sends the buttons as a JSON-encoded string and never shows the array, so which form the API requires is undocumented. If the array is rejected, send it serialized as a string.

Meta's example response:

```json
{
  "id": "{hsm-id}",
  "status": "APPROVED",
  "category": "UTILITY"
}
```

No sentence on the page says library templates skip review. Read `status` instead of assuming it. If it isn't `APPROVED`, poll the template by name before you send. Meta's general review page says "It can take up to 24 hours for an approval decision to be made" ([template review, accessed 2026-11-04](https://developers.facebook.com/documentation/business-messaging/whatsapp/templates/template-review)). For templates written from scratch, see [create a message template through the API](/academy/articles/whatsapp-create-message-template-api/).

### What you can change

Through the API you choose the name, the language, the button details and the body toggles. The text stays fixed. In WhatsApp Manager, "If you choose **Customize template**, your template will have to go through review before you are able to send messages." Meta's utility page doesn't mention the library, but says a utility template with marketing material "will automatically be re-categorized as a marketing template" ([utility templates, accessed 2026-11-04](https://developers.facebook.com/documentation/business-messaging/whatsapp/templates/utility-templates/utility-templates)). The differences between the two are in [template categories](/academy/articles/whatsapp-template-categories-marketing-utility-authentication/).

## Parameter checks at send time

You send a library template like any other template, filling its parameters as in [template variables and named parameters](/academy/articles/whatsapp-template-variables-named-parameters/). The difference is validation. "Messages sent using templates from Template Library are subject to parameter checks during send time." "Values used in parameters that are outside of the established ranges listed below will cause the message send to fail."

| Type | What Meta accepts |
| --- | --- |
| ADDRESS | A valid address |
| TEXT | Basic text |
| AMOUNT | A quantity; money may carry a currency prefix or suffix, decimals, commas and symbols |
| DATE | Several standard date formats |
| PHONE NUMBER | Digits, spaces, dashes, parentheses and plus signs |
| EMAIL | A valid email address |
| NUMBER | A number with no spaces |

Every parameter is also length-restricted, and Meta publishes no limit per type. Its advice when a send fails is to try a shorter value. A document header accepts PDFs only. Validate types and trim long values in your own code, so a bad value fails before the API call instead of as a failed send.

*Z-API Omni team*
