/v2/auth/login returns 401 with valid VRM Portal credentials

Hi,

I can login successfully into the VRM web portal (https://vrm.victronenergy.com) with my VRM account email and password. But, the REST API login endpoint (/v2/auth/login) consistently rejects my credentials with the error “401 Invalid credentials”. Is the REST API access restricted to a specific type of account?

Thanks in advance for the help.

You need to generate a token from your portal.

Hi Nick,

Thank you for the quick reply. Do you mean that login with credentials using the REST Api (“/v2/auth/login”) is fully deprecated and no longer supported but only access tokens are available for authentication ?

Only familiar with tokens being needed, never tried user auth.

Authentication

Most endpoints require authentication, using a JWT token. This token should be placed in the x-authorization field in the HTTP header. There are two types of tokens.

  • Access token. Uses the Token <token_value> format. This is commonly used for third party applications using the VRM API. Can be created using /users/{idUser}/accesstokens/create.
  • Deprecated from 1st of June 2026 onwards: Bearer token. Uses the Bearer <token_value> format.

:warning: Please migrate to access tokens if you are still doing requests with Bearer tokens.

I saw this warning in the openAPI specs but it wasn’t clear to me what was Victron plan for user authentication endpoint, it was marked as deprecated already but it seems it has been removed entirely from the openAPI specs (same for /auth/loginAsDemo). It seems that the API access tokens are the only way to go now.

Thank again for taking time to answer my question

You’re welcome. At least an easy change to implement.