Create an SMS template
POSThttps://core-prod.malipopay.co.tz/api/v1/sms-template
Creates a new custom SMS template for the authenticated project.
Request
- application/json
- Body
- Example (auto)
Bodyrequired
namestringrequired
Template name (unique per project/env/language)
Example:
payment_confirmationtemplatestringrequired
Template text with optional placeholders in {{variable}} format
Example:
Dear {{name}}, your payment of {{amount}} {{currency}} has been received. Ref: {{reference}}languagestringrequired
ISO 639-1 language code
Example:
swenvstringrequired
Environment the template is active in (TEST or PROD)
Possible values: [TEST, PROD]
Example:
TESTdescriptionstring
Human-readable description of the template purpose
Example:
Sent to customer after successful payment{
"name": "payment_confirmation",
"template": "Dear {{name}}, your payment of {{amount}} {{currency}} has been received. Ref: {{reference}}",
"language": "sw",
"env": "TEST",
"description": "Sent to customer after successful payment"
}
Responses
- 200
- 400
- 500
Template created successfully
- application/json
- Schema
- Example (auto)
Schema
_idstring
Example:
65b3d92a4e5f6c0a1b8d7e54namestring
Example:
payment_confirmationtemplatestring
Example:
Dear {{name}}, your payment of {{amount}} {{currency}} has been received. Ref: {{reference}}languagestring
Example:
swenvstring
Possible values: [TEST, PROD]
Example:
TESTdescriptionstring
Example:
Sent to customer after successful paymentprojectstring
Project ID this template belongs to
Example:
63db68a6c5f3e7682e23c2cadeletedboolean
Example:
falsecreatedAtdate-time
Example:
2024-03-01T10:00:00.000ZupdatedAtdate-time
Example:
2024-03-01T10:00:00.000Z{
"_id": "65b3d92a4e5f6c0a1b8d7e54",
"name": "payment_confirmation",
"template": "Dear {{name}}, your payment of {{amount}} {{currency}} has been received. Ref: {{reference}}",
"language": "sw",
"env": "TEST",
"description": "Sent to customer after successful payment",
"project": "63db68a6c5f3e7682e23c2ca",
"deleted": false,
"createdAt": "2024-03-01T10:00:00.000Z",
"updatedAt": "2024-03-01T10:00:00.000Z"
}
Validation error
- application/json
- Schema
- Example (auto)
Schema
codeint32required
messagestringrequired
{
"code": 0,
"message": "string"
}
Internal server error
- application/json
- Schema
- Example (auto)
Schema
codeint32required
messagestringrequired
{
"code": 0,
"message": "string"
}
Authorization: apiToken
name: apiTokentype: apiKeyin: headerdescription: Project API key. Get yours from the Malipopay dashboard under Settings → API Keys.
- curl
- python
- nodejs
- php
- java
- go
- CURL
curl -L 'https://core-prod.malipopay.co.tz/api/v1/sms-template' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'apiToken: <apiToken>' \
-d '{
"name": "payment_confirmation",
"template": "Dear {{name}}, your payment of {{amount}} {{currency}} has been received. Ref: {{reference}}",
"language": "sw",
"env": "TEST",
"description": "Sent to customer after successful payment"
}'
Response