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

# Get Template

> Retrieve a specific template by ID in the specified workspace.

## Overview

Retrieve a specific WhatsApp message template by ID.

***

## Path Parameters

| Parameter   | Type    | Required | Description  |
| ----------- | ------- | -------- | ------------ |
| `workspace` | UUID    | Yes      | Workspace ID |
| `template`  | integer | Yes      | Template ID  |

***

## Response

### Success (200 OK)

```json theme={null}
{
  "success": true,
  "data": {
    "id": 1234,
    "workspace_id": "9ca711b1-14ca-4bd5-9457-751db9c052ac",
    "name": "order_confirmation",
    "language": "en",
    "category": "UTILITY",
    "status": "APPROVED",
    "provider_id": "8949194595096852",
    "components": {
      "header": {
        "type": "text",
        "text": {
          "content": "Order #{{1}}",
          "variables": ["12345"]
        }
      },
      "body": {
        "text": "Hi {{1}},\n\nYour order has been confirmed! Estimated delivery: {{2}}",
        "variables": ["John", "Dec 15, 2025"]
      },
      "footer": "Thank you for shopping with us",
      "buttons": [
        {
          "type": "URL",
          "text": "Track Order",
          "url": "https://example.com/track"
        },
        {
          "type": "PHONE_NUMBER",
          "text": "Contact Support",
          "phone_number": "+1234567890"
        }
      ]
    },
    "created_at": "2025-11-01T10:00:00Z",
    "updated_at": "2025-11-15T14:30:00Z"
  }
}
```

### Not Found (404)

```json theme={null}
{
  "success": false,
  "message": "Template not found"
}
```

***

## Component Structure

The `components` object contains all template elements:

### Header (Optional)

**Text Header:**

```json theme={null}
"header": {
  "type": "text",
  "text": {
    "content": "Header text with {{1}}",
    "variables": ["value"]
  }
}
```

**Media Header:**

```json theme={null}
"header": {
  "type": "media",
  "media": {
    "type": "image",  // or "video", "document"
    "handle": "file_handle_from_meta"
  }
}
```

### Body (Required)

```json theme={null}
"body": {
  "text": "Message with {{1}} and {{2}}",
  "variables": ["value1", "value2"]
}
```

### Footer (Optional)

```json theme={null}
"footer": "Footer text (max 60 chars)"
```

### Buttons (Optional)

```json theme={null}
"buttons": [
  {
    "type": "URL",
    "text": "Button Text",
    "url": "https://example.com"
  },
  {
    "type": "PHONE_NUMBER",
    "text": "Call Us",
    "phone_number": "+1234567890"
  },
  {
    "type": "QUICK_REPLY",
    "text": "Quick Reply"
  }
]
```

***

## Usage Example

```bash theme={null}
curl -X GET \
  https://lancepilot.com/api/v3/workspaces/{workspace}/templates/1234 \
  -H 'Authorization: Bearer YOUR_API_TOKEN'
```

***

<Tip>
  Use this endpoint to inspect template structure before sending messages with [Send Template Message](/pages/endpoints/template-message/send-id).
</Tip>


## OpenAPI

````yaml GET /workspaces/{workspace}/templates/{template}
openapi: 3.1.0
info:
  title: Lancepilot API
  description: API for Lancepilot
  version: 1.0.0
  license:
    name: MIT
servers:
  - url: https://lancepilot.com/api/v3
security:
  - bearerAuth: []
paths:
  /workspaces/{workspace}/templates/{template}:
    get:
      tags:
        - Templates
      summary: Get Template
      description: Retrieve a specific template by ID in the specified workspace.
      parameters:
        - name: workspace
          in: path
          description: ID of the workspace.
          required: true
          schema:
            type: string
            format: uuid
        - name: template
          in: path
          description: ID of the template.
          required: true
          schema:
            type: integer
      responses:
        '200':
          $ref: '#/components/responses/200'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
components:
  responses:
    '200':
      description: ''
      content:
        application/json:
          schema:
            type: object
            properties:
              data:
                type: object
                properties: {}
            required:
              - data
    '401':
      description: ''
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                example: Unauthenticated.
            required:
              - message
    '404':
      description: ''
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                example: Resource not found.
              status:
                type: integer
                example: 404
            required:
              - message
              - status
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````