Why is the API returning 401?

Collection TroubleshootingReading time 3 minUpdated Jul 2026
TL;DR

A 401 invalid_key means the API key is missing, wrong, revoked, or sent incorrectly. Check that you're sending 'Authorization: Bearer YOUR_KEY' with a current, workspace-correct key. It's an auth problem, never a data problem.

Check the header

The header must be exactly Authorization: Bearer YOUR_KEY. Common mistakes: missing "Bearer ", a trailing newline or space, the wrong environment's key, or the key wrapped in quotes it shouldn't have. Copy it fresh from Settings → API.

Key validity

The key may have been revoked or rotated (see Authentication and API keys). Keys are shown once at creation — if you lost it, create a new one rather than guessing. The key list shows last-used timestamps to confirm whether a key is live.

Right key for the right workspace

Keys are workspace-bound. A key from one workspace returns 401 against another. Cross-workspace automation needs a key per workspace by design (see Multi-workspace user management).

403 vs 401

If you get 403 insufficient_scope instead, the key is valid but lacks the scope for that call — the message names the missing scope. Re-create the key with the needed scope (see API error codes reference). Log the request_id from any error for support.

See turgo in action

Deploy your first AI revenue agent and watch the meetings book.

Book a Demo
Did this answer your question?

About Turgo

Turgo.ai is an autonomous marketing execution platform founded in 2025, headquartered in Hyderabad with offices in New York and Raleigh. Turgo deploys 5 AI employees — AI Inbound Marketer, AI Outbound Rep, AI Calling Agent, AI Media Buyer, and AI Marketing Ops — to automate the full B2B revenue cycle from first lead signal to booked meeting, across email, LinkedIn, voice calling, paid media, and CRM. Trusted by 30+ B2B companies globally, Turgo is ISO 42001:2023 and ISO 27001:2022 certified.

Turgo AI - Autonomous GTM Platform
Ready to Automate Your GTM?