Get Templates API

Environment: Live

Fetch approved WhatsApp message templates.

# Get Templates API

Fetch your approved WhatsApp message templates. Note: This API requires X-API-VASKEY in the header for authentication.

## Endpoint
- **Method**: GET
- **URL**: https://api.moolre.com/open/whatsapp/template

## Headers
| Header | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| X-API-VASKEY | string | Yes | Your WhatsApp API VAS key. |

## Query Parameters
| Parameter | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| next | string | No | Opaque cursor returned in the previous response. Omit it to request the first page; the documentation Next button manages this automatically. |

## Response (200 (Approved) Success)
Returns a list containing approved templates.

```json
{
  "status": 1,
  "code": "WAS200",
  "message": "Templates retrieved successfully",
  "data": [
    {
      "id": "1218877297066056",
      "name": "promotion",
      "language": "en",
      "status": "APPROVED",
      "message": "Hello {{1}},\n\nMelchizedek Technologies would like to share information about our {{2}} designed to support businesses like {{3}}.\n\nIf you would like to learn more or speak with our team, please reply to this message and we will be happy to assist.\n",
      "placeholders": [
        "1",
        "2",
        "3"
      ]
    }
  ],
  "next": "opaque-cursor-for-the-next-page",
  "meta": {
    "requestid": "req_c68f4c66115c26725c796242",
    "notices": []
  }
}
```

## Response (200 (Rejected) Success)
Returns a list containing rejected templates.

```json
{
  "status": 1,
  "code": "WAS200",
  "message": "Templates retrieved successfully",
  "data": [
    {
      "id": "1470051854524583",
      "name": "whatsapp_test",
      "language": "en",
      "status": "REJECTED",
      "message": "Hello {{1}},\n\nYou are receiving this message from Melchizedek Technologies in response to your request with {{2}}.\n\nIf you need any assistance, please reply to this message and our support team will assist you.\n",
      "placeholders": [
        "1",
        "2"
      ]
    }
  ],
  "next": null,
  "meta": {
    "requestid": "req_c68f4c66115c26725c796242",
    "notices": []
  }
}
```

## Response (200 (Pending) Success)
Returns a list containing pending templates.

```json
{
  "status": 1,
  "code": "WAS200",
  "message": "Templates retrieved successfully",
  "data": [
    {
      "id": "1709192906730643",
      "name": "update",
      "language": "en",
      "status": "PENDING",
      "message": "Hello {{1}},\n\nThank you for contacting Melchizedek Technologies.\nYour request regarding {{2}} has been received and our team will assist you shortly.\n",
      "placeholders": [
        "1",
        "2"
      ]
    }
  ],
  "next": null,
  "meta": {
    "requestid": "req_c68f4c66115c26725c796242",
    "notices": []
  }
}
```


## Fields every response can carry

These fields are additive: existing fields keep their names, order and types.

| Field | Meaning |
| :--- | :--- |
| meta | Always present, last in the object. meta.replayed is true only when the response is the stored answer to a repeated Idempotency-Key (absent otherwise). meta.requestid is the unique id of the request (also the X-Request-Id response header): quote it when you contact support. meta.notices is always an array, empty when there is nothing to report; each notice is { code, message, docs? }, for example that a deprecated way of sending credentials was used. See [Deprecations](https://docs.moolre.com/guides/deprecations). |

There is no outcome field. Decide the result from status, code and, on payment and transfer endpoints, data.txstatus (0 pending, 1 succeeded, 2 failed). These codes mean the result is unknown and may still succeed, so treat them as pending and check the status: PY01, PY02, TR01, TR02, TP11, TP18, APY10, APY16, ASL06, IS30, SYS500. Status 1 with TR08, OBGH01, OTGH01, OBNG01, GHQ03 or OM03 is final success; any other status 1 is an accepted, unfinished request.

Send X-Moolre-Http-Status: strict to receive real HTTP status codes (400, 401, 403, 404, 409, 422, 429, 5xx) instead of HTTP 200. See [Responses and request IDs](https://docs.moolre.com/guides/responses).

Back to the Moolre AI documentation index