Help Centre / Troubleshooting / API returns 401 Unauthorized

API returns 401 Unauthorized

Updated just now · 6 views ·

A 401 from the API means the request either didn't include a valid token, or the token isn't recognised. Four common causes:

1. Missing header

Every authenticated request needs Authorization: Bearer vs_xxx. Check your client actually sends it (curl -v is your friend).

2. Wrong prefix

The token must start with vs_. If you're passing something else (a raw key ID, a JWT header, etc.) you'll get 401.

3. Revoked token

Check Account Settings > API Keys. If the key you're using shows as revoked (or missing entirely), generate a new one.

4. Wrong environment

If you have keys for staging and production, make sure the one you're using matches the environment you're calling. Production keys don't work on staging and vice versa.

Was this article helpful?

0 found this helpful