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

# Create from library

> Instantaneously provision a pre-approved template from Meta's library to your WhatsApp Business Account

Instantly provision an official template from Meta's global library into your WhatsApp Business Account (WABA). Because library templates adhere to pre-vetted structures, they bypass manual review wait times and are provisioned directly in `APPROVED` status.

***

### 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 path="template_id" type="string" required>
  The official Meta library template name or slug to provision (e.g. `ecommerce_order_shipped_v1`).
</ParamField>

<ParamField query="channel_id" type="string" required>
  UUID of the WhatsApp phone number channel whose connected WABA will own the provisioned template.
</ParamField>

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

<ParamField body="language" type="string" required>
  Language code for the provisioned template (e.g. `en_US`, `es_ES`).
</ParamField>

***

### Response Fields

Returns the Meta Graph API response confirming template creation:

<ResponseField name="id" type="string">
  Generated Meta template ID under your WABA.
</ResponseField>

<ResponseField name="status" type="string">
  Operational status on Meta (typically `APPROVED`).
</ResponseField>

<ResponseField name="category" type="string">
  Meta category (`MARKETING`, `UTILITY`, or `AUTHENTICATION`).
</ResponseField>

***

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://api.sayvy.ai/api/v1/templates/library/ecommerce_order_shipped_v1/create?channel_id=8f3b0e2a-71d3-4a5f-9e6b-123456789abc" \
    -H "Authorization: Bearer <token>" \
    -H "Content-Type: application/json" \
    -d '{
      "language": "en_US"
    }'
  ```

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

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

  params = {
      "channel_id": "8f3b0e2a-71d3-4a5f-9e6b-123456789abc"
  }

  payload = {
      "language": "en_US"
  }

  headers = {
      "Authorization": "Bearer <token>",
      "Content-Type": "application/json"
  }

  response = requests.post(url, params=params, json=payload, 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/ecommerce_order_shipped_v1/create?channel_id=8f3b0e2a-71d3-4a5f-9e6b-123456789abc",
    {
      method: "POST",
      headers: {
        "Authorization": "Bearer <token>",
        "Content-Type": "application/json"
      },
      body: JSON.stringify({
        language: "en_US"
      })
    }
  );

  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/ecommerce_order_shipped_v1/create?channel_id=8f3b0e2a-71d3-4a5f-9e6b-123456789abc"))
      .header("Authorization", "Bearer <token>")
      .header("Content-Type", "application/json")
      .POST(HttpRequest.BodyPublishers.ofString("""
        {
          "language": "en_US"
        }
      """))
      .build();

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

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "id": "992817482910293",
    "status": "APPROVED",
    "category": "UTILITY"
  }
  ```

  ```json 400 Bad Request theme={null}
  {
    "detail": "Failed to create from Meta library: Template already exists for this language."
  }
  ```

  ```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/get-library"
    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" }}>Templates Overview</div>

      <div style={{ fontSize: "11px", color: "#94A3B8", maxWidth: "260px", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>
        Back to Templates documentation hub
      </div>
    </div>

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

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