Customer.io SDK 301 Unknown error: EU accounts must set the region explicitly
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
- 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.