> ## Documentation Index
> Fetch the complete documentation index at: https://onextel-09023014.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Get a template

> Read one template.



## OpenAPI

````yaml api-reference/truecaller/openapi.yaml GET /v1/templates/{id}
openapi: 3.1.0
info:
  title: OneXtel Truecaller Business Messaging API
  version: 1.0.0
  description: >
    Send verified business messages to Truecaller users: single messages,
    templates with

    personalisation, images, files and buttons, and campaigns to contact lists.


    Every request carries a workspace API key in the `x-api-key` header. Create
    one in the

    Truecaller campaigns portal under **Developers → API keys**.


    Errors are JSON with a single `error` string (and `details` for validation
    errors):


    ```json

    { "error": "invalid phone number" }

    ```
servers:
  - url: https://truecaller.udchowdhury.me
    description: Production
security:
  - apiKey: []
tags:
  - name: Messages
    description: Send one message and read its status.
  - name: Templates
    description: Reusable messages with variables, media and buttons.
  - name: Media
    description: Upload files to attach to templates.
  - name: Contact lists
    description: Audiences for campaigns.
  - name: Campaigns
    description: Send a template to a whole contact list, now or later.
  - name: Senders
    description: The verified business profiles your workspace sends from.
paths:
  /v1/templates/{id}:
    get:
      tags:
        - Templates
      summary: Get a template
      operationId: getTemplate
      parameters:
        - $ref: '#/components/parameters/Id'
      responses:
        '200':
          description: The template.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Template'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    Id:
      in: path
      name: id
      required: true
      schema:
        type: string
        format: uuid
  schemas:
    Template:
      allOf:
        - $ref: '#/components/schemas/TemplateInput'
        - type: object
          properties:
            id:
              type: string
              format: uuid
            variables:
              type: array
              items:
                type: string
              example:
                - name
                - order_id
            status:
              type: string
              enum:
                - draft
                - submitted
                - approved
                - rejected
            reject_reason:
              type:
                - string
                - 'null'
            created_at:
              type: string
              format: date-time
            updated_at:
              type: string
              format: date-time
    TemplateInput:
      type: object
      required:
        - name
        - category
        - body
      properties:
        name:
          type: string
          maxLength: 100
        category:
          type: string
          enum:
            - promotional
            - transactional
            - service
        body:
          type: string
          maxLength: 1000
          description: >-
            Message text with {{variable}} placeholders and Truecaller text
            styling.
        variable_defaults:
          type: object
          additionalProperties:
            type: string
            maxLength: 200
          description: Used when a contact's value is empty.
        media:
          oneOf:
            - $ref: '#/components/schemas/Media'
            - type: 'null'
        buttons:
          type: array
          maxItems: 3
          items:
            $ref: '#/components/schemas/Button'
    Error:
      type: object
      properties:
        error:
          type: string
        details:
          type: array
          items:
            type: object
    Media:
      type: object
      required:
        - url
        - mime_type
      description: >-
        One attachment. Upload with [Upload
        media](/api-reference/truecaller/upload-media), or give any public https
        URL.
      properties:
        url:
          type: string
          description: Public https URL Truecaller downloads the file from at send time.
        mime_type:
          type: string
          enum:
            - image/jpeg
            - image/png
            - image/gif
            - video/mp4
            - video/quicktime
            - application/pdf
            - text/plain
        file_name:
          type: string
          maxLength: 100
          description: Shown to the recipient for PDFs and text files.
    Button:
      description: Up to 3 per message. Labels and URLs can use `{{variables}}`.
      oneOf:
        - type: object
          title: Link button
          required:
            - type
            - text
            - url
          properties:
            type:
              type: string
              const: link
            text:
              type: string
              maxLength: 40
              example: Track order
            url:
              type: string
              maxLength: 1000
              description: An https URL or an app deep link. Plain http is rejected.
              example: https://example.com/t/{{order_id}}
        - type: object
          title: Quick reply
          required:
            - type
            - text
          properties:
            type:
              type: string
              const: reply
            text:
              type: string
              maxLength: 100
              description: Sent back as the person's reply when tapped.
              example: Call me back
  responses:
    NotFound:
      description: Not found in this workspace.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: not found
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Workspace API key from **Developers → API keys**. It starts with
        `tc_live_`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.