# Why is my API call getting a 401?

Check the exact operation's authentication and required scope. A missing, malformed, expired, revoked or insufficiently scoped credential can be refused without revealing which check failed. A 401 alone does not prove the token is simply mistyped.

Send the actual credential through the documented Authorization header, never a URL. Confirm you copied the credential rather than the Client ID or an example value.

An MCP connection also needs a host that can send the supported credential header. Tool discovery and execution permissions are separate. See [Connect an AI Agent](https://docs.closemagnet.com/connect-an-agent) and the operation-specific [API Reference](https://docs.closemagnet.com/api-reference).

Read online: https://docs.closemagnet.com/articles/questions/why-is-my-api-call-getting-401
