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

# /chat/conversation/send-template

`POST /chat/conversation/send-template`

Send a new template message

## Headers

- `octa-agent-email` string

## Request body

- SendTemplateMessagePayload
  - `target` MessagingTarget, required
    - `contact` Contact, required
      - `phoneContact` PhoneContact, required
        - `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
      - `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
      - `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.net/octadesk/apis/octadesk-api.md) · [All operations](https://skmtc.net/octadesk/apis/octadesk-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/octadesk/octadesk-api/versions/bc5e6dccb979/schema)
