Developer Documentation

Integrate PollQR webhooks with your existing systems. Automate email marketing, sync CRM data, and build powerful customer feedback workflows.

Webhook Events

PollQR sends real-time webhook notifications for key events. Configure endpoints to receive instant updates.

response.created

Triggered when a customer submits a survey response

Common Use Cases:

Add subscribers to email lists, trigger follow-up workflows, update CRM records

response.updated

Triggered when a survey response is modified or updated

Common Use Cases:

Sync changes to external databases, update customer profiles

survey.completed

Triggered when a survey reaches its response limit or is marked complete

Common Use Cases:

Generate reports, archive data, trigger campaign completion workflows

Integration Examples

Real-world examples of how developers integrate PollQR webhooks with popular platforms and services.

Email Marketing Automation

Automatically add newsletter subscribers to your email marketing platform

Popular Integrations:

MailChimpKlaviyoSendGridConstant Contact

Example Code:

// Example: Add subscriber to MailChimp
const addToMailChimp = async (email, name) => {
  const response = await fetch(`https://${server}.api.mailchimp.com/3.0/lists/${listId}/members`, {
    method: 'POST',
    headers: {
      'Authorization': `Basic ${apiKey}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      email_address: email,
      status: 'subscribed',
      merge_fields: { FNAME: name.split(' ')[0], LNAME: name.split(' ')[1] }
    })
  });
  return response.json();
};

CRM Integration

Sync customer feedback and contact information to your CRM system

Popular Integrations:

SalesforceHubSpotPipedriveAirtable

Example Code:

// Example: Create HubSpot contact
const createHubSpotContact = async (email, name, feedback) => {
  const response = await fetch('https://api.hubapi.com/crm/v3/objects/contacts', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${hubspotToken}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      properties: {
        email: email,
        firstname: name.split(' ')[0],
        lastname: name.split(' ')[1],
        notes: feedback
      }
    })
  });
  return response.json();
};

Slack Notifications

Get instant notifications in Slack for negative feedback or high-value leads

Popular Integrations:

SlackMicrosoft TeamsDiscord

Example Code:

// Example: Send Slack notification for low NPS scores
const sendSlackAlert = async (score, feedback, customerInfo) => {
  if (score <= 6) { // Detractor alert
    await fetch(slackWebhookUrl, {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify({
        text: `🚨 Low NPS Alert: Score ${score}/10`,
        attachments: [{
          color: 'danger',
          fields: [
            { title: 'Customer', value: customerInfo.email, short: true },
            { title: 'Feedback', value: feedback, short: false }
          ]
        }]
      })
    });
  }
};

Analytics & Data Warehousing

Stream survey data to your analytics platform for advanced reporting

Popular Integrations:

Google AnalyticsMixpanelAmplitudeBigQuery

Example Code:

// Example: Track events in Google Analytics
const trackToGA = async (eventData) => {
  await fetch('https://www.google-analytics.com/mp/collect', {
    method: 'POST',
    body: JSON.stringify({
      client_id: 'unique-client-id',
      events: [{
        name: 'survey_response',
        parameters: {
          survey_type: eventData.survey_type,
          nps_score: eventData.nps_score,
          custom_parameter_1: eventData.location
        }
      }]
    })
  });
};

Webhook Payload Structure

Understanding the data structure sent to your webhook endpoints for different event types.

response.created Event

Standard Fields

eventstring
survey_iduuid
response_iduuid
timestampISO 8601
business_iduuid

Response Data

answersobject
nps_scorenumber
completion_timeseconds
ip_addressstring
user_agentstring

Example Payload

{
  "event": "response.created",
  "survey_id": "550e8400-e29b-41d4-a716-446655440000",
  "response_id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
  "timestamp": "2024-01-01T12:00:00.000Z",
  "business_id": "550e8400-e29b-41d4-a716-446655440001",
  "survey": {
    "title": "Customer Satisfaction Survey",
    "template_type": "nps"
  },
  "response": {
    "answers": {
      "1": 9,
      "2": "Great service and friendly staff!",
      "3": "john@example.com",
      "4": "+1234567890"
    },
    "nps_score": 9,
    "completion_time": 45,
    "ip_address": "192.168.1.1",
    "user_agent": "Mozilla/5.0..."
  }
}

Security & Reliability

Enterprise-grade security and reliability features to ensure your webhook integrations are secure and dependable.

🔐

HMAC Signature Verification

Every webhook includes an HMAC-SHA256 signature to verify authenticity and prevent tampering.

🔄

Automatic Retries

Failed webhooks are retried up to 3 times with exponential backoff to ensure delivery.

📊

Delivery Monitoring

Track webhook delivery status, response times, and error rates in your dashboard.

Real-time Delivery

Webhooks are delivered within seconds of the triggering event for real-time automation.

HMAC Signature Verification

Verify webhook authenticity by validating the HMAC signature sent in the X-PollQR-Signature header.

Node.js Example:

const crypto = require('crypto');

function verifyWebhookSignature(payload, signature, secret) {
  const expectedSignature = crypto
    .createHmac('sha256', secret)
    .update(payload, 'utf8')
    .digest('hex');
  
  return crypto.timingSafeEqual(
    Buffer.from(signature, 'hex'),
    Buffer.from(expectedSignature, 'hex')
  );
}

// Usage in your webhook handler
app.post('/webhook', (req, res) => {
  const signature = req.headers['x-pollqr-signature'];
  const payload = JSON.stringify(req.body);
  
  if (!verifyWebhookSignature(payload, signature, process.env.WEBHOOK_SECRET)) {
    return res.status(401).send('Unauthorized');
  }
  
  // Process the webhook...
  res.status(200).send('OK');
});

Ready to Start Building?

1

Create Account

Sign up for free and create your first survey

2

Configure Webhooks

Set up webhook endpoints in your dashboard

3

Start Integrating

Build powerful automations with real-time data

Developer-Friendly Pricing

Start building for free. No setup fees, no hidden costs.