---
title: "/chat/conversation/send-template"
method: POST
path: "/chat/conversation/send-template"
tags: ["Chat"]
---

# /chat/conversation/send-template

`POST /chat/conversation/send-template`

## Request

- Base URL: `<<api-url>>` (relative, and the document’s source URL is not known)
- URL: `<<api-url>>/chat/conversation/send-template`
- Auth: API key in header `X-API-KEY`

Send a new template message

## Headers

- `octa-agent-email` string

## Request body

- SendTemplateMessagePayload
  - `target` MessagingTarget, required
    - `contact` Contact, required: Contact that will receive the message
      - `phoneContact` PhoneContact, required: Phone info of your client
        - `number` string, required: Phone Number that will receive the message
      - `customFields` CustomField[], required: Fields to be used on the template (key / value)
        - `key` string, required: Key of the field (as it is shown inside octadesk)
        - `value` union, required: Value to use on the template
          - string
          - number
  - `content` MessagingContent, required
    - `templateMessage` MessagingContentTemplateMessage, required: Information for us to find the template message
      - `id` string: The id of the template on our side
      - `code` string: The code of the template as it is in the integrator
  - `origin` MessagingOrigin, required
    - `from` PhoneContact, required: Registered WABA number
      - `number` string, required: Phone Number that will receive the message
  - `options` MessagingOptions, required
    - `automaticAssign` boolean, required: Automatic assign

## Response `201`

- SendTemplateMessageResponse
  - `result` SendTemplateMessageResult, required
    - `messageKey` string, required: The key of the message that was sent. Usable for us to find the message on our system.
    - `roomKey` string, required: The key of the chat created. Use this to find the message on our app.
  - `error` object, required: The error that occurred during the execution of the method. The message was NOT sent.
  - `errorCode` string: The error code returned by the provider (e.g. Meta/WhatsApp) when available
  - `errorMessage` string: The detailed error message returned by the provider (e.g. Meta/WhatsApp) when available

---

[API](https://skmtc.dev/octadesk/apis/octadesk-api.md) - [All operations](https://skmtc.dev/octadesk/apis/octadesk-api/llms.txt) - [OpenAPI document](https://skmtc.dev/octadesk/apis/octadesk-api/revisions/cf3224b37a34?raw)
