Skip to content

Errors

For Developers

All KynectLocal API errors return a consistent JSON envelope so you can handle failures predictably regardless of which endpoint triggered them.

  • Writing error-handling logic for your integration
  • Debugging an unexpected response code
  • Understanding why a feature-gated endpoint returned 403

Every error response body follows this shape:

{
"error": "error_code",
"status": 400
}

Both error (a machine-readable string) and status (the HTTP status code repeated in the body) are always present.


When a request touches a feature the brand is not entitled to use, the API returns a 403 with an expanded error shape:

{
"error": "feature_not_entitled",
"status": 403,
"feature": "api_access",
"isTrial": false,
"upgradeRequired": true,
"requiredTier": "authority"
}
FieldTypeDescription
errorstringAlways "feature_not_entitled" for this error type
statusnumberAlways 403
featurestringThe specific feature the brand lacks access to
isTrialbooleantrue if the brand has a trial for this feature that has expired
upgradeRequiredbooleantrue if upgrading the plan tier would grant access
requiredTierstringThe minimum plan tier required: "local", "network", or "authority"

HTTP statuserror valueMeaning
400bad_requestThe request body or query parameters are malformed
401unauthorizedMissing, invalid, expired, or revoked X-API-Key header
403forbiddenValid key but insufficient access to this resource
403feature_not_entitledThe brand does not have an entitlement for this feature
404not_foundThe requested resource does not exist
429rate_limit_exceededToo many requests — check Retry-After header
500internal_errorUnexpected server error — retry with exponential backoff

A 401 is returned whenever the API cannot authenticate the request. All of the following cause a 401:

  • No X-API-Key header sent
  • Key does not exist or was never valid
  • Key has been revoked (immediately after revocation — no grace period)
  • Key has passed its expiry date
{
"error": "unauthorized",
"status": 401
}

There is no distinction in the response body between a missing key and a revoked one — this is intentional to avoid leaking information to attackers. If you are seeing unexpected 401 responses, check the Audit Log for the key in Integrations → API Keys to see the last authentication events.


When a per-key rate limit is exceeded, the response includes a Retry-After header:

HTTP/1.1 429 Too Many Requests
Retry-After: 1
X-RateLimit-Limit: 10
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1714000060
{
"error": "rate_limit_exceeded",
"status": 429
}

Always respect Retry-After. See Rate Limits for the full per-key limit table and retry patterns.


A minimal error handler in JavaScript:

const res = await fetch('https://api.kynectlocal.com/v1/locations', {
headers: { 'X-API-Key': process.env.KYNECT_API_KEY }
});
if (!res.ok) {
const err = await res.json();
if (err.error === 'feature_not_entitled') {
console.error(`Feature "${err.feature}" requires the ${err.requiredTier} plan.`);
} else {
console.error(`API error ${err.status}: ${err.error}`);
}
}