API & Webhook Integrations
Connect InstantDM to Make.com, Zapier, your CRM, or any custom backend via outbound webhooks and an inbound REST API.
Overview
| Direction | What It Does |
|---|---|
| Outbound Webhooks | InstantDM sends event data TO your external URL when things happen |
| Inbound API | Your external system sends commands TO InstantDM to perform actions |
Setting Up Webhooks
- Go to the API & Integrations page.
- Toggle Enable Webhook to ON.
- Enter your Webhook URL (Make.com, Zapier, or your own server).
- (Optional) Generate a Webhook Secret for signature verification.
- Check the boxes for events you want to receive.
- Click Save Configuration.
Available Events
| Event | Key | Description |
|---|---|---|
| New Comment | comment | Someone comments on your post |
| New DM | dm_received | You receive a direct message |
| Postback | postback | A button is clicked in DMs |
| Question Answered | question_answered | User answers a question in a flow |
| Flow Completed | flow_completed | A flow completes with all collected data |
Webhook Signature Verification (HMAC-SHA256)
Outbound webhooks include an X-Webhook-Signature header. Verify with:
const crypto = require('crypto');
const computed = crypto.createHmac('sha256', YOUR_SECRET)
.update(JSON.stringify(payload)).digest('hex');
const isValid = computed === req.headers['x-webhook-signature']; API Key Management
- On the API & Integrations page, scroll to API Keys.
- Click Generate New Key.
- Copy the key immediately — you won't see it again.
- To revoke, click the trash icon next to the key.
Inbound API Endpoint
POST https://api.instantdm.com/api-webhook
Authorization: Bearer <your_api_key>
Content-Type: application/json Send a DM
{
"action": "send_message",
"type": "dm",
"recipient_id": "<instagram_user_id>",
"message": { "text": "Hello! Thanks for your interest." }
} Reply to a Comment
{
"action": "post_comment",
"comment_id": "<instagram_comment_id>",
"comment_text": "Thanks for your comment!"
} Send Buttons
{
"action": "send_message",
"type": "dm",
"recipient_id": "<instagram_user_id>",
"message": {
"attachment": {
"type": "template",
"payload": {
"template_type": "button",
"text": "Choose an option:",
"buttons": [
{ "type": "web_url", "title": "Visit Site", "url": "https://example.com" }
]
}
}
}
} Plan Requirements
API & Webhook access is included in: Trendsetter, Trendsetter Pro, Multi Starter, Multi Pro, and Multi Ultra. Not available on Free or Legend Pro.
Error Codes
| Code | Meaning |
|---|---|
401 | Unauthorized — invalid or missing API key |
402 | Payment required — plan doesn't include API access |
403 | Forbidden — action not allowed |
429 | Rate limit exceeded — slow down |
Next: Team Management →