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

# POST /v1/channels/sms/templates

> Ask for a DLT template; it is pending until the gateway decides.

Asks for a DLT template. The wording is matched exactly apart from its blanks: `{#var#}` (anything), `{#num#}` (digits) and `{#alp#}` (letters, spaces, apostrophes and hyphens). It is `pending` until the gateway decides.

<Note>Needs the `sms.templates:write` scope.</Note>

## Body

| Field | Type | Required | Notes |
| :- | :- | :- | :- |
| `name` | string | Yes | Up to 120 characters. |
| `body` | string | Yes | The wording, up to 2000 characters, with blanks in lower case. |
| `note` | string | No | A note for whoever decides, up to 500 characters. |
| `tlvs` | string | No | Stamps to ask for, `tag=value` pairs separated by commas (up to 500 characters). The gateway decides what is attached. |

Send an `Idempotency-Key` header to make a retry safe: the same key with the same body is answered once, and the first answer repeated (with `Idempotent-Replayed: true`).

## Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.fireflo.au/v1/channels/sms/templates \
    -H "Authorization: Bearer $OMNI_API_KEY" \
    -H "Content-Type: application/json" \
    -H "Idempotency-Key: sms-template-order-shipped" \
    -d '{
      "name": "Order shipped",
      "body": "Hi {#var#}, your order {#alp#} has shipped. - Acme"
    }'
  ```

  ```python Python theme={null}
  import os

  import requests

  response = requests.post(
      "https://api.fireflo.au/v1/channels/sms/templates",
      headers={
          "Authorization": f"Bearer {os.environ['OMNI_API_KEY']}",
          "Idempotency-Key": "sms-template-order-shipped",
      },
      json={
          "name": "Order shipped",
          "body": "Hi {#var#}, your order {#alp#} has shipped. - Acme",
      },
  )
  print(response.status_code, response.json())
  ```

  ```javascript Node theme={null}
  const response = await fetch("https://api.fireflo.au/v1/channels/sms/templates", {
    method: "POST",
    headers: {
      Authorization: `Bearer ${process.env.OMNI_API_KEY}`,
      "Content-Type": "application/json",
      "Idempotency-Key": "sms-template-order-shipped",
    },
    body: JSON.stringify({
      "name": "Order shipped",
      "body": "Hi {#var#}, your order {#alp#} has shipped. - Acme"
    }),
  });
  console.log(response.status, await response.json());
  ```
</CodeGroup>

## Response

`201 Created`

```json theme={null}
{
  "id": "5207",
  "status": "pending",
  "note": "",
  "requested_tlvs": "",
  "reason": "",
  "updated_at": "2026-10-05T09:14:22Z",
  "name": "Order shipped",
  "body": "Hi {#var#}, your order {#alp#} has shipped. - Acme"
}
```

## Errors

Every refusal is `{"error": {"code", "message", "field"}}`; `field` is there when one input is at fault.

| Status | Error code | When |
| :- | :- | :- |
| 400 | `invalid_request` | An input is wrong: an empty or too long body, something that looks like a blank but isn't (`{#VAR#}`, or WhatsApp's `{{1}}`), a bad `tlvs` pair (`field` names it). |
| 404 | `channel_off` | The account doesn't have SMS on. |
| 409 | `provider_refused` | The SMS gateway refused it or couldn't be asked; the message says why. |
| 400 | `invalid_json` | The body isn't valid JSON. |
| 403 | `scope_missing` | The key doesn't have the `sms.templates:write` scope. |

Any request can also be refused for its key, its account or its rate (`key_required`, `invalid_key`, `account_suspended`, `plan_excludes_api`, `address_not_allowed`, `rate_limited`); see [the overview](/api-reference/overview).


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