Troubleshooting
Common issues and step-by-step solutions.
Authentication Issues
401 Unauthorized
Symptoms: API returns 401 Unauthorized with error code AUTH_001
Solutions:
- Verify your API key is correct
- Check the
x-api-keyheader is set (notx-sender-id- that's v2 legacy) - Ensure no extra whitespace in the key
- Verify the key hasn't been revoked
# Test your API key
curl -H "x-api-key: YOUR_API_KEY" \
https://api.sent.dm/v3/templates403 Forbidden
Symptoms: API returns 403 Forbidden with error codes like AUTH_003
Solutions:
- Verify KYC is complete and approved
- Check account hasn't been suspended
- Ensure you have permission for the requested resource
Message Sending Issues
Messages Stuck in "Queued"
Symptoms: Message status doesn't change from QUEUED
Solutions:
- Wait 2-3 minutes (normal processing time)
- Check KYC status is approved
- Verify account has sufficient balance
- Check dashboard for errors
Insufficient Balance (BUSINESS_003)
Symptoms: API returns 402 with error code BUSINESS_003
Solutions:
- Add payment method in Billing
- Pre-load account credits
- Check for failed payments
429 Rate Limited (BUSINESS_002)
Symptoms: API returns 429 with error code BUSINESS_002
Rate Limits:
- Standard endpoints: 200 requests per minute
- Sensitive endpoints: 10 requests per minute
Solutions:
- Implement exponential backoff
- Reduce request frequency
- Consider batching requests
- Check rate limit headers for reset time
// Implement backoff
const retryAfter = error.headers['retry-after'] || 60;
await sleep(retryAfter * 1000);Invalid Phone Number (VALIDATION_002)
Symptoms: Error code VALIDATION_002
Solutions:
- Use E.164 format (+1234567890)
- Include country code
- Remove spaces and special characters
- Validate before sending
function validateE164(phone: string): boolean {
return /^\+[1-9]\d{1,14}$/.test(phone);
}Template Issues
Template Not Found (RESOURCE_002)
Symptoms: Error code RESOURCE_002
Solutions:
- Verify template ID is correct (use
template.idin request body, nottemplate_id) - Check template exists in dashboard
- Ensure you're using the right account
Template Pending Approval
Symptoms: WhatsApp messages not sending
Solutions:
- Wait for Meta approval (24-48 hours)
- Use SMS in the meantime
- Check template status
- Review rejection reason if applicable
Template Rejected
Symptoms: Template status rejected
Solutions:
- Review Meta's feedback
- Fix identified issues
- Resubmit template
- Contact support if unclear
Webhook Issues
Webhooks Not Received
Symptoms: No webhook events arriving
Solutions:
- Verify webhook URL is correct
- Check endpoint returns 2xx status
- Ensure endpoint responds within 5 seconds
- Verify HTTPS is working
- Check webhook is enabled in dashboard
Duplicate Webhooks
Symptoms: Same event received multiple times
Solutions:
- Implement idempotency using event ID
- Store processed event IDs
- Use database transactions
See Handling Retries.
Webhook Signature Invalid
Symptoms: Signature verification fails
Solutions:
- Use raw request body (not parsed JSON)
- Check secret key is correct
- Use constant-time comparison
- Verify timestamp is recent
Channel Issues
WhatsApp Not Working
Symptoms: WhatsApp messages failing
Solutions:
- Verify WhatsApp Business account is connected
- Check template is approved
- Confirm recipient has WhatsApp
- Verify Meta Business account is in good standing
SMS Delivery Failed
Symptoms: SMS messages failing
Solutions:
- Check phone number format
- Verify recipient hasn't opted out
- Check for carrier blocks
- Review message content compliance
Performance Issues
Slow API Responses
Symptoms: API calls taking > 5 seconds
Solutions:
- Check your network connection
- Verify server location (use closest region)
- Implement connection pooling
- Check for rate limiting
High Error Rate
Symptoms: > 5% of requests failing
Solutions:
- Check error logs for patterns
- Review recent code changes
- Verify API key validity
- Check account status
Dashboard Issues
Can't Access Dashboard
Solutions:
- Clear browser cache
- Try incognito mode
- Check internet connection
- Verify account hasn't been suspended
Data Not Loading
Solutions:
- Refresh the page
- Check for JavaScript errors in console
- Try different browser
- Contact support if persistent
Debugging Steps
General Debugging Process
-
Enable debug logging
const client = new SentDm({ logLevel: 'debug' }); -
Check request/response
console.log('Request:', request); console.log('Response:', response); console.log('Error:', error); -
Test in sandbox mode
await client.messages.send({ to: ['+1234567890'], template: { id: 'tmpl_123' }, sandbox: true }); -
Check dashboard logs
Getting Support
When contacting support, include:
- Request ID (from
meta.request_idin error response) - Timestamp of issue (from
meta.timestamp) - Error code (from
error.code) - Code snippet (remove API keys)
- Expected vs actual behavior
- Steps to reproduce
Email: support@sent.dm