API Overview
The DailyDraft API is a RESTful API that allows you to programmatically manage your newsletters, issues, and subscribers.
Base URL
All API endpoints are relative to:
https://dailydraft.ai/api/v1
API Scope
Each API key is scoped to a single newsletter. When you make requests, you're operating on the newsletter that owns the API key.
Available Resources
| Resource | Endpoints | Description |
|---|---|---|
| Newsletter | GET, PATCH |
View and update newsletter settings |
| Issues | GET, POST, PATCH, DELETE |
Create, update, send, and manage issues |
| Subscriptions | GET, POST, PATCH, DELETE |
Add, update, and remove subscribers |
| Webhook Subscriptions | GET, POST, DELETE |
Subscribe to webhook events |
Request Format
Send JSON in request bodies:
Content-Type: application/json
Response Format
Success Response
{
"data": {
"id": 123,
"email": "[email protected]",
"name": "John Doe",
"status": "active",
"created_at": "2025-01-10T12:00:00Z"
}
}
List Response (Paginated)
{
"data": [
{ "id": 1, ... },
{ "id": 2, ... }
],
"meta": {
"total": 150,
"page": 1,
"per_page": 25,
"total_pages": 6
}
}
Error Response
{
"error": {
"code": "validation_error",
"message": "Email is invalid",
"details": {
"email": ["is invalid"]
}
}
}
HTTP Methods
| Method | Description |
|---|---|
GET |
Retrieve a resource or list |
POST |
Create a new resource |
PATCH |
Update an existing resource |
DELETE |
Remove a resource |
Pagination
List endpoints support pagination:
GET /api/v1/subscriptions?page=2&per_page=50
| Parameter | Default | Max |
|---|---|---|
page |
1 | — |
per_page |
25 | 100 |
Filtering
Some endpoints support filtering:
# Get active subscribers
GET /api/v1/subscriptions?status=active
# Get subscribers with a specific tag
GET /api/v1/subscriptions?tag=vip
Rate Limiting
Rate limit headers are included in responses:
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1704931200
When rate limited, you'll receive a 429 Too Many Requests response.
Versioning
The API version is included in the URL path (/api/v1/). We'll maintain backwards compatibility within a version and announce deprecations in advance.
Next Steps
Still need help?
Can't find what you're looking for? Chat with our AI assistant or create a support ticket.
Sign in to get support