Developer Reference
API Documentation
The digitaldawn.ai REST API lets you create leads, query events, and manage webhooks programmatically. API access requires a Business tier plan.
Authentication
All API requests require a Bearer token in the Authorization header. Create and manage API keys in your portal settings.
curl https://digitaldawn.ai/api/v1/leads \
-H "Authorization: Bearer sk_live_your_api_key_here"Keep your API key secret. It has the same access as your account. Revoke and regenerate from portal settings if compromised.
Endpoints
Base URL: https://digitaldawn.ai/api/v1
All responses use a consistent envelope:
// Success
{ "data": { ... }, "meta": { "total": 42, "page": 1, "perPage": 20 } }
// Error
{ "error": "Descriptive error message." }Leads
/leadsList leads. Supports ?status=, ?page=, ?perPage=
/leadsCreate a lead and trigger the AI response pipeline.
/leads/:idFetch a single lead by ID.
/leads/:idUpdate lead status (new, contacted, booked, closed).
POST /leads — request body
{
"name": "Jane Smith",
"businessName": "Smith HVAC",
"email": "jane@smithhvac.com",
"phone": "+1-555-555-0100", // optional
"challenge": "We lose leads when we're out on jobs."
}PATCH /leads/:id — request body
{ "status": "booked" } // one of: new, contacted, booked, closedGET /leads — example response
{
"data": [
{
"id": "3f1a2b...",
"name": "Jane Smith",
"businessName": "Smith HVAC",
"email": "jane@smithhvac.com",
"phone": "+1-555-555-0100",
"challenge": "We lose leads when we're out on jobs.",
"status": "new",
"source": "web_form",
"aiResponse": "Hi Jane, thanks for reaching out...",
"createdAt": "2026-04-01T14:22:00Z",
"updatedAt": "2026-04-01T14:22:05Z"
}
],
"meta": { "total": 1, "page": 1, "perPage": 20 }
}Events
/eventsList agent events. Supports ?eventType=, ?leadId=, ?page=
{
"data": [
{
"id": "9c3d...",
"leadId": "3f1a2b...",
"eventType": "email.sent",
"status": "success",
"meta": { "to": "jane@smithhvac.com", "subject": "Re: AI automation for Smith HVAC" },
"createdAt": "2026-04-01T14:22:06Z"
}
],
"meta": { "total": 5, "page": 1, "perPage": 20 }
}Webhooks
Register an HTTPS endpoint to receive real-time event payloads. Webhooks are delivered asynchronously with up to 3 retries on failure. You can also manage webhooks from your portal settings.
/webhooksList registered webhooks.
/webhooksRegister a new webhook endpoint.
/webhooks/:idDelete a webhook.
POST /webhooks — request body
{
"url": "https://your-server.com/webhooks/dd",
"events": ["lead.created", "email.sent"] // omit or [] to receive all events
}POST /webhooks — response (secret shown once)
{
"data": {
"id": "7e9f...",
"url": "https://your-server.com/webhooks/dd",
"events": ["lead.created", "email.sent"],
"status": "active",
"secret": "a3f9b2c1...", // store this — it will not be returned again
"createdAt": "2026-04-01T10:00:00Z"
}
}Webhook event types
lead.createdA new lead was submitted through the intake form or API.
lead.status_changedA lead's status was updated (new → contacted → booked → closed).
email.sentThe AI response email was successfully delivered to the lead.
followup.sentA scheduled follow-up email (day 1, 3, or 7) was sent.
Example payload delivered to your endpoint
POST https://your-server.com/webhooks/dd
Content-Type: application/json
X-DD-Event: lead.created
X-DD-Signature: sha256=a3f9b2c1d8e7...
{
"event": "lead.created",
"tenantId": "abc123...",
"timestamp": "2026-04-01T14:22:00Z",
"data": {
"leadId": "3f1a2b...",
"name": "Jane Smith",
"businessName": "Smith HVAC",
"email": "jane@smithhvac.com",
"phone": "+1-555-555-0100",
"challenge": "We lose leads when we're out on jobs."
}
}Signature verification
Every delivery includes an X-DD-Signatureheader. Verify it using your webhook's signing secret (returned once at registration time).
// Node.js example
import { createHmac } from 'crypto'
function verifyWebhook(
rawBody: string,
signature: string, // value of X-DD-Signature header
secret: string
): boolean {
const expected = 'sha256=' + createHmac('sha256', secret).update(rawBody).digest('hex')
return expected === signature
}Rate limits & errors
The API does not currently enforce a hard rate limit, but per-account AI response and email quotas apply based on your plan tier. Exceeding them returns a 503.
Bad request — missing or invalid parameters.
Unauthorized — missing or invalid API key.
Forbidden — your key does not have permission for this action.
Not found — the resource does not exist or belongs to another tenant.
Service unavailable — AI response or email quota exceeded.
TypeScript SDK
The official @digitaldawn/sdk package wraps the REST API with full TypeScript types and a built-in webhook verification helper.
Install
npm install @digitaldawn/sdkQuickstart
import { DigitalDawn } from '@digitaldawn/sdk'
const dd = new DigitalDawn({ apiKey: 'sk_live_your_api_key' })
// List leads
const { data, meta } = await dd.leads.list({ status: 'new', page: 1 })
// Create a lead
const lead = await dd.leads.create({
name: 'Jane Smith',
businessName: 'Smith HVAC',
email: 'jane@smithhvac.com',
challenge: 'We lose leads when out on jobs.',
})
// Update status
await dd.leads.updateStatus(lead.data.id, 'booked')
// Manage webhooks
const webhook = await dd.webhooks.create({
url: 'https://your-server.com/webhooks/dd',
events: ['lead.created', 'email.sent'],
})
// webhook.data.secret — store this, returned once onlyWebhook verification
// Verify a webhook payload using the SDK helper
const isValid = dd.webhooks.verify(rawBody, req.headers['x-dd-signature'], secret)
if (!isValid) return res.status(401).end()
const event = dd.webhooks.parse(rawBody)
// event is fully typed: LeadCreatedEvent | LeadStatusChangedEvent | ...Point at a local dev server
const dd = new DigitalDawn({
apiKey: 'sk_live_...',
baseUrl: 'http://localhost:3000/api/v1',
})Ready to integrate?
API keys are available on the Business plan. Create and manage keys from your portal settings.
Go to portal settings