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

# List Templates

> Get a list of all templates in your organization

This endpoint returns a list of all templates in your organization. The results are paginated and can be controlled using the `limit` and `offset` query parameters.

### Query Parameters

<ParamField query="limit" type="string" default="20">
  Number of templates to return per page
</ParamField>

<ParamField query="offset" type="string" default="0">
  Number of templates to skip (for pagination)
</ParamField>

### Response

The endpoint returns a JSON object containing an array of templates and the total count.

<CodeGroup>
  ```json Success Response theme={null}
  {
    "templates": [
      {
        "uid": "template_abc123",
        "name": "Welcome Email Header",
        "type": "image",
        "created_at": "2024-01-01T00:00:00Z",
        "updated_at": "2024-01-02T00:00:00Z"
      }
    ],
    "total": 1
  }
  ```

  ```json No Templates Found theme={null}
  {
    "error": "No templates found"
  }
  ```

  ```json Invalid API Key theme={null}
  {
    "error": "Invalid API key"
  }
  ```
</CodeGroup>


## OpenAPI

````yaml GET /v1/templates
openapi: 3.1.0
info:
  title: SendBetter API
  description: API to help you automate the creation of personalized images at scale
  version: v1
servers: []
security: []
paths:
  /v1/templates:
    get:
      parameters:
        - schema:
            type: string
            default: '20'
          required: false
          name: limit
          in: query
        - schema:
            type: string
            default: '0'
          required: false
          name: offset
          in: query
        - schema:
            type: string
            description: API Key
          required: true
          description: API Key
          name: X-API-Key
          in: header
      responses:
        '200':
          description: List of templates
          content:
            application/json:
              schema:
                type: object
                properties:
                  templates:
                    type: array
                    items:
                      type: object
                      properties:
                        uid:
                          type: string
                        name:
                          type: string
                        type:
                          type: string
                        created_at:
                          type: string
                        updated_at:
                          type: string
                      required:
                        - uid
                        - name
                        - type
                        - created_at
                        - updated_at
                  total:
                    type: number
                required:
                  - templates
                  - total
        '401':
          description: API key is invalid
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
        '404':
          description: Templates not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error

````