Skip to main content

Wrong region

type: https://docs.onearly.com/errors/wrong-region
status: 421 Misdirected Request
code: WRONG_REGION

Every OnEarly account and group has a home region, where its data is kept. You call one global address, https://api.onearly.com, and OnEarly serves each request from the right home region.

Occasionally a request reaches a region that doesn't hold the data it needs, for example just after an account has moved. Instead of answering, that region refuses the request with 421 WRONG_REGION and tells you where to send it. Nothing was changed by the refused request.

The response​

The body uses the problem details format (RFC 9457) with Content-Type: application/problem+json:

{
"type": "https://docs.onearly.com/errors/wrong-region",
"title": "Your account is served from another region",
"status": 421,
"code": "WRONG_REGION",
"region": "<home region>",
"base_url": "<address of your home region>"
}
FieldDescription
typeThis page's address. Identifies the problem.
titleA short, human-readable summary.
statusAlways 421.
codeAlways WRONG_REGION. Match on this or on type.
regionThe home region that holds the data.
base_urlThe address to send the request to instead.
placement_epochIdentifies the placement the refusing region used. You don't need to interpret it; log it with the error.

region, base_url and placement_epoch appear when the refusing region knows them. The same values are sent as headers:

HeaderSame as
OE-Regionregion
OE-Region-Urlbase_url
OE-Placement-Epochplacement_epoch

How to retry​

Follow a 421 once.

Retrying a 421
Retrying a 421
  1. Read base_url from the body, or OE-Region-Url from the headers.
  2. Resend the request to that address, keeping the same method, path, query, body and idempotency key.
  3. If that works, carry on. If you use OAuth, refresh your access token so later requests carry your current home region.
  4. If the retry returns 421 again, stop. Don't keep following. Show or log an error that includes the response body.

If the response has no base_url and no OE-Region-Url, don't retry. Report the error.

Only follow base_url values that point at an onearly.com address. Send your credential nowhere else.

Keep calling the global address

Don't save base_url and send future requests there. Keep using https://api.onearly.com. Your home region can change, and the global address always knows where it is.

ResponseMeaningWhat to do
503 PLACEMENT_MOVINGYour account or group is being moved between regions.Wait for Retry-After, then retry the same address.
503 REGION_UNAVAILABLEThe region that holds the data is temporarily unavailable.Wait, then retry the same address.

The MCP server never answers 421.