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

# Create WhatsApp Action

> Create WhatsApp messaging actions with template support and dynamic parameters.

### Authorizations

<ParamField header="Authorization" type="string" required>
  Enter your ContactSwing JWT Bearer token.
</ParamField>

### Request Body

<ParamField body="name" type="string" required>
  Action display name. Example: `My Whatsapp Action`
</ParamField>

<ParamField body="description" type="string" required>
  Action purpose. Example: `Send WhatsApp when user requests messaging`
</ParamField>

<ParamField body="type" type="string" required>
  Action type: `"SEND_WHATSAPP"`
</ParamField>

<ParamField body="is_active" type="boolean">
  Enable/disable action
</ParamField>

<ParamField body="action_timing" type="string" required>
  When to trigger: `"during"`
</ParamField>

<ParamField body="phone_number" type="string">
  Override phone number (optional)
</ParamField>

<ParamField body="webhook" type="object" required>
  WhatsApp webhook configuration

  <ParamField body="to" type="string" required>
    Recipient WhatsApp number. Example: `"12817126508"`
  </ParamField>

  <ParamField body="from" type="string" required>
    Sender WhatsApp ID. Example: `"650175178190170"`
  </ParamField>

  <ParamField body="template_name" type="string" required>
    WhatsApp template name. Example: `"call_permession_request"`
  </ParamField>

  <ParamField body="body_params" type="string[]">
    Template body parameters `[]`
  </ParamField>

  <ParamField body="header_params" type="string[]">
    Template header parameters `[]`
  </ParamField>

  <ParamField body="button_params" type="string[]">
    Template button parameters `[]`
  </ParamField>

  <ParamField body="language_code" type="string">
    Template language. Example: `"en"`
  </ParamField>

  <ParamField body="mandatory" type="boolean">
    Require WhatsApp response before proceeding
  </ParamField>
</ParamField>

### Response

**201 Created** - WhatsApp action created successfully

<ResponseField name="ctx_id" type="string">Request context ID</ResponseField>

<ResponseField name="data" type="object">
  <ResponseField name="action_id" type="string">New WhatsApp action ID</ResponseField>
  <ResponseField name="name" type="string">Action name</ResponseField>
  <ResponseField name="type" type="string">"SEND\_WHATSAPP"</ResponseField>
</ResponseField>

**400 Bad Request** - Invalid WhatsApp template or numbers

**401 Unauthorized** - Invalid token
