Rate Limits & Errors

Hub rate limits, OCPI status codes, and common error handling.

Rate limits

The Hub enforces per-party rate limits on high-traffic modules:

ModuleLimit
Token authorization100 requests / minute
Commands50 requests / minute
Location list200 requests / minute

When exceeded, the Hub returns HTTP 429 with OCPI status_code: 2901 (Hub rate-limit code in the custom 29xx range).

Implement exponential backoff and respect Retry-After if provided.

OCPI status codes

All Hub responses use the standard OCPI envelope. Check status_code in every response:

CodeNameMeaning
1000SuccessRequest completed successfully
2000Generic client errorIncludes auth failures (HTTP 401); check status_message
2001Invalid parametersMissing/invalid query or body fields
2002Not enough informatione.g. authorize without required context
2003Unknown LocationLocation (or related resource) not found
2004Unknown TokenRealtime authorize for unknown token
2901Rate limit (Hub)Too many requests; back off and retry
3002Unsupported versionUnknown /ocpi/{version}
4001Hub unknown receiverOCPI-to peer unknown
4002Hub timeoutForwarded request timed out
4003Hub connectionCircuit open / unavailable

HTTP status codes

HTTPTypical cause
200OCPI success (status_code: 1000) or OCPI error in body
401Missing/invalid token or suspended party (status_code: 2000)
403Forbidden (e.g. command "Not routed")
404Endpoint or resource not found
429Rate limit (status_code: 2901)
502Partner unavailable / Hub forward failure
504Partner timeout on authorize

Parse HTTP and envelope together

Authorize Hub-side failures return HTTP 504/502 with OCPI 4002/4003 and usually data.allowed: UNKNOWN. Unknown token from the eMSP returns HTTP 404 with OCPI 2004. Always read HTTP status, status_code, payload fields, and status_message.

Lifecycle-specific Hub messages

ConditionHTTPOCPIPayload / status_messageHub retry?
Authorize not routed / unknown CPO2001000allowed: NOT_ALLOWEDNo
Authorize unknown token (eMSP)4042004no data / "Unknown Token"No
Authorize timeout5044002allowed: UNKNOWN, "CPO authorize timeout"No
Authorize unavailable / circuit5024003allowed: UNKNOWN + class messageNo
Authorize unknown OCPI-to peer4044001party not foundNo
Command not routed4032000"Not routed"No
Command unknown location / session4042003"Location not found"No
Command forward timeout5024002"CPO command forward timed out"No
Command circuit / unavailable5024003"CPO command forward unavailable"No
Callback → eMSP failed5022000"Failed to forward command callback to eMSP" (+ timeout variant)No
Async session/CDR forward failed——Not returned on CPO PUT/POSTTransient only

Sync vs async retry

Hub does not retry sync authorize/commands to the CPO. Hub does retry async pushes to eMSP receivers for timeout/unavailable only; permanent partner errors are not retried. See Session Lifecycle and Async Delivery.

Common integration errors

Error / symptomLikely causeResolution
2000 + HTTP 401 on all requestsInvalid or revoked tokenRe-check credentials; see Token Rotation
Empty location listNo routing rulesEnable routing
Authorize NOT_ALLOWED (expected routed pair)No routing rule or unknown CPOEnable routing; not the same as command "Not routed"
Authorize UNKNOWN + HTTP 504CPO authorize timeoutCheck CPO; eMSP may retry
Authorize UNKNOWN + HTTP 502CPO unavailable / circuit / incompleteConnection Health
Command "Not routed"No routing ruleEnable routing
Command "CPO command forward timed out" / "... unavailable"CPO down or slowFix CPO; eMSP may re-issue (Hub does not retry)
Command REJECTEDEVSE busy, invalid target, or CPO rejectionVerify location/EVSE IDs; resolve eligibility
Session not deliveredMissing cdr_tokenCPO must set eMSP identity on session
Async delivery failureeMSP receiver down or permanent errorFix receiver; pull backfill; support re-drive if needed
Invalid CountryCode & PartyId combination (HTTP 400) on eMSP receiverP2P-style path validationAccept CPO keys from HubClientInfo + routing; see Hub Receiver Identity (eMSP)

Role enforcement

The Hub enforces party roles on outbound calls partners make to the Hub:

ErrorMeaning
CPO-only endpoint called by eMSPWrong role for this operation
Party mismatch on Hub APIURL path {country_code}/{party_id} does not match your authenticated party when calling Hub

Inbound receiver validation is different

When Hub pushes to your eMSP receivers, path {country_code}/{party_id} identifies the owning CPO, not your authenticated party and not Hub (CIH). Do not apply the party-mismatch rule from outbound Hub calls to inbound async pushes. See Hub Receiver Identity (eMSP).

Logging for support

Include these in support requests:

  • X-Request-ID and X-Correlation-ID from request/response headers
  • Timestamp (UTC)
  • Endpoint and HTTP method
  • Request and response bodies (redact tokens)