Skip to content

Error Codes

All Tolinku API errors return a JSON object with an error field containing a human-readable message.

{
"error": "Human-readable error message"
}

Plan enforcement errors include an additional code field:

{
"error": "This feature requires a paid plan",
"code": "FEATURE_GATED"
}

Usage limit errors also include current usage data:

{
"error": "API call limit exceeded",
"code": "USAGE_EXCEEDED",
"usage": {
"clicks": 55000,
"clicksLimit": 50000,
"apiCalls": 110000,
"apiCallsLimit": 100000
}
}
StatusMeaningCommon causes
400Bad RequestMissing required field, invalid format, validation failure
401UnauthorizedMissing or invalid API key
403ForbiddenPublishable key used on a secret-only endpoint, feature gated, usage exceeded, Appspace frozen
404Not FoundResource does not exist (route, referral, audience, message)
429Too Many RequestsRate limit exceeded (1,000 req/min for API, 60 req/min for clicks)
500Internal Server ErrorUnexpected server error

These codes appear in the code field of 403 responses:

CodeMeaningResolution
FEATURE_GATEDThe feature is not available on the free tierUpgrade to a paid plan (Standard or higher)
USAGE_EXCEEDEDThe Appspace has exceeded 110% of its plan’s click or API call limitUpgrade to a higher tier, or wait for the next billing cycle
APPSPACE_FROZENThe Appspace is frozen due to a billing issueUpdate your payment method in billing settings
ErrorStatusCause
Invalid or missing API key401The X-API-Key header is missing, or the key does not exist or has been revoked
This endpoint requires a secret API key403A publishable key (tolk_pub_) was used on an endpoint that requires a secret key (tolk_sec_)
ErrorStatusCause
event_type is required400The event_type field is missing from the request body
event_type must start with "custom."400Custom events must use the custom. prefix
event_type must match pattern: custom.[a-z0-9_]+400The event name contains invalid characters (use only lowercase letters, numbers, underscores)
event_type must be 100 characters or less400The event name is too long
Custom events are not available on the free tier403Upgrade to a paid plan to use custom event tracking
ErrorStatusCause
user_id is required400Missing user_id when creating a referral code
Maximum referrals per user reached400The user has hit the per-user referral limit set in your Appspace settings
Referrals are not enabled for this Appspace403Referrals are not configured in your Appspace settings
Referral not found404The referral code does not exist
Referral not found or already completed404The referral has already been completed and cannot be completed again
ErrorStatusCause
Missing prefix400The prefix field is missing from the route resolution request
Missing token parameter400The token query parameter is missing from the deferred claim request
No app configured for this domain404The hostname does not match any Appspace
Route not found404No route exists with the given prefix
No matching deferred link found404No deferred link matches the token or device signals
ErrorStatusCause
API key or render token required401The render endpoint requires either an API key or a valid render token
Invalid or expired render token401The render token has expired; generate a new one
Message not found404The message ID does not exist
Message has no content404The message exists but has no visual content to render
ErrorStatusCause
user_id query parameter is required400The user_id parameter is missing from the membership check
Audience not found404The audience/segment ID does not exist
const res = await fetch(url, { headers: { 'X-API-Key': key } });
if (!res.ok) {
const body = await res.json();
console.error(`API error ${res.status}: ${body.error}`);
if (body.code === 'USAGE_EXCEEDED') {
// Handle usage limit
}
}