Skip to main content
GET
/
api
/
templates
/
whatsapp
List all WhatsApp templates
curl --request GET \
  --url https://app.minimo.it/api/templates/whatsapp \
  --header 'Authorization: Bearer <token>'
{
  "data": [
    {
      "id": "tmpl_82jh2asjda",
      "name": "order_confirmation",
      "language": "en",
      "status": "APPROVED",
      "category": "MARKETING",
      "namespace": "e33bca12_1234_4567_abcd_abcdef123456",
      "waba_account_id": "1234567890",
      "partner_id": "987654321",
      "created_at": "2024-12-01T10:00:00Z",
      "modified_at": "2024-12-03T15:30:00Z",
      "updated_external": true,
      "rejected_reason": "",
      "external_id": "EXT123456789",
      "created_by": {
        "user_id": "user_abc123",
        "user_name": "jane.doe"
      },
      "modified_by": {
        "user_id": "user_xyz789",
        "user_name": "john.smith"
      },
      "quality_score": {
        "reasons": [
          "LOW_ENGAGEMENT"
        ],
        "score": "GREEN"
      },
      "components": [
        {
          "type": "BODY",
          "text": "Hello {{1}}, your order {{2}} has been confirmed!",
          "example": {
            "body_text": [
              [
                "Jane",
                "ORD-12345"
              ]
            ]
          }
        }
      ]
    }
  ]
}

Overview

Get a list of all WhatsApp templates in your Minimo account, including their approval status, category, and available components. Use this endpoint to:
  • Check which templates are approved and ready to send
  • Display available templates in your application
  • Monitor template approval status
  • Verify template structure before sending messages
Before sending messages, make sure to connect a WhatsApp Business Account by visiting the Channels section at app.minimo.it/channels.

Response Structure

{
  "data": [
    {
      "id": "tmpl_whatsapp_123",
      "name": "order_confirmation",
      "language": "en",
      "status": "APPROVED",
      "category": "UTILITY",
      "namespace": "e33bca12_1234_4567_abcd_abcdef123456",
      "createdAt": "2025-10-01T10:00:00Z",
      "updatedAt": "2025-10-05T14:30:00Z",
      "qualityScore": {
        "score": "GREEN",
        "reasons": null
      },
      "components": [
        {
          "type": "HEADER",
          "format": "TEXT",
          "text": "Order Confirmation"
        },
        {
          "type": "BODY",
          "text": "Hello {{1}}, your order {{2}} has been confirmed!",
          "example": {
            "bodyText": [["John Doe", "ORD-12345"]]
          }
        },
        {
          "type": "FOOTER",
          "text": "Reply STOP to opt out"
        }
      ]
    }
  ]
}

Template Status

WhatsApp templates can have different statuses:
StatusDescriptionCan Send?
APPROVEDTemplate approved by Meta✅ Yes
PENDINGWaiting for Meta approval❌ No
REJECTEDMeta rejected the template❌ No
DISABLEDDisabled by you or Meta❌ No
Only templates with status: "APPROVED" can be used to send messages. Check this field before attempting to send.

Template Categories

CategoryDescriptionUse Cases
UTILITYTransactional updatesOrder status, booking confirmations, account notifications
AUTHENTICATIONSecurity codesOTP, 2FA verification, password resets
MARKETINGPromotional contentProduct launches, special offers, newsletters

Quality Score

Meta assigns a quality score based on how users interact with your messages:
ScoreMeaningImpact
GREENHigh qualityFull sending capacity
YELLOWMedium qualityMonitoring required
REDLow qualityReduced sending limits
UNKNOWNNot yet ratedNew template
Templates with RED quality scores may be paused or have limited sending capacity. Improve message quality to restore full access.
Quality score can decline due to:
  • High block rates (users blocking your number)
  • Low engagement (users not responding)
  • Spam reports
  • Irrelevant content

Template Components

Templates consist of multiple components:
  • Optional element at the top
  • Can be: TEXT, IMAGE, VIDEO, or DOCUMENT
  • Single variable allowed (for dynamic content)

Body

  • Required main message content
  • Supports multiple variables ({{1}}, {{2}}, etc.)
  • Maximum 1024 characters
  • Optional additional text at the bottom
  • No variables allowed
  • Often used for opt-out instructions

Buttons

  • Optional interactive elements
  • Types: Call-to-action, Quick reply, URL
  • Up to 3 buttons per template

Use Cases

