> For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

# Get a message template

GET https://%7BYour_Space_Name%7D.signalwire.com/api/messaging/whatsapp/templates/{id}

Retrieves a single message template by SignalWire ID or Meta template ID.

#### Permissions

The API token used to authenticate must have the following scope(s) enabled to make a successful request: _Numbers_.

[Learn more about API scopes](/docs/platform/your-signalwire-api-space).

Reference: https://signalwire.com/docs/apis/rest/whatsapp/retrieve-whatsapp-template

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: signalwire-rest
  version: 1.0.0
paths:
  /api/messaging/whatsapp/templates/{id}:
    get:
      operationId: retrieve_whatsapp_template
      summary: Get a message template
      description: >-
        Retrieves a single message template by SignalWire ID or Meta template
        ID.


        #### Permissions


        The API token used to authenticate must have the following scope(s)
        enabled to make a successful request: _Numbers_.


        [Learn more about API scopes](/docs/platform/your-signalwire-api-space).
      tags:
        - whatsAppTemplates
      parameters:
        - name: id
          in: path
          description: >-
            The template ID — either the SignalWire ID (a UUID) or the Meta
            template ID (a numeric string). Both are accepted.
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: >-
            SignalWire Basic Authentication using Project ID and API Token.


            The client sends HTTP requests with the Authorization header
            containing

            the word Basic followed by a space and a base64-encoded string of
            project_id:token.

            The project ID will be used as the username and the API token as the
            password.


            Example:

            ```

            Authorization: Basic base64(project_id:token)

            ```
          required: true
          schema:
            type: string
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WhatsAppTemplateResponse'
        '401':
          description: Access is unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Types.StatusCodes.StatusCode401'
        '404':
          description: The server cannot find the requested resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Types.StatusCodes.StatusCode404'
        '500':
          description: An internal server error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Types.StatusCodes.StatusCode500'
servers:
  - url: https://%7BYour_Space_Name%7D.signalwire.com
    description: SignalWire API
components:
  schemas:
    uuid:
      type: string
      format: uuid
      description: Universal Unique Identifier.
      title: uuid
    WhatsAppTemplateCategory:
      type: string
      enum:
        - utility
        - marketing
        - authentication
      description: The category of a WhatsApp message template.
      title: WhatsAppTemplateCategory
    WhatsAppTemplateComponent:
      type: object
      properties:
        type:
          type: string
          description: 'The component type: `HEADER`, `BODY`, `FOOTER`, or `BUTTONS`.'
      required:
        - type
      description: >-
        A template component. The `type` is one of `HEADER`, `BODY`, `FOOTER`,
        or `BUTTONS`. Additional fields depend on the component type — for
        example, a `BODY` carries `text`, while `BUTTONS` carries a `buttons`
        array. See the create example for the full shape.
      title: WhatsAppTemplateComponent
    WhatsAppTemplateParameterFormat:
      type: string
      enum:
        - named
        - positional
      description: How a template's variable placeholders are referenced.
      title: WhatsAppTemplateParameterFormat
    WhatsAppTemplateStatus:
      type: string
      enum:
        - approved
        - archived
        - deleted
        - disabled
        - flagged
        - in_appeal
        - limit_exceeded
        - locked
        - paused
        - pending
        - reinstated
        - pending_deletion
        - rejected
      description: >-
        The Meta approval status of a template. A template must be `approved`
        before it can be used to send messages.
      title: WhatsAppTemplateStatus
    WhatsAppTemplateResponse:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/uuid'
          description: The SignalWire identifier of the template.
        name:
          type: string
          description: The template name. Lowercase letters, numbers, and underscores only.
        category:
          $ref: '#/components/schemas/WhatsAppTemplateCategory'
          description: The template category.
        components:
          type: array
          items:
            $ref: '#/components/schemas/WhatsAppTemplateComponent'
          description: The template's components (header, body, footer, buttons).
        language:
          type: string
          description: The template language code.
        parameter_format:
          $ref: '#/components/schemas/WhatsAppTemplateParameterFormat'
          description: How the template's variable placeholders are referenced.
        template_id:
          type: string
          description: Meta's identifier for the template.
        template_status:
          $ref: '#/components/schemas/WhatsAppTemplateStatus'
          description: The Meta approval status of the template.
        whatsapp_business_id:
          $ref: '#/components/schemas/uuid'
          description: >-
            The SignalWire identifier of the WhatsApp Business Account the
            template belongs to.
        created_at:
          type: string
          description: The date and time when the template was created.
        updated_at:
          type: string
          description: The date and time when the template was last updated.
        discarded_at:
          type: string
          description: The date and time when the template was discarded, if applicable.
      required:
        - id
        - name
        - category
        - components
        - language
        - parameter_format
        - template_id
        - template_status
        - whatsapp_business_id
        - created_at
        - updated_at
      description: Response containing a single message template.
      title: WhatsAppTemplateResponse
    TypesStatusCodesStatusCode401Error:
      type: string
      enum:
        - Unauthorized
      title: TypesStatusCodesStatusCode401Error
    Types.StatusCodes.StatusCode401:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/TypesStatusCodesStatusCode401Error'
      required:
        - error
      description: Access is unauthorized.
      title: Types.StatusCodes.StatusCode401
    TypesStatusCodesStatusCode404Error:
      type: string
      enum:
        - Not Found
      title: TypesStatusCodesStatusCode404Error
    Types.StatusCodes.StatusCode404:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/TypesStatusCodesStatusCode404Error'
      required:
        - error
      description: The server cannot find the requested resource.
      title: Types.StatusCodes.StatusCode404
    TypesStatusCodesStatusCode500Error:
      type: string
      enum:
        - Internal Server Error
      title: TypesStatusCodesStatusCode500Error
    Types.StatusCodes.StatusCode500:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/TypesStatusCodesStatusCode500Error'
      required:
        - error
      description: An internal server error occurred.
      title: Types.StatusCodes.StatusCode500
  securitySchemes:
    SignalWireBasicAuth:
      type: http
      scheme: basic
      description: >-
        SignalWire Basic Authentication using Project ID and API Token.


        The client sends HTTP requests with the Authorization header containing

        the word Basic followed by a space and a base64-encoded string of
        project_id:token.

        The project ID will be used as the username and the API token as the
        password.


        Example:

        ```

        Authorization: Basic base64(project_id:token)

        ```

