Developer Docs

Universal Webhook API

Connect any CRM or tool to AskAd.ai with a simple webhook. Push leads, capture form submissions, and query your data programmatically.

Authentication

All API requests require an API key. Generate one from Settings > API Keys in your AskAd dashboard. Include it in the Authorization header:

HTTP Header
Authorization: Bearer YOUR_API_KEY

Keep your API key secret. Do not expose it in client-side code or public repositories.

Endpoints

POST/api/v1/leads/inbound

Push leads from any external source (CRM, form builder, Zapier, etc.) into AskAd.

Request Body

JSON
{
  "email": "jane@example.com",
  "first_name": "Jane",
  "last_name": "Smith",
  "phone": "+1234567890",
  "source": "hubspot",
  "metadata": {
    "deal_value": 5000
  }
}

Response

JSON
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "status": "created"
}
POST/api/v1/leads/capture

Capture leads from web forms, landing pages, or embedded widgets.

Request Body

JSON
{
  "email": "john@example.com",
  "name": "John Doe",
  "source": "website",
  "page_url": "https://example.com/pricing"
}

Response

JSON
{
  "id": "660e8400-e29b-41d4-a716-446655440001",
  "status": "created"
}
GET/api/v1/contacts

List all contacts in your workspace. Supports pagination with ?page=1&limit=50 query parameters. Requires authentication.

GET/api/v1/deals

List all deals in your workspace. Filter by stage with ?stage=negotiation. Requires authentication.

Webhooks (Outbound)

Coming Soon

Register a URL to receive real-time notifications when leads convert, deals close, or campaigns hit spend thresholds. Configure outbound webhooks from Settings > Webhooks.

Rate Limits

API requests are rate-limited to 100 requests per minute per API key. If you exceed the limit, you will receive a 429 Too Many Requests response.

Rate limit headers are included in every response: X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset.

Code Examples

Here are examples for pushing a lead via the inbound endpoint in three languages.

cURL
curl -X POST https://app.askad.ai/api/v1/leads/inbound \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "jane@example.com",
    "first_name": "Jane",
    "last_name": "Smith",
    "phone": "+1234567890",
    "source": "hubspot",
    "metadata": { "deal_value": 5000 }
  }'
JavaScript (fetch)
const response = await fetch(
  "https://app.askad.ai/api/v1/leads/inbound",
  {
    method: "POST",
    headers: {
      "Authorization": "Bearer YOUR_API_KEY",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      email: "jane@example.com",
      first_name: "Jane",
      last_name: "Smith",
      phone: "+1234567890",
      source: "hubspot",
      metadata: { deal_value: 5000 },
    }),
  }
);

const data = await response.json();
console.log(data.id); // "uuid"
Python (requests)
import requests

response = requests.post(
    "https://app.askad.ai/api/v1/leads/inbound",
    headers={
        "Authorization": "Bearer YOUR_API_KEY",
        "Content-Type": "application/json",
    },
    json={
        "email": "jane@example.com",
        "first_name": "Jane",
        "last_name": "Smith",
        "phone": "+1234567890",
        "source": "hubspot",
        "metadata": {"deal_value": 5000},
    },
)

data = response.json()
print(data["id"])  # "uuid"

Ready to integrate?

Sign up for a free account and generate your API key in under a minute.