Skip to main content
POST
/
api
/
user
/
template-categories
Create a template category (superadmin)
curl --request POST \
  --url https://your-instance.example.com/api/user/template-categories \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "introduction",
  "displayName": "Introduction",
  "description": "First-touch templates for new leads.",
  "color": "#3B82F6"
}
'
{
  "_id": "64d2f9c5e8a1d4e001a0b1c2",
  "name": "tours",
  "displayName": "Tours",
  "description": "Tour-confirmation and follow-up templates.",
  "color": "#3B82F6",
  "sortOrder": 0,
  "isActive": true,
  "createdBy": {
    "fullName": "Acme Admin",
    "email": "admin@acme.example"
  },
  "createdAt": "2026-05-18T12:34:56.000Z",
  "updatedAt": "2026-05-18T12:34:56.000Z"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
name
string
required

Internal slug for the category; lower-cased and trimmed on save, and must be unique across all categories.

displayName
string
required

Human-readable label shown to users in the template picker (e.g., "Introduction").

description
string

Optional short blurb describing when to use this category.

color
string

Tailwind class string (or hex) used for the category badge; defaults to bg-gray-100 text-gray-800 when omitted.

Response

Category created

Template category record used to group SMS / campaign / script / automation templates. Returned by category create/update.

_id
string
required
name
string
required
displayName
string
description
string
color
string
sortOrder
integer
isActive
boolean
createdBy
object
createdAt
string<date-time>
updatedAt
string<date-time>