API Reference

Build with the Draper API

Integrate Draper into your workflow with our powerful REST API. Access campaigns, create rules, and automate your PPC management.

example.js
const Draper = require('@draper/sdk');

const client = new Draper({
  apiKey: process.env.DRAPER_API_KEY,
});

// Get all campaigns
const campaigns = await client.campaigns.list({
  accountId: 'acc_123',
  status: 'active',
});

// Create an automation rule
const rule = await client.rules.create({
  name: 'Pause low performers',
  conditions: [
    { metric: 'ctr', operator: 'lt', value: 0.5 },
    { metric: 'clicks', operator: 'gt', value: 100 },
  ],
  actions: [
    { type: 'pause_campaign' },
    { type: 'send_notification' },
  ],
});

Authentication

Secure API key authentication with scoped permissions.

RESTful Design

Clean, predictable URLs and standard HTTP methods.

Webhooks

Real-time notifications for events in your account.

SDKs

Official libraries for Python, Node.js, and PHP.

Base URL:
https://api.draperads.com/v1

API Endpoints

Accounts

GET/v1/accounts
GET/v1/accounts/{id}
GET/v1/accounts/{id}/metrics

Campaigns

GET/v1/campaigns
GET/v1/campaigns/{id}
PATCH/v1/campaigns/{id}
GET/v1/campaigns/{id}/metrics

Rules

GET/v1/rules
POST/v1/rules
PATCH/v1/rules/{id}
DELETE/v1/rules/{id}

Alerts

GET/v1/alerts
GET/v1/alerts/{id}
PATCH/v1/alerts/{id}/acknowledge

Reports

GET/v1/reports
POST/v1/reports
GET/v1/reports/{id}

Authentication

The Draper API uses API keys to authenticate requests. You can view and manage your API keys in your account settings.

  • Include your API key in the Authorization header
  • Create scoped keys with limited permissions
  • Rotate keys without downtime
Example Request
curl -X GET https://api.draperads.com/v1/accounts \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json"

Webhooks

Receive real-time notifications when events happen in your Draper account. Configure webhook endpoints to integrate with your systems.

alert.triggered

When a monitoring alert fires

rule.executed

When an automation rule runs

report.generated

When a report is ready

Ready to start building?

Create your API key and start integrating Draper into your workflow today.