Autional Autional
API Reference GitHub autional.com →

POST /admin/communication/templates

Create a message sending template for the current tenant. Supports SMS, email, and push channels. Template content can use {{variable}} or Go template syntax for variable placeholders (e.g., {{code}}), which will be replaced by variable values during sending. Templates support multiple languages (locale). References: ePrivacy Directive 2002/58/EC, CAN-SPAM Act.

Communication Service `bearerAuth` application/json

Request Body

Schema: dto.CreateTemplateRequest

FieldTypeRequiredExampleConstraintsDescription
channel string Yes sms enum: `sms`, `email`, `push`
code string Yes verify_code
content string Yes Your verification code is {code}, valid for 5 minutes
name string Yes Verification code template
content_type string No text
description string No Used for sending login verification codes
format string No simple
subject string No Verification code notification
text_content string No Your code is {code}
variables array of

string

No ['["code"]']

Responses

StatusDescriptionSchema
201Template created successfully, returns template detailsdto.CreateTemplateResponse
400Invalid request parametersdto.SimpleResponse
401Unauthenticated or invalid tokendto.SimpleResponse
403Insufficient permissions to access this resourcedto.SimpleResponse
404Resource not founddto.SimpleResponse
500Internal server errordto.SimpleResponse

Referenced Schemas

dto.CreateTemplateResponse

FieldTypeRequiredExampleConstraintsDescription
code integer No 0
data dto.MessageTemplateResponse No
message string No success

dto.MessageTemplateResponse

Message template data

FieldTypeRequiredExampleConstraintsDescription
channel string No sms
code string No verify_code
content string No Your verification code is {code}, valid for 5 minutes.
content_type string No text
created_at string No 2026-04-15T10:00:00Z
description string No Used to send login verification codes.
id string No tpl_abc123
is_active boolean No True
name string No Verification code template
subject string No Verification code notification
tenant_id string No tnt_xyz789
updated_at string No 2026-04-15T10:00:00Z
variables array of

string

No ['["code"]']
version integer No 1

dto.SimpleResponse

FieldTypeRequiredExampleConstraintsDescription
code integer No
message string No
timestamp string No