Back to Documentation
API Reference
Marqly API
Build powerful integrations with our RESTful API. Access leads, contacts, websites, automations, and more.
Base URL
api.marqly.co.za
Version
v1
Format
JSON
Auth
Bearer Token
Authentication
All API requests require authentication using a Bearer token. Contact our team to request your API key.
// Authentication with API Key
const response = await fetch('https://api.marqly.co.za/v1/leads', {
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
}
});API Endpoints
Categories
GET
/v1/leadsList all leads with optional filtering
POST
/v1/leadsCreate a new lead
GET
/v1/contactsList all contacts
POST
/v1/websitesCreate a new website
GET
/v1/websites/{id}Get website details
POST
/v1/automationsCreate an automation workflow
POST
/v1/invoicesCreate a new invoice
GET
/v1/campaignsList all email campaigns
Example: Create Lead
Create a new lead with custom fields
// Create a new lead
const response = await fetch('https://api.marqly.co.za/v1/leads', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'John Smith',
email: 'john@example.com',
phone: '+27123456789',
company: 'Acme Corp',
value: 50000,
source: 'website',
tags: ['hot-lead', 'enterprise']
})
});
const lead = await response.json();
console.log(lead.id); // "lead_abc123"Webhooks
Subscribe to real-time events in your Marqly account. We'll send HTTP POST requests to your endpoint when events occur.
lead.createdlead.updateddeal.woninvoice.paidwebsite.publishedautomation.completed// Webhook payload example
{
"event": "lead.created",
"timestamp": "2024-02-15T10:30:00Z",
"data": {
"id": "lead_abc123",
"name": "John Smith",
"email": "john@example.com",
"value": 50000
}
}Rate Limits
API requests are rate limited to ensure fair usage across all customers.
1,000
Requests per minute
50,000
Requests per day
10
Concurrent requests