# WhatsApp Web

## Send WhatsApp Message via WhatsApp Web

> Send a WhatsApp message directly to a phone number via WhatsApp Web.\
> \
> \*\*Key Features:\*\*\
> \- Send to any phone number (E.164 format required, e.g., +1234567890)\
> \- Automatic contact creation if contact doesn't exist\
> \- Message chunking: Messages are automatically split by double newlines (\n\n) into separate WhatsApp messages\
> \- Natural typing simulation: Delays between chunks simulate human typing speed (500 chars/min)\
> \- Typing indicators: Shows "typing..." status during message sending\
> \- Credit-based: 1 credit per message (regardless of number of chunks)\
> \
> \*\*Requirements:\*\*\
> \- Active WhatsApp Web connection required\
> \- Phone number must be in E.164 format (e.g., +1234567890)\
> \- Sufficient credits (1 credit per message)\
> \
> \*\*Message Chunking Example:\*\*\
> \
> Input message: "Hey Sohaib! 👋\n\nGreat news about your feature request!\n\nI'll let you know when it's live!"\
> \
> Results in 3 separate WhatsApp messages:\
> 1\. Hey Sohaib! 👋\
> 2\. Great news about your feature request!\
> 3\. I'll let you know when it's live!\
> \
> \*\*Note:\*\* This endpoint uses WhatsApp Web, not the Meta Business API, so no template approval is required.<br>

```json
{"openapi":"3.1.0","info":{"title":"DM Champ API","version":"1.0.0"},"servers":[{"url":"https://api.dmchamp.com/v1","description":"Production API Server"}],"security":[{"ApiKeyAuth":[]},{"UserIdAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"query","name":"apiKey","description":"Your DM Champ API key. Obtain from Settings → API Keys."},"UserIdAuth":{"type":"apiKey","in":"query","name":"userId","description":"Your DM Champ User ID. Alternative to apiKey authentication. Cannot be used for agency-only endpoints."}},"parameters":{"ApiKeyParam":{"name":"apiKey","in":"query","description":"API key for authentication. At least one of apiKey or userId is required for protected endpoints.","required":false,"schema":{"type":"string"}}}},"paths":{"/whatsapp-web/send":{"post":{"summary":"Send WhatsApp Message via WhatsApp Web","description":"Send a WhatsApp message directly to a phone number via WhatsApp Web.\n\n**Key Features:**\n- Send to any phone number (E.164 format required, e.g., +1234567890)\n- Automatic contact creation if contact doesn't exist\n- Message chunking: Messages are automatically split by double newlines (\\n\\n) into separate WhatsApp messages\n- Natural typing simulation: Delays between chunks simulate human typing speed (500 chars/min)\n- Typing indicators: Shows \"typing...\" status during message sending\n- Credit-based: 1 credit per message (regardless of number of chunks)\n\n**Requirements:**\n- Active WhatsApp Web connection required\n- Phone number must be in E.164 format (e.g., +1234567890)\n- Sufficient credits (1 credit per message)\n\n**Message Chunking Example:**\n\nInput message: \"Hey Sohaib! 👋\\n\\nGreat news about your feature request!\\n\\nI'll let you know when it's live!\"\n\nResults in 3 separate WhatsApp messages:\n1. Hey Sohaib! 👋\n2. Great news about your feature request!\n3. I'll let you know when it's live!\n\n**Note:** This endpoint uses WhatsApp Web, not the Meta Business API, so no template approval is required.\n","tags":["WhatsApp Web"],"parameters":[{"$ref":"#/components/parameters/ApiKeyParam"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["phoneNumber","message"],"properties":{"phoneNumber":{"type":"string","description":"Recipient's phone number in E.164 format (e.g., +1234567890)","pattern":"^[+][1-9][0-9]{1,14}$"},"message":{"type":"string","description":"Message text. Will be automatically split by double newlines into separate messages."}}}}}},"responses":{"200":{"description":"Message(s) sent successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"contactId":{"type":"string","description":"ID of the contact (created or existing)"},"messagesSent":{"type":"integer","description":"Number of message chunks successfully sent"},"totalChunks":{"type":"integer","description":"Total number of chunks the message was split into"},"messageIds":{"type":"array","items":{"type":"string"},"description":"Array of message IDs for each sent chunk"},"creditsUsed":{"type":"integer","description":"Total credits deducted (always 1 per message, regardless of chunks)"}}}}}},"400":{"description":"Bad request - Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"error":{"type":"string"},"code":{"type":"string"}}}}}},"401":{"description":"Unauthorized - Invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"error":{"type":"string"},"code":{"type":"string"}}}}}},"402":{"description":"Payment required - Insufficient credits","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"error":{"type":"string"},"code":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"error":{"type":"string"},"code":{"type":"string"}}}}}}}}}}}
```
