API Keys

Manage your API credentials for submitting leads to Ledly.

Overview

API keys authenticate your lead submissions. Each key is associated with your vendor account and includes:

  • Key ID - Public identifier
  • API Key - Secret authentication token
  • Permissions - What the key can access
  • Rate Limits - Request limits per minute

Generating an API Key

Go to SettingsAPI Keys in the vendor portal

Click Generate

Click the Generate New Key button

Configure the Key

  • Name: Descriptive label (e.g., “Production Server”)
  • Environment: Production or Sandbox
  • Rate Limit: Requests per minute (if configurable)

Copy Your Key

Copy the API key immediately - it won’t be shown again

Store Securely

Save the key in a password manager or secrets vault

🚫

Critical: Your API key is displayed only once. If you lose it, you must generate a new one.


Using Your API Key

Include the API key in the Authorization header:

curl -X POST https://api.ledly.io/api/leads/inbound \
  -H "Authorization: Bearer vk_live_abc123xyz..." \
  -H "Content-Type: application/json" \
  -d '{"email": "[email protected]"}'

Key Formats

EnvironmentPrefixExample
Productionvk_live_vk_live_abc123xyz...
Sandboxvk_test_vk_test_abc123xyz...

Managing Keys

Viewing Keys

Your active keys show:

  • Key name
  • Created date
  • Last used
  • Status (active/revoked)

Revoking a Key

If a key is compromised:

  1. Go to SettingsAPI Keys
  2. Find the compromised key
  3. Click Revoke
  4. Confirm revocation
⚠️

Revocation is immediate. Any systems using that key will immediately fail authentication.

Regenerating a Key

To get a new key without revoking:

  1. Click Regenerate next to the key
  2. The old key remains active for 24 hours
  3. Update your systems with the new key
  4. Old key automatically expires

Multiple Keys

You can have multiple API keys for different purposes:

Key NamePurpose
Production ServerMain lead submission
Backup ServerFailover system
DevelopmentLocal testing
Partner IntegrationThird-party system

Best Practices

  • Separate production and development - Never use production keys for testing
  • Name keys descriptively - Know which system uses which key
  • Rotate regularly - Replace keys every 6-12 months
  • Revoke unused keys - Remove keys for decommissioned systems

Rate Limits

Each API key has rate limits:

PlanLimitWindow
Education1,000 requestsPer minute
EnterpriseCustomCustom

Rate Limit Headers

Response headers show your limit status:

X-RateLimit-Limit: 500
X-RateLimit-Remaining: 450
X-RateLimit-Reset: 1703505600

When Rate Limited

{
  "success": false,
  "error": "Rate limit exceeded",
  "retry_after": 30
}

Solution: Wait retry_after seconds or implement backoff.


IP Whitelisting

Optionally restrict key usage to specific IPs:

  1. Go to SettingsAPI Keys
  2. Select a key → IP Whitelist
  3. Add allowed IP addresses/ranges
  4. Save

Whitelist Formats

Single IP:      203.0.113.50
Range (CIDR):   203.0.113.0/24
Multiple:       203.0.113.50, 203.0.113.51

When IP whitelisting is enabled, requests from non-whitelisted IPs are rejected with a 403 error.


Key Usage Statistics

Monitor your API key usage:

Available Metrics

MetricDescription
Total RequestsLifetime request count
Today’s RequestsRequests in last 24 hours
Success RatePercentage of successful submissions
Avg Response TimeAverage API response time
Last UsedTime of most recent request

Viewing Stats

  1. Go to SettingsAPI Keys
  2. Click Stats next to any key
  3. View usage over time

Security Best Practices

Do:

  • Store keys in environment variables
  • Use secrets management (Vault, AWS Secrets Manager)
  • Rotate keys regularly
  • Use separate keys per environment
  • Monitor for unusual activity

Don’t:

  • Commit keys to version control
  • Share keys via email or chat
  • Use production keys for development
  • Log keys in plain text
  • Hardcode keys in source code

Secure Storage Examples

Environment Variable:

export LEDLY_API_KEY="vk_live_abc123xyz..."

Node.js (.env file):

LEDLY_API_KEY=vk_live_abc123xyz...

Python:

import os
api_key = os.environ.get('LEDLY_API_KEY')

Troubleshooting

”Invalid API Key” Error

  • Verify the key was copied correctly (no extra spaces)
  • Check the key hasn’t been revoked
  • Ensure you’re using the correct environment (prod vs sandbox)
  • Confirm the key prefix matches the endpoint

”Forbidden” (403) Error

  • Check if IP whitelisting is enabled
  • Verify your IP is in the whitelist
  • Confirm the key has required permissions

”Rate Limited” (429) Error

  • Implement exponential backoff
  • Check X-RateLimit-Remaining before requests
  • Request a rate limit increase if needed

API Key Lifecycle

Generate → Active → (Optional: Regenerate) → Revoke → Deleted
StateDescription
ActiveKey can authenticate requests
RegeneratingNew key issued, old key has 24h grace period
RevokedKey immediately stops working
DeletedKey removed from system after 30 days