> ## 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 Templates

> Retrieve all templates for the specified workspace.

## Overview

Retrieve all WhatsApp message templates for a workspace with pagination support.

***

## Query Parameters

| Parameter  | Type    | Required | Default | Description                  |
| ---------- | ------- | -------- | ------- | ---------------------------- |
| `per_page` | integer | No       | 10      | Number of templates per page |
| `page`     | integer | No       | 1       | Page number                  |

***

## Response

### Success (200 OK)

```json theme={null}
{
  "success": true,
  "data": [
    {
      "id": 1234,
      "workspace_id": "9ca711b1-14ca-4bd5-9457-751db9c052ac",
      "name": "welcome_template",
      "language": "en",
      "category": "MARKETING",
      "status": "APPROVED",
      "provider_id": "8949194595096852",
      "components": {
        "header": {
          "type": "text",
          "text": {
            "content": "Welcome {{1}}",
            "variables": ["Customer"]
          }
        },
        "body": {
          "text": "Thank you for joining us!",
          "variables": []
        },
        "footer": "Reply STOP to unsubscribe",
        "buttons": [
          {
            "type": "URL",
            "text": "Visit Website",
            "url": "https://example.com"
          }
        ]
      },
      "created_at": "2025-11-01T10:00:00Z",
      "updated_at": "2025-11-15T14:30:00Z"
    }
  ],
  "meta": {
    "current_page": 1,
    "from": 1,
    "last_page": 5,
    "per_page": 10,
    "to": 10,
    "total": 47
  }
}
```

***

## Template Status Values

| Status     | Description                                   |
| ---------- | --------------------------------------------- |
| `PENDING`  | Submitted to Meta, awaiting review            |
| `APPROVED` | Approved by Meta, ready to use                |
| `REJECTED` | Rejected by Meta, cannot be used              |
| `UPDATING` | Existing template being updated, under review |

***

## Filter Examples

### Get first page with 25 templates

```bash theme={null}
GET /api/v3/workspaces/{workspace}/templates?per_page=25&page=1
```

### Get all approved templates

Use the response data and filter by `status: "APPROVED"` on the client side, or use [Sync](/pages/endpoints/templates/sync) to update statuses.

***

<Tip>
  Use the [Sync endpoint](/pages/endpoints/templates/sync) regularly to update template statuses from Meta.
</Tip>


## OpenAPI

````yaml GET /workspaces/{workspace}/templates
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:
    get:
      tags:
        - Templates
      summary: Get Templates
      description: Retrieve all templates for the specified workspace.
      parameters:
        - name: workspace
          in: path
          description: ID of the workspace.
          required: true
          schema:
            type: string
            format: uuid
        - name: per_page
          in: query
          description: Number of templates per page.
          required: false
          schema:
            type: integer
            default: 10
      responses:
        '200':
          $ref: '#/components/responses/Paginate200'
        '401':
          $ref: '#/components/responses/401'
components:
  responses:
    '401':
      description: ''
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                example: Unauthenticated.
            required:
              - message
    Paginate200:
      description: ''
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Paginate'
  schemas:
    Paginate:
      type: object
      properties:
        data:
          type: array
          items:
            type: object
            properties: {}
        links:
          type: object
          properties: {}
        meta:
          type: object
          properties:
            current_page:
              type: integer
              example: 1
            per_page:
              type: integer
              example: 10
            total:
              type: integer
              example: 100
            last_page:
              type: integer
              example: 10
            from:
              type: integer
              example: 1
            to:
              type: integer
              example: 10
      required:
        - data
        - meta
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````