API Documentation

Complete reference for the DripKit API

Dashboard

Getting Started

Base URL

https://dripkit.dabino.dev/api/v1

Authentication

All API requests require authentication using your API key. Include it in the Authorization header:

Authorization: Bearer YOUR_API_KEY

Get your API key from the Settings page.

Response Format

All responses are JSON. Successful requests return a 2xx status code. Errors return 4xx or 5xx with an error message.

Endpoints

POST/contacts

Enroll a contact in a campaign

Request Body

{
  "email": "user@example.com",
  "campaign_id": "uuid-of-campaign",
  "metadata": {
    "name": "John Doe",
    "plan": "pro",
    "custom_field": "value"
  }
}

Response (201 Created)

{
  "success": true,
  "contact": {
    "id": "contact-uuid",
    "email": "user@example.com",
    "campaign_id": "campaign-uuid",
    "enrolled_at": "2024-01-15T10:30:00Z"
  }
}

Example

curl -X POST https://dripkit.dabino.dev/api/v1/contacts \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "user@example.com",
    "campaign_id": "campaign-uuid",
    "metadata": {"name": "John"}
  }'
POST/contacts/:id/unsubscribe

Unsubscribe a contact from their campaign

Parameters

id- Contact UUID

Response (200 OK)

{
  "success": true,
  "message": "Contact unsubscribed successfully"
}

Example

curl -X POST https://dripkit.dabino.dev/api/v1/contacts/contact-uuid/unsubscribe \
  -H "Authorization: Bearer YOUR_API_KEY"
GET/campaigns

List all your campaigns

Response (200 OK)

{
  "campaigns": [
    {
      "id": "campaign-uuid",
      "name": "Onboarding Sequence",
      "description": "Welcome new users",
      "is_active": true,
      "created_at": "2024-01-15T10:00:00Z",
      "step_count": 3,
      "contact_count": 42
    }
  ],
  "total": 1
}

Example

curl -X GET https://dripkit.dabino.dev/api/v1/campaigns \
  -H "Authorization: Bearer YOUR_API_KEY"

Error Responses

Status CodeDescription
400Bad Request - Invalid parameters
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
404Not Found - Resource doesn't exist
409Conflict - Resource already exists
429Too Many Requests - Rate limit exceeded
500Internal Server Error

SDK Examples

JavaScript / Node.js

// Using fetch
const API_KEY = 'your_api_key'
const BASE_URL = 'https://dripkit.dabino.dev/api/v1'

async function enrollContact(email, campaignId, metadata = {}) {
  const response = await fetch(`${BASE_URL}/contacts`, {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${API_KEY}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      email,
      campaign_id: campaignId,
      metadata
    }
  }
  if (!response.ok) {
    const error = await response.json()
    throw new Error(error.error)
  }
  return response.json()
}

// Usage
await enrollContact('user@example.com', 'campaign-uuid', {
  name: 'John Doe',
  plan: 'pro'
})

Python

import requests

API_KEY = 'your_api_key'
BASE_URL = 'https://dripkit.dabino.dev/api/v1'

def enroll_contact(email, campaign_id, metadata=None):
    response = requests.post(
        f'{}BASE_URL}/contacts',
        headers={
            'Authorization': f'Bearer {API_KEY}',
            'Content-Type': 'application/json'
        },
        json={
            'email': email,
            'campaign_id': campaign_id,
            'metadata': metadata or {}
        }
    )
    response.raise_for_status()
    return response.json()

# Usage
result = enroll_contact('user@example.com', 'campaign-uuid', {
    'name': 'John Doe',
    'plan': 'pro'
})

Rate Limits

Current Limits

All API endpoints are rate limited to prevent abuse and ensure fair usage:

60requests per minute per API key

Rate Limit Headers

All API responses include headers to help you track your usage:

X-RateLimit-Limit: 60
X-RateLimit-Remaining: 59
X-RateLimit-Reset: 1704067200000

Exceeding Limits

If you exceed the rate limit, you'll receive a 429 status code:

{
  "error": "Rate limit exceeded. Please try again later.",
  "limit": 60,
  "remaining": 0,
  "reset": "2024-01-15T10:30:00.000Z"
}

Wait until the reset time before making additional requests.

Best Practices

  • Implement exponential backoff when you receive 429 responses
  • Cache responses when possible to reduce API calls
  • Batch contact enrollments instead of making individual requests
  • Monitor the rate limit headers to avoid hitting limits