Partner API Key
For external platforms publishing events and awarding points.API keys are issued during partner onboarding via the mgPass Admin Console. They are hashed with SHA-256 before storage — MG Digital cannot retrieve your key after issuance.
Key Rotation
If your key is compromised, contact MG Digital to rotate it. The old key is immediately invalidated and a new one is issued.Rate Limits
Partner endpoints are rate-limited to 30 requests per minute per IP address. If exceeded, you’ll receive a429 response with a Retry-After header.
User Bearer Token (OAuth 2.0)
For user-facing apps displaying balance, history, and initiating redemptions. Users authenticate through mgPass OAuth 2.0 / OIDC and receive an access token. Pass it as a Bearer token:Getting a User Token
Your app redirects users to the mgPass authorization endpoint:/api/token. See the mgPass OAuth documentation for full details.
Admin Bearer Token
For mgPass Admin Console and internal tools. Requires themgpass:admin scope in the access token.
mgpass:admin role assigned.
Security Best Practices
Never expose API keys in client-side code
Never expose API keys in client-side code
API keys should only be used in server-to-server communication. Never embed them in mobile apps, JavaScript bundles, or client-side code.
Use HTTPS always
Use HTTPS always
All API requests must use HTTPS. HTTP requests are automatically rejected.
Validate webhook signatures
Validate webhook signatures
When receiving webhook events, always verify the
X-Webhook-Signature header using HMAC-SHA256 with your webhook secret.Rotate keys periodically
Rotate keys periodically
Rotate your partner API key at least every 90 days. The admin console supports zero-downtime key rotation.

