Understanding Maya API Authentication (Basic Auth Explained)
Authentication is one of the most common sources of integration errors. This guide breaks it down clearly.![]()
How Authentication Works
Maya APIs use Basic Authentication, where:
-
Your API key is encoded in Base64
-
Sent via the Authorization header
Example:
Authorization: Basic <Base64EncodedKey>
Types of Keys
-
Public Key
-
Used in frontend or client-side
-
Safe for limited exposure
-
-
Secret Key
-
Used in backend only
-
Must be securely stored
-
Common Mistakes
-
Using the wrong key (public vs secret)
-
Incorrect Base64 encoding
-
Including extra spaces or invalid headers
Best Practices
-
Store keys in environment variables
-
Never commit keys to source control
-
Rotate keys periodically
-
Use a secrets manager or vault
Reusable Insight
Most authentication errors come down to:
Wrong key + incorrect encoding + environment mismatch
Reference
https://developers.maya.ph/reference/basic-authentication
Discussion Prompt: Have you encountered authentication errors? Drop the error message and we’ll help debug.![]()