> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.chatbridge.mx/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.chatbridge.mx/_mcp/server.

# Get template detail

GET https://connect.chatbridge.mx/v1/whatsapp/templates/{templateId}

Retrieves the full details of a template by its identifier.

Reference: https://docs.chatbridge.mx/whats-app/templates/get-template

## Authentication

- `x-api-key` header (required) — Account authentication key.
- `Authorization` header (bearer token, required) — OAuth 2.0 access token issued by `POST /api/oauth/token` (client-credentials). Takes precedence over `x-api-key` when both are sent. See the Authentication section.

## Request

### Path parameters

- `templateId` (string, required) — Template identifier.

## Response

### 200

Template detail.

- `_id` (string, optional)
- `whatsapp_account` (string, optional)
- `name` (string, optional)
- `category` (enum, optional)
  - Allowed values: `MARKETING`, `UTILITY`, `AUTHENTICATION`
- `language` (string, optional)
- `status` (enum, optional)
  - Allowed values: `APPROVED`, `PENDING`, `REJECTED`
- `parameter_format` (enum, optional) — Variable format. POSITIONAL uses \{\{1}}, \{\{2}}; NAMED uses \{\{name}}. The two formats cannot be mixed in a single template.
  - Allowed values: `POSITIONAL`, `NAMED`
- `components` (list of TemplateComponent, optional)

## Errors

### 404 Not Found Error

The requested resource does not exist.

- `message` (string, optional)
- `error` (string, optional)
- `statusCode` (integer, optional)
- `errorCode` (integer, optional)
- `metadata` (map from string to any, optional)

## Types

### TemplateComponent

Template component. Depending on the value of `type`, different fields apply (HEADER, BODY, FOOTER, BUTTONS, or CAROUSEL).

- `type` (enum, required)
  - Allowed values: `HEADER`, `BODY`, `FOOTER`, `BUTTONS`, `CAROUSEL`
- `format` (enum, optional) — Applies to HEADER.
  - Allowed values: `TEXT`, `IMAGE`, `VIDEO`, `DOCUMENT`, `LOCATION`
- `text` (string, optional) — Component text (HEADER TEXT, BODY, FOOTER).
- `url` (string, optional) — Resource URL for a HEADER of type IMAGE, VIDEO, or DOCUMENT.
- `location` (Location, optional)
- `add_security_recommendation` (boolean, optional) — Applies to the BODY of AUTHENTICATION templates.
- `code_expiration_minutes` (integer, optional) — Applies to the FOOTER of AUTHENTICATION templates.
- `example` (map from string to any, optional) — Example values required when the component has variables.
- `buttons` (list of TemplateButton, optional)
- `cards` (list of TemplateComponentCardsItems, optional) — Carousel cards (minimum 2, maximum 10).

### Location

- `latitude` (double, optional)
- `longitude` (double, optional)
- `name` (string, optional)
- `address` (string, optional)

### TemplateButton

- `type` (enum, optional)
  - Allowed values: `QUICK_REPLY`, `URL`, `PHONE_NUMBER`, `COPY_CODE`, `OTP`
- `text` (string, optional)
- `url` (string, optional) — Applies to URL buttons. Supports one \{\{1}} variable.
- `phone_number` (string, optional) — Applies to PHONE_NUMBER buttons. E.164 format.
- `otp_type` (enum, optional) — Applies to OTP buttons.
  - Allowed values: `COPY_CODE`
- `example` (list of string, optional)

### TemplateComponentCardsItems

- `components` (list of TemplateComponent, optional)

## Examples

**Response**

```json
{
  "_id": "string",
  "whatsapp_account": "string",
  "name": "string",
  "category": "MARKETING",
  "language": "es_MX",
  "status": "APPROVED",
  "parameter_format": "POSITIONAL",
  "components": [
    {
      "type": "HEADER",
      "format": "TEXT",
      "text": "string",
      "url": "string",
      "location": {
        "latitude": 1.1,
        "longitude": 1.1,
        "name": "string",
        "address": "string"
      },
      "add_security_recommendation": true,
      "code_expiration_minutes": 1,
      "example": {},
      "buttons": [
        {
          "type": "QUICK_REPLY",
          "text": "string",
          "url": "string",
          "phone_number": "string",
          "otp_type": "COPY_CODE",
          "example": [
            "string"
          ]
        }
      ],
      "cards": [
        {
          "components": [
            null
          ]
        }
      ]
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://connect.chatbridge.mx/v1/whatsapp/templates/templateId"

headers = {"x-api-key": "<apiKey>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://connect.chatbridge.mx/v1/whatsapp/templates/templateId';
const options = {method: 'GET', headers: {'x-api-key': '<apiKey>'}};

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://connect.chatbridge.mx/v1/whatsapp/templates/templateId"

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

	req.Header.Add("x-api-key", "<apiKey>")

	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://connect.chatbridge.mx/v1/whatsapp/templates/templateId")

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

request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<apiKey>'

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://connect.chatbridge.mx/v1/whatsapp/templates/templateId")
  .header("x-api-key", "<apiKey>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://connect.chatbridge.mx/v1/whatsapp/templates/templateId', [
  'headers' => [
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://connect.chatbridge.mx/v1/whatsapp/templates/templateId");
var request = new RestRequest(Method.GET);
request.AddHeader("x-api-key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["x-api-key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://connect.chatbridge.mx/v1/whatsapp/templates/templateId")! 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()
```