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

# Get Template Details

> Get detailed information about a specific template

This endpoint returns detailed information about a specific template, including its variables and metadata.

### Path Parameters

<ParamField path="template_id" type="string" required>
  The unique identifier of the template
</ParamField>

### Response

The endpoint returns a JSON object containing detailed information about the template.

<CodeGroup>
  ```json Success Response theme={null}
  {
    "cid": "content_abc123",
    "uid": "template_xyz789",
    "name": "Welcome Email Header",
    "type": "image",
    "created_at": "2024-01-01T00:00:00Z",
    "updated_at": "2024-01-02T00:00:00Z",
    "published_variables": [
      {
        "id": "var_123",
        "name": "header_text",
        "type": "text",
        "value": "Welcome"
      },
      {
        "id": "var_456",
        "name": "profile_image",
        "type": "image",
        "value": "https://example.com/default.jpg"
      }
    ]
  }
  ```

  ```json Template Not Found theme={null}
  {
    "error": "Template not found"
  }
  ```

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

### Variable Types

The `published_variables` array contains all variables that can be modified when rendering the template. Each variable has:

* `id`: Unique identifier for the variable
* `name`: Human-readable name used in API calls
* `type`: Type of variable (text or image)
* `value`: Default value for the variable


## OpenAPI

````yaml GET /v1/templates/{template_id}
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/{template_id}:
    get:
      parameters:
        - schema:
            type: string
          required: true
          name: template_id
          in: path
        - schema:
            type: string
            description: API Key
          required: true
          description: API Key
          name: X-API-Key
          in: header
      responses:
        '200':
          description: Template details
          content:
            application/json:
              schema:
                type: object
                properties:
                  cid:
                    type: string
                  uid:
                    type: string
                  name:
                    type: string
                  type:
                    type: string
                  created_at:
                    type: string
                  updated_at:
                    type: string
                  published_variables:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        name:
                          type: string
                        type:
                          type: string
                        value:
                          type: string
                      required:
                        - id
                        - name
                        - type
                        - value
                required:
                  - cid
                  - uid
                  - name
                  - type
                  - created_at
                  - updated_at
                  - published_variables
        '401':
          description: API key is invalid
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
        '404':
          description: Template not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error

````