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

# Send a template message to a lead



## OpenAPI

````yaml /openapi.json post /public/v1/messaging/leads/{leadId}/templates
openapi: 3.0.0
info:
  title: Hostreach API
  description: >-
    Public REST API for Hostreach.


    Authenticate with an API key via the `X-Api-Key` header or `Authorization:
    Bearer <key>` header.


    Generate API keys from **Settings › Workspace › Acceso API** in the
    dashboard.
  version: '1.0'
  contact: {}
servers:
  - url: https://api.hostreach.io/v1
    description: Production
  - url: http://localhost:3001/v1
    description: Local
security:
  - apiKey: []
tags:
  - name: Identity
    description: Current workspace and usage
  - name: Platforms
    description: Supported real-estate portals and filter schemas
  - name: Extractions
    description: Lead extraction jobs
  - name: Leads
    description: Lead management
  - name: Campaigns
    description: Campaign management
  - name: Messaging
    description: Inbox and WhatsApp conversations
  - name: Templates
    description: WhatsApp message templates
  - name: Accounts
    description: WhatsApp accounts
  - name: Valuations
    description: Property valuations
  - name: Fichas
    description: Property listing sheets
  - name: Scheduling
    description: Calendar and appointments
  - name: Webhooks
    description: Event subscriptions
paths:
  /public/v1/messaging/leads/{leadId}/templates:
    post:
      tags:
        - Messaging
      summary: Send a template message to a lead
      operationId: PublicMessagingController_sendTemplate
      parameters:
        - name: leadId
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - templateId
              properties:
                templateId:
                  type: string
                  format: uuid
                  description: UUID of the approved WhatsApp template to send.
                  example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
                accountId:
                  type: string
                  format: uuid
                  description: >-
                    WhatsApp account UUID to send from. Defaults to the campaign
                    account linked to the lead.
                scheduledAt:
                  type: string
                  format: date-time
                  description: >-
                    ISO-8601 timestamp to schedule the message. Omit to send
                    immediately.
                  example: '2026-06-10T10:00:00Z'
                campaignId:
                  type: string
                  format: uuid
                  description: >-
                    Campaign context for attribution. Inferred from the lead if
                    omitted.
      responses:
        '201':
          description: ''
      security:
        - bearerApiKey: []
        - apiKey: []
components:
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-Api-Key
      description: >-
        API key (hr_live_... or hr_test_...). Generate from Settings › Workspace
        › Acceso API.

````