```

## Examples



**Response**

```json
{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "name": "order_update",
  "category": "utility",
  "components": [
    {
      "type": "BODY"
    }
  ],
  "language": "en_US",
  "parameter_format": "positional",
  "template_id": "1164792772433648",
  "template_status": "approved",
  "whatsapp_business_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "created_at": "2024-01-15T10:30:00Z",
  "updated_at": "2024-01-15T10:30:00Z",
  "discarded_at": "2024-01-15T10:30:00Z"
}
```

**SDK Code**

```python
import requests

url = "https://{your_space_name}.signalwire.com/api/messaging/whatsapp/templates/id"

response = requests.get(url, auth=("<project_id>", "<api_token>"))

print(response.json())
```

```javascript
const url = 'https://{your_space_name}.signalwire.com/api/messaging/whatsapp/templates/id';
const credentials = btoa("<project_id>:<api_token>");

const options = {method: 'GET', headers: {Authorization: `Basic ${credentials}`}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://{your_space_name}.signalwire.com/api/messaging/whatsapp/templates/id"

	req, _ := http.NewRequest("GET", url, nil)

	req.SetBasicAuth("<project_id>", "<api_token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://{your_space_name}.signalwire.com/api/messaging/whatsapp/templates/id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request.basic_auth("<project_id>", "<api_token>")

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://{your_space_name}.signalwire.com/api/messaging/whatsapp/templates/id")
  .basicAuth("<project_id>", "<api_token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://{your_space_name}.signalwire.com/api/messaging/whatsapp/templates/id', [
  'headers' => [
  ],
    'auth' => ['<project_id>', '<api_token>'],
]);

echo $response->getBody();
```

```csharp
using RestSharp;
using RestSharp.Authenticators;

var client = new RestClient("https://{your_space_name}.signalwire.com/api/messaging/whatsapp/templates/id");
client.Authenticator = new HttpBasicAuthenticator("<project_id>", "<api_token>");
var request = new RestRequest(Method.GET);

IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let credentials = Data("<project_id>:<api_token>".utf8).base64EncodedString()

let headers = ["Authorization": "Basic \(credentials)"]

let request = NSMutableURLRequest(url: NSURL(string: "https://{your_space_name}.signalwire.com/api/messaging/whatsapp/templates/id")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```