---
title: "Create a new message template."
url: https://docs.gleap.ai/en/reference/rest-api/create-message-template
method: POST
path: "/message-templates"
api: "API Reference"
tag: "Message templates"
operationId: "CreateMessageTemplate"
updatedAt: "2026-11-01T18:40:15.677Z"
language: en
---

# Create a new message template.

`POST https://api.gleap.io/v3/message-templates`

Create a new message template. Callers who may only manage their own macros always create a private macro visible to themselves alone.

## Authorization

- `Authorization` (header, required): `Bearer <token>`

## Headers

- `project` (string, required)

## Request body (`application/json`, required)

- `title` (string, required)
- `content` (any, required)
- `lexorank` (string): Ordering rank. Ignored when creating a template; the server appends new templates at the end. Set it when updating a template to reorder.
- `isPublic` (boolean)
- `users` (string[])
- `attachments` (any[])
- `actions` (object[])
  - `data` (any)
  - `type` (string, required)
- `tags` (string[])
- `teams` (string[])
- `ticketTypes` (string[])

## Example request

```bash
curl --request POST \
  --url https://api.gleap.io/v3/message-templates \
  --header 'Authorization: Bearer <token>' \
  --header 'project: <project>' \
  --header 'Content-Type: application/json' \
  --data '{
  "title": "<title>",
  "content": null
}'
```

## Responses

### 200 (`application/json`)

Ok
