HTTP 401 · Unauthorized
HTTP 401 Authentication

When & why it happens

Two clients used the same auth key concurrently. Both sessions are terminated; sign in again from this client.

Handling in gogram

Surfaced as *gogram.ErrResponseCode. Match on the message:

if err, ok := err.(*gogram.ErrResponseCode); ok { if err.Message == "AUTH_KEY_DUPLICATED" { // handle this error } }