Skip to main content
Search...C
API Reference

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.

Base URL
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.

GET/api/v1/leadsList all leads

View endpoint details →

Webhooks

Webhooks allow you to receive real-time notifications when events occur in your AdBuy account.

POST/api/v1/webhooksCreate a webhook
PATCH/api/v1/webhooks/:idUpdate a webhook
DELETE/api/v1/webhooks/:idDelete a webhook

View webhook endpoints →

Error 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.

CodeDescription
200OK - Request succeeded
201Created - Resource created successfully
400Bad Request - Invalid parameters
401Unauthorized - Invalid or missing API key
404Not Found - Resource doesn't exist
429Too Many Requests - Rate limit exceeded
500Internal Server Error - Something went wrong on our end