API Integration
Use the Ledly API to programmatically submit leads from your applications.
Authentication
All API requests require an API key. Get your key from Settings → API Keys.
Include your API key in the request header:
Authorization: Bearer your_api_key_hereSubmit a Lead
POST https://api.ledly.io/api/leads
Request Body
{
"email": "student@example.com",
"first_name": "John",
"last_name": "Doe",
"phone": "+1234567890",
"program_code": "MBA",
"source": "api",
"custom_fields": {
"start_date": "Fall 2025",
"referral_source": "Google"
}
}Response
{
"success": true,
"lead_id": "lead_abc123",
"message": "Lead created successfully"
}Required Fields
| Field | Type | Description |
|---|---|---|
email | string | Lead’s email address |
Optional Fields
| Field | Type | Description |
|---|---|---|
first_name | string | Lead’s first name |
last_name | string | Lead’s last name |
phone | string | Phone number |
program_code | string | Program identifier |
source | string | Lead source |
custom_fields | object | Additional custom fields |
Rate Limits
- Standard: 100 requests per minute
- Enterprise: Contact us for higher limits
Error Codes
| Code | Description |
|---|---|
| 400 | Invalid request body |
| 401 | Invalid or missing API key |
| 422 | Validation error (e.g., invalid email) |
| 429 | Rate limit exceeded |
| 500 | Server error |
Example: cURL
curl -X POST https://api.ledly.io/api/leads \
-H "Authorization: Bearer your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"email": "student@example.com",
"first_name": "John",
"last_name": "Doe",
"program_code": "MBA"
}'Example: JavaScript
const response = await fetch('https://api.ledly.io/api/leads', {
method: 'POST',
headers: {
'Authorization': 'Bearer your_api_key_here',
'Content-Type': 'application/json',
},
body: JSON.stringify({
email: 'student@example.com',
first_name: 'John',
last_name: 'Doe',
program_code: 'MBA',
}),
});
const data = await response.json();
console.log(data);