How to refresh, store, and revoke Monei Connect access tokens
Access tokens expire after 1 hour. Refresh tokens let you get a new access token without the user going through the authorization flow again. This page covers the full token lifecycle.
Call the token endpoint with grant_type: refresh_token before the access token expires. The old token pair is invalidated immediately — store the new tokens right away.
POST /api/v1/connect/tokenContent-Type: application/json{ "grant_type": "refresh_token", "refresh_token": "mcr_raw_refresh_token_here"}
Revoke tokens when a user disconnects your app from their account on your platform. This immediately invalidates both the access token and its paired refresh token.
POST /api/v1/connect/token/revokeContent-Type: application/json{ "token": "mct_raw_access_token_here"}
async function disconnectMonei(userId) { const user = await db.users.findById(userId); await fetch('https://api.monei.cc/api/v1/connect/token/revoke', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ token: decrypt(user.moneiAccessToken) }), }); // Clear from your database regardless of revocation response await db.users.update(userId, { moneiAccessToken: null, moneiRefreshToken: null, moneiTokenExpiry: null, moneiScopes: [], });}
Users can also revoke access directly from their Monei settings at any time. When this happens, subsequent API calls with that token return 401. Your app must handle this and prompt the user to reconnect.
Security
Key storage, CSRF protection, and production checklist