451 and the error code REGION_RESTRICTED. The region status endpoint is public — no authentication is required — and answers from every region, so a frontend can show a region notice and hide trading up front instead of failing on the next write. The restriction applies to production only: on the testnet environments restricted is always false and no request is refused for its region.
Get Region Status
() => Promise<GetRegionStatusResponse>
Fetch the caller’s region status. No authentication required.Returns:
GetRegionStatusResponse:restricted: boolean —truewhen trading is not available in the caller’s region.country: string — the ISO 3166-1 alpha-2 country code the edge geolocated (T1for Tor,XXfor unknown); empty when the request carried no location.
Refused requests
A refused write gets this body:details.reason is edge_geo_block when the edge refused the request and app_geo_block when the API did. Branch on error, not on the reason. In the SDK the refusal is an APIError with statusCode 451 and retryable: false. A browser reads it too: the edge’s 451 carries the same CORS headers the API sends, and the region gate never refuses a preflight (OPTIONS), so a browser caller always gets statusCode 451 and this body rather than a network error. gRPC writes fail with PERMISSION_DENIED (see ComplianceService).
