API ReferenceOverview

API Reference

Complete reference documentation for the Ledly REST API.

Base URL

https://api.ledly.io/api

For vendor lead ingestion:

https://api.ledly.io/api/v1

Authentication

Ledly supports two authentication methods:

Bearer Token (User API)

For user-facing APIs, use a Bearer token:

curl -H "Authorization: Bearer your_jwt_token" \
  https://api.ledly.io/api/leads

Get tokens by logging in via /api/auth/login.

API Key (Vendor API)

For vendor integrations, use an API key:

curl -H "Authorization: Bearer your_api_key" \
  https://api.ledly.io/api/leads/inbound

Generate API keys in SettingsAPI Keys.

⚠️

Never expose API keys or tokens in client-side code, URLs, or version control.


API Sections


Quick Reference

Leads

MethodEndpointDescription
GET/leadsList leads with filtering
GET/leads/:idGet lead details
GET/leads/:id/activityGet lead activity log
POST/leadsCreate a new lead
PATCH/leads/:idUpdate a lead
DELETE/leads/:idSoft delete a lead
POST/leads/bulk-updateBulk update leads
POST/leads/bulk-deleteBulk delete leads

Lead Ingestion (Vendor API)

MethodEndpointDescription
POST/v1/leads/ingestSubmit a single lead
POST/v1/leads/bulk-ingestSubmit multiple leads

Vendors

MethodEndpointDescription
GET/vendorsList vendors
GET/vendors/:idGet vendor details
POST/vendorsCreate vendor
PUT/vendors/:idUpdate vendor
DELETE/vendors/:idDelete vendor
POST/vendors/:id/enableEnable vendor
POST/vendors/:id/disableDisable vendor

Enrichment

MethodEndpointDescription
GET/enrichment/rulesList enrichment rules
POST/enrichment/rulesCreate rule
PATCH/enrichment/rules/:idUpdate rule
DELETE/enrichment/rules/:idDelete rule
POST/enrichment/testTest rules
GET/enrichment/custom-fieldsList custom fields
POST/enrichment/custom-fieldsCreate custom field

Webhooks

MethodEndpointDescription
GET/webhooksList webhooks
POST/webhooksCreate webhook
PATCH/webhooks/:idUpdate webhook
DELETE/webhooks/:idDelete webhook
POST/webhooks/:id/testTest webhook

CRM

MethodEndpointDescription
GET/crm/connectionsList CRM connections
POST/crm/connectionsCreate connection
POST/crm/connections/:id/testTest connection
DELETE/crm/connections/:idRemove connection
POST/crm/:id/sync/:leadIdSync lead to CRM

Users

MethodEndpointDescription
GET/usersList users
POST/usersCreate user
GET/users/:idGet user
PATCH/users/:idUpdate user
DELETE/users/:idDelete user
POST/users/inviteInvite user

Analytics

MethodEndpointDescription
GET/analyticsDashboard overview
GET/analytics/executive-summaryExecutive summary
GET/analytics/source-performanceSource performance
GET/analytics/conversion-funnelConversion funnel
GET/analytics/lead-volume-trendVolume trends
GET/analytics/vendor-roiVendor ROI

Request Format

Headers

Content-Type: application/json
Authorization: Bearer <token>

Request Body (JSON)

{
  "email": "[email protected]",
  "first_name": "John",
  "last_name": "Doe"
}

Query Parameters

Filtering and pagination:

GET /api/leads?page=1&limit=20&status=active&source=web
ParameterTypeDescription
pageintegerPage number (default: 1)
limitintegerItems per page (default: 20, max: 100)
sortBystringSort field
sortOrderstringasc or desc

Response Format

Success Response

{
  "data": {
    "id": "lead_abc123",
    "email": "[email protected]",
    "first_name": "John",
    "last_name": "Doe",
    "created_at": "2024-12-25T10:30:00Z"
  }
}

List Response (with pagination)

{
  "data": [
    { "id": "lead_1", "email": "[email protected]" },
    { "id": "lead_2", "email": "[email protected]" }
  ],
  "meta": {
    "page": 1,
    "limit": 20,
    "total": 150,
    "totalPages": 8
  }
}

Error Response

{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid input",
    "details": [
      { "field": "email", "message": "Invalid email format" }
    ]
  }
}

HTTP Status Codes

CodeMeaning
200OK - Request succeeded
201Created - Resource created
204No Content - Deleted successfully
400Bad Request - Invalid input
401Unauthorized - Invalid/missing auth
403Forbidden - Insufficient permissions
404Not Found - Resource doesn’t exist
409Conflict - Duplicate resource
422Unprocessable - Business logic error
429Too Many Requests - Rate limited
500Internal Server Error

Rate Limits

EndpointLimitWindow
Authentication10 requests1 minute
Lead Ingestion500 requests1 minute
General API100 requests1 minute
Export10 requests1 minute
Bulk Operations20 requests1 minute

Rate limit headers:

X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1703505600

SDKs and Libraries

Official SDKs coming soon. In the meantime, use standard HTTP clients:

LanguageRecommended Library
JavaScriptfetch or axios
Pythonrequests
PHPGuzzleHttp
RubyHTTParty
Gonet/http

Changelog

2024-12-25

  • Added bulk lead ingestion endpoint
  • Added analytics API

2024-11-15

  • Added webhook delivery logs
  • Improved error messages

2024-10-01

  • Initial API release