Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.relayos.com.br/llms.txt

Use this file to discover all available pages before exploring further.

Use this endpoint to register a new WhatsApp message template in your RelayOS project. After submission, Meta reviews the template and updates its status to APPROVED or REJECTED. You can only send messages using templates that have been approved.

Request

POST https://api.relayos.com.br/v1/templates
name
string
required
Template name in slug format (lowercase letters, numbers, and underscores only). This name is used when referencing the template in POST /v1/messages. Example: order_confirmation.
language
string
required
BCP-47 language code for the template. Examples: pt_BR, en_US, es_MX. Each language variant is registered as a separate template.
category
string
required
Template category as defined by Meta. Must be one of UTILITY, MARKETING, or AUTHENTICATION. The category affects delivery rules and pricing.
components
array
required
Array of component objects that define the template structure. Each component represents a section of the message: HEADER, BODY, or FOOTER. At minimum, a BODY component is required.
curl -X POST https://api.relayos.com.br/v1/templates \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "order_confirmation",
    "language": "pt_BR",
    "category": "UTILITY",
    "components": [
      {
        "type": "HEADER",
        "format": "TEXT",
        "text": "Pedido confirmado"
      },
      {
        "type": "BODY",
        "text": "Olá {{1}}, seu pedido #{{2}} foi confirmado e será entregue em até {{3}} dias úteis."
      },
      {
        "type": "FOOTER",
        "text": "RelayOS — mensagens que chegam"
      }
    ]
  }'

Response

A 200 response returns the created template object.
id
string
Unique template identifier assigned by RelayOS.
name
string
The slug name you provided.
language
string
The language code for this template.
category
string
The template category (UTILITY, MARKETING, or AUTHENTICATION).
status
string
Approval status from Meta. Initially PENDING. Transitions to APPROVED or REJECTED after Meta review.
components
array
The components array as submitted.
createdAt
string
ISO 8601 timestamp of when the template was registered.
{
  "id": "tpl_01hwxyz123abc",
  "name": "order_confirmation",
  "language": "pt_BR",
  "category": "UTILITY",
  "status": "PENDING",
  "components": [
    {
      "type": "HEADER",
      "format": "TEXT",
      "text": "Pedido confirmado"
    },
    {
      "type": "BODY",
      "text": "Olá {{1}}, seu pedido #{{2}} foi confirmado e será entregue em até {{3}} dias úteis."
    },
    {
      "type": "FOOTER",
      "text": "RelayOS — mensagens que chegam"
    }
  ],
  "createdAt": "2026-05-14T12:00:00Z"
}
Meta typically reviews templates within 24 hours. You can poll GET /v1/templates to check approval status.