# Get Available Templates API

## Overview

{% hint style="warning" %}
**Updated 25 October 2023** We have stopped onboarding new agencies to the Gov.sg WhatsApp channel
{% endhint %}

This endpoint returns information about the available message templates for your account that can be used to send out Gov.sg WhatsApp messages.

{% openapi src="<https://api.postman.gov.sg/openapi.yaml>" path="/govsg/templates" method="get" %}
<https://api.postman.gov.sg/openapi.yaml>
{% endopenapi %}

## API Response

For general information about our API response formats, [see here](https://github.com/opengovsg/postmangovsg-guide/blob/main/overview/api-response-formats.md).

### Example Response

```json
{
  "data": [
    {
      "id": 1,
      "body": "<b>From</b>: {{ agency }}\n<b>Subject</b>: Upcoming phone call\n\nDear {{ recipient_name }},\nWe will be calling you today between {{ timeslot }} about {{ topic }}. We request your availability during this period.\n\nSincerely,\n{{ officer_name }}\n{{ officer_designation }}\n{{ agency }}\n\n<i>This is an automated message. Please do not reply.</i>",
      "params": [
        "agency",
        "recipient_name",
        "timeslot",
        "topic",
        "officer_name",
        "officer_designation"
      ],
      "param_metadata": {
        "topic": {
          "displayName": "Topic"
        },
        "agency": {
          "defaultFromMetaField": "agency"
        },
        "timeslot": {
          "displayName": "Timeslot"
        },
        "officer_name": {
          "defaultFromMetaField": "officer_name"
        },
        "recipient_name": {
          "displayName": "Recipient Name"
        },
        "officer_designation": {
          "defaultFromMetaField": "officer_designation"
        }
      },
      "name": "Notify users of an upcoming call",
      "multilingual_support": [
        {
          "languageCode": "zh_CN",
          "language": "Chinese",
          "body": "<b>From</b>: {{ agency }}\n<b>Subject</b>: Upcoming phone call\n\nDear {{ recipient_name }},\nWe will be calling you today between {{ timeslot }} about {{ topic }}. We request your availability during this period.\n\nSincerely,\n{{ officer_name }}\n{{ officer_designation }}\n{{ agency }}\n\n<i>This is an automated message. Please do not reply.</i>"
        }
      ]
    }
  ]
}
```

{% hint style="info" %}
The`id` and `languageCode` fields will be used in the [sending endpoint](/email-api-guide/programmatic-govsg-api/get-templates-api.md) later to indicate the specific template and lingual variation that you want to send your message out using.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://postman-v1.guides.gov.sg/email-api-guide/programmatic-govsg-api/get-templates-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
