API & Webhook Integrations

Connect InstantDM to Make.com, Zapier, your CRM, or any custom backend via outbound webhooks and an inbound REST API.

Overview

DirectionWhat It Does
Outbound WebhooksInstantDM sends event data TO your external URL when things happen
Inbound APIYour external system sends commands TO InstantDM to perform actions

Setting Up Webhooks

  1. Go to the API & Integrations page.
  2. Toggle Enable Webhook to ON.
  3. Enter your Webhook URL (Make.com, Zapier, or your own server).
  4. (Optional) Generate a Webhook Secret for signature verification.
  5. Check the boxes for events you want to receive.
  6. Click Save Configuration.

Available Events

EventKeyDescription
New CommentcommentSomeone comments on your post
New DMdm_receivedYou receive a direct message
PostbackpostbackA button is clicked in DMs
Question Answeredquestion_answeredUser answers a question in a flow
Flow Completedflow_completedA 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

  1. On the API & Integrations page, scroll to API Keys.
  2. Click Generate New Key.
  3. Copy the key immediately — you won't see it again.
  4. 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

CodeMeaning
401Unauthorized — invalid or missing API key
402Payment required — plan doesn't include API access
403Forbidden — action not allowed
429Rate limit exceeded — slow down

Next: Team Management →