Reference
Error codes
The HTTP status codes the SDK endpoints return, what the SDK does with each, and the SDK log messages worth acting on.
The SDK never throws into your app. A problem shows up in two places: an HTTP status from Herald, which the SDK handles on its own, and a line in the device log. This page lists both.
HTTP status codes
These apply to POST /api/v1/sdk/batch and GET /api/v1/sdk/messages. Every error body is { "error": "<message>" }.
| Status | Error message | Cause | SDK behavior | Fix |
|---|---|---|---|---|
| 200 | Accepted. Events Herald couldn't accept are listed in rejected (see Rejected events); the rest were kept | Batch removed from the queue; each rejected event logged at debug level, never retried | Fix the reason in your app | |
| 304 | Messages unchanged (fetch only) | Keeps the cached messages | ||
| 400 | Invalid JSON | The body is not JSON | Batch dropped | Should not happen with the SDKs; report it |
| 400 | A field path and message, such as deviceId: Too small: expected string to have >=1 characters | The batch itself breaks the schema (a bad event is rejected on its own instead). Servers before per-event validation answered this for a bad event too, such as events[2].name: Required | Batch dropped | Update the SDK; the device checks should have stopped the call |
| 400 | deviceId: ... | Bad fetch query | Cached messages kept | Should not happen with the SDKs |
| 401 | Invalid app key | The key is wrong, or its connection is not active | Keeps every queued event and sends nothing more until the app launches again | Copy the key again from the Mobile SDK card |
| 401 | Invalid user token | Verification is Required and the token is missing or wrong, or it is Optional and the token is wrong | Keeps that user's events until the app calls setUserToken; anonymous events keep flowing | Mint the token from the same user ID; call setUserToken after identify; re-mint after rotating the ingest token |
| 408 | Request timeout (from a proxy) | Kept and retried | None needed | |
| 413 | Batch exceeds 512 KB or Batch exceeds 100 events | Too large | Batch dropped | Should not happen with the SDKs; report it |
| 429 | Rate limited (from a proxy or firewall) | Kept and retried after Retry-After | None needed; check firewall rules if it persists | |
| 500 | Internal server error | Server failure | Kept and retried with backoff | Contact your account team if it persists |
| 5xx | Server or gateway failure | Kept and retried with backoff | None needed if it clears |
A batch that is dropped is gone: its events are not sent again. Kept events still count toward the queue limit, so the oldest are dropped if the cause is never fixed. See Batching and offline.
Rejected events
POST /api/v1/sdk/batch and POST /api/v1/events check each event on their own. A bad event is left out and the rest are applied; the response is still 200 and lists it:
{ "data": { "accepted": 2, "duplicates": 0,
"rejected": [{ "id": "e2", "index": 1, "reason": "missing_field", "detail": "events[1].name: Invalid input: expected string, received undefined" }] } }rejected is there only when something was rejected. id is the event's ID, or null when it has no usable one; index is its position in events. Retrying never helps, so the SDKs don't retry a rejected event. Each connection's page in the console (Settings → Sending & SDK, then the connection) lists its recent rejected events under Rejected events, from the SDK or from POST /api/v1/events, kept for 30 days. Any email, phone, token, password, secret, authorization or API key field, at any depth (traits, attributes, properties), and any value that looks like an email, is blanked in the stored copy.
| Reason | Console label | Cause |
|---|---|---|
invalid_type | Unknown event type | type is not one the API knows |
missing_field | Missing field | A required field is missing |
invalid_field | Invalid field | A field has the wrong type, length or value, or the event is not an object. Includes a lifecycle event property of the wrong type, such as a from_push that isn't a boolean, and an attribute key starting with computed_, which is reserved for computed attributes |
too_old | Too old | SDK events only: the event time is more than 30 days before Herald received it (after clock correction). Server events have no age limit |
in_future | Time in the future | The event time is more than 5 minutes after Herald received it. Only POST /api/v1/events can hit it: SDK event times are never later than arrival |
too_large | Too large | The event is over 32 KB as JSON. The SDKs drop such an event on the device (counted in dropped), so it comes from older SDKs or server events |
schema_violation | Schema violation | The event's name has an event schema in Reject invalid events mode and the event breaks it. detail names the first failing property and rule, such as properties.plan: must be one of free, pro (schema signup 1-0-0) |
unknown_schema_version | Unknown schema version | The event's schemaVersion names a version its event schema doesn't have |
schema_warning | Schema warning (accepted) | Not a reject: the event broke a schema in Accept and warn mode and was kept. Stored for the console only (up to 200 a day, apart from the 1,000 rejects), never listed in the response's rejected |
invalid_consent | invalid_consent | Not an event: the batch's context.consent (SDK 0.6.0) is invalid or null, so it was left out and the batch kept. Stored with no event type and never listed in the response's rejected. The SDKs check setConsent, so it comes from other clients |
New codes may be added; treat an unknown one like invalid_field.
Contacts API
POST and DELETE /api/v1/contacts, called from your backend:
| Status | Error message | Cause |
|---|---|---|
| 400 | Invalid JSON | The body is not JSON |
| 400 | Invalid contacts payload: <reason> (<field>) | A contact breaks a rule, such as apns token must be 64+ hex characters or phone must be E.164 |
| 401 | Unauthorized | Missing or unknown ingest token |
| 403 | Forbidden | The connection is inactive, or its type does not take contacts |
| 500 | Internal server error | Server failure |
Users and events APIs
POST /api/v1/users and POST /api/v1/events, called from your backend:
| Status | Error message | Cause |
|---|---|---|
| 400 | Invalid JSON | The body is not JSON |
| 400 | Invalid users payload: ... or Invalid events payload: ... | A field breaks a rule; the message names it. For events, only the request itself (not an object, no events array, 0 or over 1,000 events); a bad event is rejected on its own |
| 401 | Unauthorized | Missing or unknown ingest token |
| 403 | Forbidden | The connection is disabled |
| 413 | Body exceeds 4 MB | Too large |
| 500 | Internal server error | Server failure |
SDK log messages
iOS writes to the unified log under subsystem com.herald.sdk (category Herald, and ui for HeraldUI). Android writes to Logcat with the tag Herald. The default level shows errors and warnings. See Logging and debugging.
Setup
| Message | Platform | Level | Meaning |
|---|---|---|---|
Herald.configure was called more than once; ignoring the later call | iOS | Warning | Only the first configuration applies |
Herald.configure called more than once; ignored | Android | Warning | Same |
Herald call dropped: more than 1000 calls are waiting (is Herald.configure called?) | iOS | Warning | 1,000 calls are waiting for configure; later ones are lost |
More than 1000 calls before Herald.configure; dropping later ones until it runs | Android | Warning | Same |
Could not create storage directory: ... | iOS | Error | The SDK cannot write its files; nothing persists |
SDK state file unreadable; starting fresh | Android | Error | The state file was corrupt; the device starts as new |
Calls rejected on the device
A call that breaks a rule is dropped and never queued. The message names the call and the problem.
| Message pattern | Platform | Level |
|---|---|---|
<call> ignored: <problem>, for example track ignored: name must not be empty | iOS | Error |
<call> ignored: <problem> | Android | Warning |
<what> contain an unsupported value (...); call ignored | Android | Warning |
setAttributes: $email is not a valid email; dropped that key | Both | Warning |
setAttributes: $phone must be E.164, for example +15551234567; dropped that key | Both | Warning |
setLocation: latitude must be -90...90 and longitude -180...180 | iOS | Error |
setLocation ignored: out of range | Android | Warning |
Problems include must not be empty, is longer than N characters, currency must be a 3-letter ISO 4217 code, quantity must be positive (iOS) or quantity must be at least 1 (Android), price must be finite (iOS) or price is not finite (Android), and contains a number that is not finite.
Delivery
| Message | Platform | Level | Meaning |
|---|---|---|---|
Herald rejected a batch of N event(s) with HTTP S; dropping it | iOS | Error | A 4xx other than 408 and 429; see the status table |
Herald rejected a batch (S): <body>. Dropping N events. | Android | Error | Same, with the server's message |
Batch send failed: ... / Batch will be retried in N s | iOS | Info | Network error or retryable status |
Batch send failed (...); will retry / Batch send got S; will retry | Android | Info | Same |
Sent N events | Android | Debug | A batch was accepted |
Herald rejected event <id>: <reason> (<detail>) | Both | Debug | Herald accepted the batch but left this event out; see Rejected events |
Dropping a <type> event larger than 32 KB | Both | Debug | The event was over the 32 KB limit; dropped before queueing and counted in dropped |
Event queue full: dropped N oldest event(s) | iOS | Warning | The 1,000-event queue overflowed; the count is reported to Herald |
Dropped N queued event(s) older than 30 days | Both | Debug | SDK 0.6.0 and later: queued events past maxQueuedEventAge were dropped before a batch was built and counted in dropped |
Dropping an event larger than 512 KB | iOS | Error | One event cannot fit in a batch |
Collection is turned off remotely | Both | Info | SDK 0.6.0 and later: the app's SDK settings turned off "Collect events"; the queue was cleared and nothing is recorded or sent until it is turned back on |
Config fetch failed (...); keeping the current config / Config fetch returned an unreadable body | Android | Info / Warning | The remote config fetch failed; the cached or built-in settings stay |
Could not cache the remote config: ... / Could not cache the remote config | iOS / Android | Error | Disk write failed; the fetched settings still apply until the app quits |
Skipping an event that cannot be encoded as JSON | iOS | Error | For example a NaN in properties |
Could not persist event: ... / Could not persist event queue | iOS / Android | Error | Disk write failed |
Messages
| Message | Platform | Level | Meaning |
|---|---|---|---|
Message sync failed with HTTP S / Message sync got S: <body> | iOS / Android | Warning | The fetch failed; cached messages stay |
Message sync failed: ... / Message sync failed (...); using cached messages | iOS / Android | Info | Network error |
Message sync needs a user token; waiting for setUserToken | Both | Debug | A signed-in fetch without a token got 401; setUserToken fetches again |
Message sync waits for setUserToken | Both | Debug | The connection requires a user token and none is set yet, so no fetch is sent |
Message sync failed with HTTP 401: Herald refused the user token / Message sync got 401: Herald refused the user token | iOS / Android | Warning | The token sent was wrong |
Messages unchanged | Both | Debug | 304 from the server |
Message sync returned an unreadable body | Android | Warning | The response could not be parsed |
Skipping malformed <type>: ... / Skipping malformed message at index N | iOS / Android | Warning | One card or message could not be read, for example an unknown type; the rest load |
In-app message X not shown (no presenter or no active scene); stays pending | iOS | Info | Set a presenter, or the app was not active |
In-app message X discarded by delegate | Android | Debug | Your delegate returned discard |
InAppMessageDelegate threw; displaying | Android | Error | Your delegate crashed; the message was shown |
InAppMessagePresenter threw / In-app display failed | Android | Error | Your presenter crashed; the message stays pending |
Unknown content card X | Android | Warning | A log call for a card the SDK no longer has |
debugLoadMessages: unreadable body | Both | Warning | The debug JSON is not a messages response |
Card impression <id> | iOS (ui) | Debug | The default feed logged an impression |
Push and UI (Android modules)
| Message | Module | Meaning |
|---|---|---|
Firebase is not initialized; push token not synced | herald-fcm | google-services.json is missing or the Google services plugin is not applied |
FCM token sync failed | herald-fcm | Firebase could not return a token |
Could not show Herald notification | herald-fcm | Building the notification failed |
Notification image failed (...) / Notification image too large to decode | herald-fcm | The push shows without its image |
Image load failed for <host> (...) / Image too large to decode from <host> | herald-ui | A card or message image did not load |
WebView unavailable; HTML message closed / HTML message renderer gone; message closed | herald-ui | The HTML message could not run |
openUrl failed | herald-core | No activity handles the URL |