Check Template Approval Status

Monitor when templates are approved:
async function waitForApproval(templateName) {
  const maxAttempts = 48; // Check for 48 hours
  const intervalHours = 1;

  for (let i = 0; i < maxAttempts; i++) {
    const response = await fetch('https://app.minimo.it/api/templates/whatsapp', {
      headers: {
        Authorization: `Bearer ${apiKey}`,
      },
    });

    const { data: templates } = await response.json();
    const template = templates.find((t) => t.name === templateName);

    if (template?.status === 'APPROVED') {
      console.log(`Template "${templateName}" is now approved!`);
      return true;
    } else if (template?.status === 'REJECTED') {
      console.error(`Template "${templateName}" was rejected`);
      return false;
    }

    // Wait 1 hour before checking again
    await new Promise((resolve) => setTimeout(resolve, intervalHours * 60 * 60 * 1000));
  }

  console.error('Template approval timeout');
  return false;
}

Build Template Selector

Display only approved templates:
async function getApprovedTemplates() {
  const response = await fetch('https://app.minimo.it/api/templates/whatsapp', {
    headers: {
      Authorization: `Bearer ${apiKey}`,
    },
  });

  const { data: templates } = await response.json();

  // Filter only approved templates
  return templates.filter((t) => t.status === 'APPROVED');
}

// Use in UI
const approvedTemplates = await getApprovedTemplates();
approvedTemplates.forEach((template) => {
  console.log(`${template.name} - ${template.category}`);
});

Extract Template Variables

Parse template components to find required variables:
function getTemplateVariables(template) {
  const bodyComponent = template.components.find((c) => c.type === 'BODY');
  if (!bodyComponent) return [];

  // Extract {{1}}, {{2}}, etc.
  const matches = bodyComponent.text.match(/\{\{(\d+)\}\}/g);
  if (!matches) return [];

  return matches.map((m) => parseInt(m.match(/\d+/)[0]));
}

// Example usage
const template = templates.find((t) => t.name === 'order_confirmation');
const variables = getTemplateVariables(template);
console.log(`Template requires ${variables.length} variables:`, variables);
// Output: Template requires 2 variables: [1, 2]

Filtering & Sorting (Coming Soon)

Future versions will support:
# Filter by status
GET /api/templates/whatsapp?status=APPROVED

# Filter by category
GET /api/templates/whatsapp?category=UTILITY

# Sort by creation date
GET /api/templates/whatsapp?sort=-createdAt

Template Languages

WhatsApp templates can be created in multiple languages:
{
  "name": "order_confirmation",
  "language": "en",
  "status": "APPROVED"
}
Supported language codes:
  • en - English
  • it - Italian
  • es - Spanish
  • fr - French
  • de - German
  • pt - Portuguese
  • And 60+ more…
Create separate templates for each language you want to support. Use the same name with different language codes.

Common Errors

ErrorCauseSolution
unauthorizedInvalid API keyCheck Authorization header
no_whatsapp_accountWhatsApp not connectedConnect WhatsApp in dashboard
rate_limit_exceededToo many requestsImplement caching, respect rate limits

Best Practices

Templates don’t change frequently. Cache the response:
const CACHE_DURATION = 15 * 60 * 1000; // 15 minutes
let templateCache = null;
let cacheTime = 0;

async function getTemplates() {
  if (templateCache && Date.now() - cacheTime < CACHE_DURATION) {
    return templateCache;
  }
  
  const response = await fetch('https://app.minimo.it/api/templates/whatsapp', {
    headers: { 'Authorization': `Bearer ${apiKey}` },
  });
  
  templateCache = await response.json();
  cacheTime = Date.now();
  
  return templateCache;
}
Regularly check template quality to prevent issues:
async function checkTemplateHealth() {
  const { data: templates } = await getTemplates();
  
  const unhealthy = templates.filter(t => 
    t.qualityScore.score === 'RED' || t.qualityScore.score === 'YELLOW'
  );
  
  if (unhealthy.length > 0) {
    console.warn('Templates need attention:', unhealthy.map(t => t.name));
    // Send alert to team
  }
}
Always verify template is approved before sending:
async function canSendTemplate(templateName) {
  const { data: templates } = await getTemplates();
  const template = templates.find(t => t.name === templateName);
  
  return template && template.status === 'APPROVED';
}

Authorizations

Authorization
string
header
required

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

Response

Successful response with WhatsApp templates

data
object[]