Send Your First Message
Learn how to trigger notifications using templates and custom attributes.
1
Create a Notification Template
Before sending a message, you need a template. Templates define the structure of your notification and support dynamic placeholders using Liquid-style syntax.
Template Setup
Navigate to Notifications and create a template with the following details:
Template Name
welcome_messageSubject
Welcome, {{user_name}}!Body
Hi {{user.firstName}}, welcome to the platform!2
Trigger the Message
You can now trigger the notification via our REST API. Instead of using internal IDs, you can use your own external_user_id and the template's message_template_name.
Shell
curl -X POST "https://relaygrid.dev/api/v1/messages" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"message": {
"external_user_id": "user_12345",
"message_template_name": "welcome_message",
"message_attributes_attributes": [
{ "name": "user_name", "value": "Alice" }
]
}
}'Response201 Created
{
"message": {
"id": 101,
"notification_user_id": 42,
"actor_id": null,
"message_template_id": 7,
"seen": false,
"account_id": 1,
"created_at": "2026-06-08T10:20:00.000Z",
"updated_at": "2026-06-08T10:20:00.000Z",
"subject": "Welcome, {{user_name}}!",
"body": "Hi {{user.firstName}}, welcome to the platform!",
"rendered_subject": "Welcome, Alice!",
"rendered_body": "Hi Alice, welcome to the platform!",
"message_attributes": [
{
"id": 55,
"name": "user_name",
"value": "Alice",
"message_id": 101,
"created_at": "2026-06-08T10:20:00.000Z",
"updated_at": "2026-06-08T10:20:00.000Z"
}
]
}
}Tip: The
message_attributes_attributes array allows you to pass data to fill the placeholders in your template.