Getting started
Authentication
Secure your API requests with bearer tokens.
Bearer token
All API requests must include your API key in the Authorization header as a Bearer token.
Authorization: Bearer ldm_live_sk_abc123...API key formats
LDM issues two types of API keys. Use the correct key for your environment:
| Prefix | Environment | Description |
|---|---|---|
ldm_live_ | Production | Delivers real messages. Charges apply. |
ldm_test_ | Sandbox | Simulates delivery. No charges, no real emails sent. |
Example request
curl https://api.live-direct-marketing.online/v1/messages \
-H "Authorization: Bearer ldm_live_sk_abc123..." \
-H "Content-Type: application/json"Error responses
If the API key is missing or invalid, the API returns a 401 Unauthorized response:
Missing API key
HTTP/1.1 401 Unauthorized
{
"error": {
"code": "unauthorized",
"message": "Missing Authorization header. Include your API key as a Bearer token."
}
}Invalid API key
HTTP/1.1 401 Unauthorized
{
"error": {
"code": "invalid_api_key",
"message": "The API key provided is invalid or has been revoked."
}
}Security best practices
- ●Never commit API keys to version control.
- ●Store keys in environment variables or a secret manager.
- ●Use
ldm_test_keys during development. - ●Rotate keys periodically from the Dashboard.