Developers
Rate limits and billing
What this does
This page lists the limits on each API host, what a 429 response looks like, and how to back off and retry. It also explains what is billed when you use the API.
The short version: each credential gets 120 requests per 60 seconds and 50,000 requests per 24 hours. Go over either one and you get a 429 with a Retry-After header. Wait that many seconds, then retry.
The limits
Both hosts use the same two numbers.
| Limit | Value | Window |
|---|---|---|
| Short window | 120 requests | 60 seconds |
| Daily cap | 50,000 requests | 24 hours |
The limits count per credential, not per account. Each API key has its own counters, so two keys on one account each get their own 120 and 50,000.
The edge push host
This is the canonical host for pushes: https://{customerPublicId}.lgnapi.com/v1/contacts, /v1/contacts/{sourceId} and /v1/contacts/highlevel.
| Route | Counted per |
|---|---|
POST /v1/contacts |
API key |
POST /v1/contacts/{sourceId} |
Source (the inbound connection in the URL) |
POST /v1/contacts/highlevel |
Your account plus the HighLevel location |
How the edge counts:
- The short window is approximate. Each edge location keeps its own count, and the counts sync with a small delay. Plan for 120 per minute, but do not depend on the exact request that trips it.
- The daily cap is exact. One counter per credential tracks it.
- The 24 hours start at your first request, not at midnight. The window resets 24 hours after the first request that opened it.
- Only real requests count. A request that fails authentication or routing does not use up your limit.
The portal origin
https://app.ospry.ai serves POST /api/contacts/links, and POST /api/contacts as a fallback push path. Use the edge host for pushes when you can.
- Short window: 120 requests per 60 seconds per API key. Each portal server counts on its own, so treat 120 per minute as your budget, not a guaranteed ceiling.
- Daily cap: 50,000 requests per 24 hours per API key. The window starts at the first request.
POST /api/contacts/linkshas one more limit: 120 requests per 60 seconds per account. It applies to API key calls and to signed-in portal sessions. A key call to this route counts against both its key limit and the account limit.
The daily cap is not a hard ceiling
On both hosts, the daily cap fails open. If the counter behind it is briefly unavailable, OSPRY lets your requests through rather than block your data. The short window on the edge also fails open. So a limit can sometimes allow more than its number. Do not build on that. Treat the numbers above as your budget.
When you hit a limit
You get HTTP 429 and this body:
{ "ok": false, "error": "rate limited" }
The response carries a Retry-After header. Its value is a whole number of seconds, at least 1. It is set only on a 429.
What Retry-After holds:
| Host | Short window tripped | Daily cap tripped |
|---|---|---|
| Edge | 60 (the full window) |
The seconds left in your 24-hour window |
| Portal | The seconds left in the current 60-second window | 86400 (the full 24 hours) |
Backing off and retrying
A good retry loop does four things:
- If the response has
Retry-After, wait that long. - If it does not, wait an exponential delay: 1 s, 2 s, 4 s, and so on.
- Add random jitter, so many clients do not retry at the same moment.
- Cap the delay and the number of tries, then give up and log it.
Retry a 429 or a 503. A push retry is safe: OSPRY matches records on source and external_id, so sending the same batch twice updates the same contacts instead of making new ones. Do not retry a 400, 401 or 403. Those need a fix first.
// Push a batch to the edge host, backing off on 429 and 503.
const BASE_URL = 'https://YOUR_PUBLIC_ID.lgnapi.com';
const MAX_ATTEMPTS = 6;
const BASE_DELAY_MS = 1000;
const MAX_DELAY_MS = 60_000;
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
function backoffDelay(attempt, retryAfterHeader) {
const retryAfter = Number(retryAfterHeader);
if (Number.isFinite(retryAfter) && retryAfter > 0) {
// Honor the server. Add up to 1 s of jitter so clients spread out.
return retryAfter * 1000 + Math.random() * 1000;
}
// No header: exponential backoff with full jitter, capped.
const ceiling = Math.min(MAX_DELAY_MS, BASE_DELAY_MS * 2 ** attempt);
return Math.random() * ceiling;
}
async function pushContacts(apiKey, contacts) {
for (let attempt = 0; attempt < MAX_ATTEMPTS; attempt++) {
const res = await fetch(`${BASE_URL}/v1/contacts`, {
method: 'POST',
headers: {
Authorization: `Bearer ${apiKey}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ contacts }),
});
if (res.status !== 429 && res.status !== 503) return res;
const delay = backoffDelay(attempt, res.headers.get('Retry-After'));
// A daily-cap 429 can ask you to wait hours. Stop and alert instead.
if (delay > MAX_DELAY_MS * 2) {
throw new Error(`Rate limited; retry after ${Math.round(delay / 1000)} s`);
}
await sleep(delay);
}
throw new Error('Gave up after repeated 429 or 503 responses');
}
Read your key from a secret store or an environment variable. Never put it in code that runs in a browser.
Billing
API calls are not billed today, and pricing may change with advance notice. There is no per-call price and no monthly call allowance. A request does not take money from your wallet by itself.
- Access comes with the API access plan feature. If your plan does not include it, API calls are refused. Your use is bounded by the limits on this page.
- Paid work a call starts is charged as usual. A pushed contact can start enrichment. When it does, that enrichment is charged to your wallet the same way as any other enrichment. You pay for the enrichment, not for the call.
- No per-key switch for enrichment yet. You can not yet turn enrichment on or off for a single key. See Not yet available.
Tips & FAQs
- Batch your pushes. One push can carry many records. Fewer, larger batches use far less of your limit than one call per contact.
- Use one key per integration. Each key gets its own counters, so a busy tool can not use up another tool's limit. It also makes a leaked key easy to revoke.
- A
429with a largeRetry-Aftermeans the daily cap. Stop retrying, alert someone, and look for a loop or a runaway job. - Can I get higher limits? Not yet. Limits are the same for every plan today. Per-plan limits are planned; see Not yet available.