Errors
What each error means and what to do about it. Every error comes with an HTTP status, a stable code your code can act on and a message for people.
On this page
How errors look
Errors answer with an HTTP status and one JSON envelope, for key, quota and product errors alike. reason is stable: your program can act on it. message is for people: it says exactly what happened and how to fix it, and may be reworded. details holds Google’s ErrorInfo (the reason, and in metadata the facts behind it and the docs link) and a Help link to the reason’s entry on this page.
{
"error": {
"code": 400,
"status": "INVALID_ARGUMENT",
"reason": "TOO_MANY_INTERMEDIATES",
"message": "A route has up to 25 intermediates.",
"details": [
{ "@type": "type.googleapis.com/google.rpc.ErrorInfo", "reason": "TOO_MANY_INTERMEDIATES", "domain": "nways.ng",
"metadata": { "docs": "https://nways.ng/developers/errors#api-reasons" } },
{ "@type": "type.googleapis.com/google.rpc.Help",
"links": [{ "description": "TOO_MANY_INTERMEDIATES: what it means and how to fix it", "url": "https://nways.ng/developers/errors#api-reasons" }] }
]
}
}Every answer also has an X-Request-Id header: send it with any question to support. Act on the status and the reason, never on the message’s words.
The earlier addresses (/v1/…) answer product errors in an older shape, { "error": "message", "code": "no_route" }, and key and platform errors in the envelope above. The SDKs and client libraries read both.
HTTP statuses
| Status | Meaning | What to do |
|---|---|---|
| 200 | Done. | |
| 202 | Being prepared: an offline pack being built. | Ask again after Retry-After seconds. |
| 400 | A parameter or field is missing or wrong. | Fix the request. Don’t retry it unchanged. |
| 401 | No key, a key N-Ways never issued, or a key that was deleted or regenerated. | The reason and message say which. Send the key shown in the console. |
| 402 | The free monthly calls are used up and there’s no credit left (BILLING_DISABLED). | Add credit in the console, then retry. |
| 403 | The key isn’t allowed to do this: its organisation, project or the key itself is switched off, or the call is outside its restrictions. | See the reason, below. |
| 404 | Not found: an unknown postcode, place or address. | Not worth retrying. |
| 422 | Understood, but impossible: no route between the points. | Change the request, or tell the person. |
| 429 | Too many requests, or a quota is used up. | Wait as long as Retry-After says, then retry. |
| 503 | The platform is switched off for now (PLATFORM_DISABLED: your key is fine), or a problem on our side. | Wait as long as Retry-After says, or retry with backoff. |
| 500, 502 | A problem on our side. | Retry with backoff: after 1, 2, 4, 8 seconds, then give up. |
Key, platform, quota and billing errors
When a call is refused, the answer says exactly why and how to fix it. N-Ways checks, in this order: the platform (switched on), the key (given, issued and not revoked), its organisation and project (not closed or suspended), the key’s own state (not paused), its restrictions (the API, then the website, app or IP address), its limits and quotas, then credit. The first that fails is the answer.
{
"error": {
"code": 403,
"status": "PERMISSION_DENIED",
"reason": "API_KEY_PAUSED",
"message": "The API key nw_8fK2q… (“Checkout”) is paused, so its calls are refused. Resume it in the console (https://map.nways.ng/console, Keys → the key → Resume); it works again within 30 seconds.",
"details": [
{
"@type": "type.googleapis.com/google.rpc.ErrorInfo",
"reason": "API_KEY_PAUSED",
"domain": "nways.ng",
"metadata": { "docs": "https://nways.ng/developers/errors#api-key-paused", "keyPrefix": "nw_8fK2q" }
},
{
"@type": "type.googleapis.com/google.rpc.Help",
"links": [{ "description": "API_KEY_PAUSED: what it means and how to fix it", "url": "https://nways.ng/developers/errors#api-key-paused" }]
}
]
}
}metadata always has docs, and the facts your code may need: what was seen and what is allowed (restrictions and APIs), which cap was hit with its limit and resetsAt (429s), until and suspendReason (suspensions), why and revokedAt (revoked keys), keyValid (the platform switched off). Every refusal also carries X-Request-Id.
| Status | Reason | Meaning and fix |
|---|---|---|
| 503 | PLATFORM_DISABLED | The N-Ways Maps Platform is switched off for now, for everyone. Your key is fine (keyValid says whether N-Ways knows it): calls work again when the platform is back. Wait Retry-After seconds and retry; see the status page. |
| 401 | API_KEY_MISSING | The request has no key. Add key= or the X-NWays-Api-Key header. |
| 401 | API_KEY_INVALID | N-Ways never issued this key: a typo, a key cut short or with extra characters (a key is nw_ and 32 letters and digits). Copy the whole key from the console. |
| 401 | API_KEY_REVOKED | The key was deleted, or this is the old value of a regenerated key whose grace period has ended. The message says which and when. Create a new key, or use the key’s new value from the console. |
| 403 | PLATFORM_PREVIEW_ONLY | N-Ways has limited the platform to the organisations it has invited, and yours isn’t one of them. Your key is fine; to be invited, email hello@nways.ng. |
| 403 | ORGANISATION_CLOSED | Your organisation was closed (by its owner, or by N-Ways), so none of its keys work. Create a new organisation in the console, or email hello@nways.ng to reopen it. |
| 403 | ORGANISATION_SUSPENDED | N-Ways suspended your organisation, so all its keys are refused. The message says until when (Lagos time), if there is an end, and the reason N-Ways gave, if it chose to share it. Calls work again on their own at that time; otherwise email hello@nways.ng. |
| 403 | API_ACCESS_OFF | Your organisation runs its deliveries on N-Ways (the console and N-Ways Business) without the API, so its keys are off. To use the API too, add it in the console, Billing: your API calls are then paid as you use them, alongside your monthly plan. |
| 403 | API_TURNED_OFF | N-Ways turned your organisation’s API keys off; your access and plan are unchanged, and the console and N-Ways Business keep working. The message gives the reason N-Ways recorded. Email hello@nways.ng to have them turned back on. |
| 403 | PROJECT_SUSPENDED | N-Ways suspended this key’s project; the organisation’s other projects keep working. The message names the project and gives the reason. Email hello@nways.ng to restore it. |
| 403 | API_KEY_PAUSED | The key is paused in the console. Resume it there (Keys → the key → Resume); it works again within 30 seconds. (Before 16 October 2026 this was API_KEY_DISABLED.) |
| 403 | API_KEY_SERVICE_BLOCKED | The key may not call this API: the message names the API and what the key, its project or your plan allows (service, allowed). Add the API to the key’s APIs or the project’s in the console. If your plan doesn’t include it, email us to add it. |
| 403 | API_KEY_HTTP_REFERRER_BLOCKED | The web page isn’t in the key’s website restrictions, or the request named no page. The message shows the website seen and the ones allowed. Add its address, or if it isn’t yours, someone copied your key. |
| 403 | API_KEY_IP_ADDRESS_BLOCKED | The server’s address isn’t in the key’s IP restrictions. The message shows the address seen and the ones allowed. Add your public (NAT) address. |
| 403 | API_KEY_ANDROID_APP_BLOCKED | The Android app’s package or certificate isn’t allowed, or wasn’t sent. The message shows what was seen and what is allowed. Add both your upload and Play signing SHA-1. |
| 403 | API_KEY_IOS_APP_BLOCKED | The iOS app’s bundle ID isn’t allowed, or wasn’t sent. The message shows what was seen and what is allowed. |
| 429 | RATE_LIMIT_EXCEEDED | Too many requests this minute: the key’s cap for this API, or your organisation’s (all its keys together). The message and cap say which; it resets at the end of the minute: wait Retry-After seconds. |
| 429 | QUOTA_EXCEEDED | A daily cap is used up: the key’s for this API, or your organisation’s. The message and cap say which, and when it resets (midnight in Lagos, UTC+1; resetsAt, Retry-After). Raise the key’s cap in the console, or wait. |
| 402 | BILLING_DISABLED | Add credit: this API’s free calls for the month are used up and there’s no prepaid credit left. Other APIs keep working within their free calls. Add credit in the console (Billing → Add credit) and calls work again at once. |
| 429 | TEMPORARILY_BLOCKED | Too many refused requests from one connection (a wrong or blocked key sent over and over). Fix the key, then wait Retry-After seconds. |
| 503 | BACKEND_ERROR | Keys couldn’t be checked just then (a problem on our side). Retry with backoff. |
Since 16 October 2026, PARTNER_SUSPENDED is ORGANISATION_SUSPENDED, an organisation disabled by N-Ways is ORGANISATION_SUSPENDED rather than PROJECT_SUSPENDED, and deleted or regenerated keys are API_KEY_REVOKED rather than API_KEY_INVALID.
Refusals and preflights always carry CORS headers for the calling page, on /maps/v1 and on the earlier addresses (/v1, /tiles, /fonts) alike, so your code (and the Maps SDK’s note over the map) can read the reason, even while the platform is switched off.
In a web page, a refused map shows the Maps SDK’s note over the map: N-Ways’ message, with “What to do” linking the reason here. The browser’s developer console has the same, with the HTTP status.
Each API’s reasons
Each operation in the API reference lists its own reasons. The ones you’ll meet most:
| Reason | Status | API | Meaning |
|---|---|---|---|
QUERY_REQUIRED, QUERY_TOO_LONG | 400 | Geocoding, autocomplete | q is missing or over 200 characters. |
POSTCODE_INVALID | 400 | Geocoding, routes | Not a NIPOST postcode. |
POSTCODE_NOT_FOUND_CHECK | 404 | Geocoding | A well-formed postcode N-Ways can’t place: check it with the customer. |
GHANAPOST_INVALID, GHANAPOST_UNKNOWN | 400, 404 | Geocoding | Not a GhanaPost GPS address; or one N-Ways can’t place. |
FIELDS_REQUIRED, FIELDS_INVALID | 400 | Places | Place details need fields; or a field name is unknown. |
SESSION_INVALID | 400 | Autocomplete | The session token isn’t 8 to 64 letters, digits, - or _. |
TOO_MANY_INTERMEDIATES | 400 | Routes | More than 25 stops on the way. |
NO_ROUTE, NO_ROAD_ROUTE | 422 | Routes | No route: a point is too far from a road, or across water for a car or okada. |
OKADA_BANNED_…, MOTORBIKE_BANNED_…, KEKE_BANNED_…, DANFO_BANNED_…, each ending _ORIGIN, _DESTINATION, _STOP or _ROUTE | 422 | Routes | The law keeps that vehicle off the trip: the start, the end, a stop on the way, or every way between them is in a ban area. The message names the ban. |
ROUTE_TOO_FAR | 422 | Routes | The places are too far apart for one route of this kind. |
MATRIX_TOO_LARGE, MATRIX_TOO_FAR | 400 | Route matrix | Over 50 origins or destinations or 625 pairs; or points too far apart. |
STOPS_INVALID, VEHICLES_INVALID | 400 | Route optimisation | 1 to 50 stops and 1 to 5 vehicles. |
ROUTING_UNAVAILABLE | 503 | Routes | The routing engine is busy or restarting. Retry. |
INVALID_JSON | 400 | Any | The request body isn’t valid JSON for this endpoint. The message says where. |
BODY_TOO_LARGE | 413 | Any | The request body is over the endpoint’s size limit. |
NOT_FOUND | 404 | Any | No such endpoint: check the address and method. |
INTERNAL | 500 | Any | Something failed on our side. Retry with backoff; if it persists, send us the X-Request-Id. |
TASK_NOT_FOUND, TASK_ENDED | 404, 409 | Fleet | No such delivery; or it has ended. |
DELIVERIES_OFF | 403 | Fleet | N-Ways turned new deliveries off for your organisation (the message says why). Deliveries under way carry on. |
CONTRACTORS_OFF | 403 | Fleet | Sending deliveries to N-Ways drivers, inviting or hiring them, is turned off for your organisation. Your own riders can still take deliveries. |
SMART_PRICE_OFF | 403 | Fleet | Pay suggestions and Smart Price are turned off for your organisation: send payMax yourself, without smartPrice. |
WEBHOOKS_OFF | 403 | Fleet | Webhooks are turned off for your organisation: nothing is sent, and adding or testing an endpoint is refused. Events are still kept for the export. |
ERP_OFF | 403 | Fleet | The ERP sync (the events export) is turned off for your organisation. |
ORGANISATION_SUSPENDED | 403 | Fleet | N-Ways suspended your organisation: new deliveries are refused as its keys are. Deliveries under way carry on. |
Retrying well
- Retry 429 and 5xx only, with growing waits and a little randomness, so many clients don’t retry at once.
- Never retry a 4xx other than 429 unchanged: it will fail the same way.
- Set a timeout: 10 seconds for geocoding and places, 20 for routes.
- Cache what you may (see what you may store), so a short outage doesn’t stop your riders.