Docs

Errors

How the current agrirouter API returns errors, plus reference for legacy error codes

agrirouter has two API surfaces with very different error conventions. The current API returns plain human-readable JSON messages. The legacy API returns numeric codes inside a protobuf envelope. This page covers both.

Do not surface agrirouter error messages one-to-one to end users. Wrap them with application-specific context so the guidance is meaningful in your UI.

Every error response on the current API has the same shape:

{
  "message": "A human-readable description of the error."
}

There is no numeric code field on the wire. Branch on the HTTP status code; the message string carries the human-readable detail. Values like message IDs or endpoint IDs are already substituted into the text, so you can log it directly or wrap it in your own UI copy.

HTTP status codes

The current API uses the following status codes across its endpoints. Individual endpoint pages list which statuses apply to that endpoint.

StatusMeaning
200The request succeeded.
204The request succeeded and there is no response body (typical for DELETE /endpoints/{externalId}).
400The request is invalid (malformed headers, missing required fields, unsupported message type), or, for POST /messages, no route exists from the sender to a specified direct recipient.
401The access token is missing, expired, or otherwise not valid.
403The endpoint ID in the request header does not belong to a tenant that the caller's access token is authorized for.
404The requested endpoint, message, or resource does not exist.
413The payload exceeds the 256 MB size limit.
429The application has exceeded its per-application request rate. Back off and retry. See Rate limits.
5xxAn internal error in agrirouter. Retry with exponential backoff.

Check the agrirouter status page at agrirouter.statuspage.io for ongoing incidents or maintenance windows before investigating 5xx responses in your own integration.

Rate limits

Request limits are enforced per application across all its endpoints. When the limit is exceeded, the gateway responds with HTTP 429 and a plain { "message": "rate limit exceeded" } body. The response does not include a Retry-After header, so client code should fall back to its own exponential backoff.

Concrete limits vary by environment and application tier and may change over time. For the current limit for your application, write to support@agrirouter.com.

Relationship to the legacy codes

Internally, agrirouter still runs the same validation logic that produces the legacy VAL_000XXX and SYS_000XXX codes listed below. On the current API, the numeric code is stripped before the response goes out, and only the human-readable message reaches the wire. That means:

  • You cannot distinguish VAL_000004 ("all routes failed") from VAL_000005 ("some routes failed") from the status line alone. Both surface as HTTP 400 with a plain { "message": "..." } body.
  • Your code should rely on the HTTP status and, where disambiguation matters, on pattern-matching the message string. It should not attempt to parse numeric codes out of the JSON body.

Legacy API error codes

The numeric codes in the tables below are returned only by the Legacy API in its protobuf response envelope. The current API strips these codes and returns only the { "message": "..." } body described above. They are kept here as a reference for partners maintaining legacy integrations.

Message placeholders

Legacy error messages may contain the following placeholders, which agrirouter replaces with actual values at runtime:

PlaceholderDescription
%messageId%The internal agrirouter message ID
%applicationMessageId%The message ID assigned by your application
%technicalMessageType%The technical message type of the message
%endpoints%The affected endpoint IDs
%chunkContextId%The chunk context ID for chunked messages
%chunkNumber%The current chunk number
%chunkTotal%The total number of chunks

Error categories

Troubleshooting legacy responses

  • SYS errors: server-side. Retry with exponential backoff. If they persist, check the status page.
  • VAL_000001–VAL_000003: double-check your message encoding and header fields.
  • VAL_000004 and VAL_000005: review your route configuration in the agrirouter UI. On the current API, both complete and partial routing failures surface as HTTP 400 with a plain message body, so the numeric distinction is only visible on the legacy wire.
  • VAL_000201–VAL_000209: check your legacy onboarding flow. TANs must be fresh and application IDs correct.
  • VAL_000303: typically means you are trying to use a VCU capability on an endpoint that is not a telemetry platform endpoint.

Next steps

On this page