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 status_code: 2004 (rate limit exceeded).

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 errorClient or server error — check status_message
2002UnauthorizedInvalid token or suspended party
2003Not foundResource does not exist
2004Rate limitToo many requests — back off and retry

HTTP status codes

HTTPTypical cause
200OCPI success (status_code: 1000) or OCPI error in body
401Missing/invalid token or suspended party
404Endpoint or resource not found
429Rate limit (may also appear as 200 with status_code: 2004)

OCPI errors are often returned with HTTP 200 and a non-1000 status_code in the JSON body. Always parse the envelope, not just the HTTP status.

Common integration errors

Error / symptomLikely causeResolution
2002 on all requestsInvalid or revoked tokenRe-check credentials; see Token Rotation
Empty location listNo routing rulesContact account team to enable routing
Authorization UNKNOWNCPO unreachableCheck CPO connection health
Command REJECTEDEVSE busy or invalid targetVerify location/EVSE IDs
Session not deliveredMissing cdr_tokenCPO must set eMSP identity on session
Async delivery failureeMSP receiver downFix receiver; contact support for re-drive

Role enforcement

The Hub enforces party roles on endpoints:

ErrorMeaning
CPO-only endpoint called by eMSPWrong role for this operation
Party mismatchURL path {country_code}/{party_id} does not match authenticated party

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)

Related docs