> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kapso.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Simple text

> Create and send templates with body text parameters

## Create

<CodeGroup>
  ```typescript Create template - TypeScript SDK icon="square-js" theme={null}
  import { WhatsAppClient } from '@kapso/whatsapp-cloud-api';

  const client = new WhatsAppClient({
    baseUrl: 'https://api.kapso.ai/meta/whatsapp',
    kapsoApiKey: process.env.KAPSO_API_KEY!
  });

  await client.templates.create({
    businessAccountId: '123456789',
    name: 'order_confirmation',
    category: 'UTILITY',
    language: 'en_US',
    parameterFormat: 'NAMED',
    components: [
      {
        type: 'BODY',
        text: 'Hi {{customer_name}}, your order {{order_number}} has been confirmed!',
        example: {
          body_text_named_params: [
            { param_name: 'customer_name', example: 'Jessica' },
            { param_name: 'order_number', example: 'SKBUP2-4CPIG9' }
          ]
        }
      }
    ]
  });
  ```

  ```bash Create template - REST API icon="code" theme={null}
  curl -X POST 'https://api.kapso.ai/meta/whatsapp/v24.0/123456789/message_templates' \
    -H 'X-API-Key: YOUR_API_KEY' \
    -H 'Content-Type: application/json' \
    -d '{
      "name": "order_confirmation",
      "category": "UTILITY",
      "language": "en_US",
      "parameter_format": "NAMED",
      "components": [
        {
          "type": "BODY",
          "text": "Hi {{customer_name}}, your order {{order_number}} has been confirmed!",
          "example": {
            "body_text_named_params": [
              { "param_name": "customer_name", "example": "Jessica" },
              { "param_name": "order_number", "example": "SKBUP2-4CPIG9" }
            ]
          }
        }
      ]
    }'
  ```
</CodeGroup>

## Send

<CodeGroup>
  ```typescript Send template - TypeScript SDK icon="square-js" theme={null}
  import { WhatsAppClient } from '@kapso/whatsapp-cloud-api';

  const client = new WhatsAppClient({
    baseUrl: 'https://api.kapso.ai/meta/whatsapp',
    kapsoApiKey: process.env.KAPSO_API_KEY!
  });

  await client.messages.sendTemplate({
    phoneNumberId: '647015955153740',
    to: '15551234567',
    template: {
      name: 'order_confirmation',
      language: { code: 'en_US' },
      components: [
        {
          type: 'body',
          parameters: [
            { type: 'text', parameterName: 'customer_name', text: 'Jessica' },
            { type: 'text', parameterName: 'order_number', text: 'SKBUP2-4CPIG9' }
          ]
        }
      ]
    }
  });
  ```

  ```bash Send template - REST API icon="code" theme={null}
  curl -X POST 'https://api.kapso.ai/meta/whatsapp/v24.0/647015955153740/messages' \
    -H 'X-API-Key: YOUR_API_KEY' \
    -H 'Content-Type: application/json' \
    -d '{
      "messaging_product": "whatsapp",
      "to": "15551234567",
      "type": "template",
      "template": {
        "name": "order_confirmation",
        "language": {
          "code": "en_US"
        },
        "components": [
          {
            "type": "body",
            "parameters": [
              { "type": "text", "parameter_name": "customer_name", "text": "Jessica" },
              { "type": "text", "parameter_name": "order_number", "text": "SKBUP2-4CPIG9" }
            ]
          }
        ]
      }
    }'
  ```
</CodeGroup>
