Understanding Maya API Authentication (Basic Auth Explained)

Understanding Maya API Authentication (Basic Auth Explained)

Authentication is one of the most common sources of integration errors. This guide breaks it down clearly.:backhand_index_pointing_down:


:locked_with_key: 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>


:key: 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


:warning: Common Mistakes

  • Using the wrong key (public vs secret)

  • Incorrect Base64 encoding

  • Including extra spaces or invalid headers


:shield: Best Practices

  • Store keys in environment variables

  • Never commit keys to source control

  • Rotate keys periodically

  • Use a secrets manager or vault


:brain: Reusable Insight

Most authentication errors come down to:

Wrong key + incorrect encoding + environment mismatch


:books: Reference

https://developers.maya.ph/reference/basic-authentication


:speech_balloon: Discussion Prompt: Have you encountered authentication errors? Drop the error message and we’ll help debug.:backhand_index_pointing_down:

1 Like