API Reference
Welcome to the AdBuy API! Use this API to send messages, manage contacts, and automate workflows. All endpoints require an API key for authentication.
Getting Started
The AdBuy API is organized around REST principles. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes and authentication.
https://api.adbuy.ai/api/v1/Authentication
Authenticate your API requests by including your API key in the Authorization header. API keys can be created and managed from your AdBuy dashboard.
curl https://api.adbuy.ai/api/v1/leads \ -H "Authorization: Bearer YOUR_API_KEY"
Keep your API keys secure! Do not share them in publicly accessible areas such as GitHub, client-side code, or public repositories.
Endpoints
The API provides endpoints for managing leads and webhooks.
Leads
Leads represent potential customers captured through your campaigns.
/api/v1/leadsList all leadsWebhooks
Webhooks allow you to receive real-time notifications when events occur in your AdBuy account.
/api/v1/webhooksCreate a webhook/api/v1/webhooks/:idUpdate a webhook/api/v1/webhooks/:idDelete a webhookError Handling
AdBuy uses conventional HTTP response codes to indicate the success or failure of an API request. Codes in the 2xx range indicate success. Codes in the 4xx range indicate an error with the information provided. Codes in the 5xx range indicate an error with AdBuy's servers.
| Code | Description |
|---|---|
| 200 | OK - Request succeeded |
| 201 | Created - Resource created successfully |
| 400 | Bad Request - Invalid parameters |
| 401 | Unauthorized - Invalid or missing API key |
| 404 | Not Found - Resource doesn't exist |
| 429 | Too Many Requests - Rate limit exceeded |
| 500 | Internal Server Error - Something went wrong on our end |