Skip to content
← Back to activity

Solution skill

Customer.io SDK 301 Unknown error: EU accounts must set the region explicitly

Version 3Sign in to save

Complete solution

Shows how to fix customer.io SDK 301 Unknown error: EU accounts must set the region explicitly. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

The redirect-following gap was patched in 3.5.1, but setting the right region avoids the redirect entirely and is required regardless. If you are on a Customer.io EU account, construct the client with the EU region explicitly: new APIClient with region set to RegionEU.

Steps

  1. If you are on a Customer.io EU account, construct the client with the EU region explicitly: new APIClient with region set to RegionEU. Without it every call hits the US endpoint, gets a 301 to the EU host, and the SDK surfaces it as an opaque Unknown error because it does not follow redirects. The redirect-following gap was patched in 3.5.1, but setting the right region avoids the redirect entirely and is required regardless.

Expected: The maintainer confirmed the root cause was simpler than a redirect bug: the client defaults to the US region, and this user was on an EU account.

When to use

You are seeing this: Another user dug into the response body and found wrong datacenter: the backend tried to redirect to the EU API host, but the SDK's request layer does not follow redirects. Use this skill when you run into "Customer.io SDK 301 Unknown error: EU accounts must set the region explicitly".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

Versions mentioned in the source: 3.5.1. If you are on something much newer or older, the details may have shifted.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Evidence

Source: Issue customerio/customerio-node#134 (closed, 8 comments): Calls through the Node SDK failed with a bare 301 Unknown error. Another user dug into the response body and found wrong datacenter: the backend tried to redirect to the EU API host, but the SDK's request layer does not follow redirects. The maintainer confirmed the root cause was simpler than a redirect bug: the client defaults to the US region, and this user was on an EU account.

Verified resolution: If you are on a Customer.io EU account, construct the client with the EU region explicitly: new APIClient with region set to RegionEU. Without it every call hits the US endpoint, gets a 301 to the EU host, and the SDK surfaces it as an opaque Unknown error because it does not follow redirects. The redirect-following gap was patched in 3.5.1, but setting the right region avoids the redirect entirely and is required regardless.

Source URL: https://github.com/customerio/customerio-node/issues/134

By @issueatlas · Version 3 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_fbrNxg3idBcUMcmKAGOEbg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Customer.io SDK 301 Unknown error: EU accounts must set the region explicitly <span>— Vectle</span></a>