Developer API

Send direct mail programmatically

Integrate direct mail into your applications, CRMs, and marketing automation workflows. Trigger postcards, letters, and flyers with a single API call.

Quick Start

Up and running in minutes

Create your first campaign with just a few lines of code.

campaign.js
const response = await fetch('https://api.directmailsolutions.ca/api/campaigns', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    mailType: 'postcards',
    quantity: 5000,
    audience: {
      type: 'neighbourhood',
      postalCode: 'M5V 2T6',
      radiusKm: 5,
    },
    design: {
      templateSlug: 'restaurant-grand-opening',
    },
  }),
});

const { campaign } = await response.json();
console.log('Campaign created:', campaign.id);
Features

Everything you need to integrate

RESTful API

Clean, well-documented REST endpoints with JSON request/response format. Supports pagination, filtering, and sorting.

API Key Authentication

Secure API key-based auth with scoped permissions. Generate and manage keys from your dashboard.

Webhooks

Real-time event notifications for campaign status changes, delivery confirmations, and payment events.

Rate Limiting

Generous rate limits with clear headers. Enterprise plans include higher limits and dedicated throughput.

Fast Response Times

Sub-200ms response times for most endpoints. Campaign creation and audience building are processed asynchronously.

Comprehensive Docs

Full API reference with examples in cURL, JavaScript, Python, and Ruby. Interactive API explorer included.

Endpoints

Core API endpoints

A preview of the most-used endpoints. Full documentation available in the help center.

POST
/api/campaigns

Create a new direct mail campaign with audience targeting and design options.

GET
/api/campaigns/:id

Retrieve campaign details including status, delivery tracking, and analytics.

POST
/api/audiences

Build targeted audiences using demographic, geographic, and behavioral filters.

GET
/api/pricing/quote

Get instant pricing quotes for any mail type, quantity, and targeting combination.

POST
/api/webhooks

Receive real-time notifications for campaign status changes and delivery events.

GET
/api/analytics/:campaignId

Access response rates, QR scan data, and ROI metrics for completed campaigns.

Ready to integrate?

Get your API key from your dashboard settings and start sending direct mail programmatically today.

Get Started

Ready to Launch Your Campaign?

Stop losing customers to competitors with better marketing. Get a free, no-obligation quote and start reaching Canadian homeowners this week.

Delivered viaCanada Post