You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

FusionAuth v1.13.2登录接口报[couldNotConvert]userId错误求助

Fixing the "Invalid userId on the URL" Error in FusionAuth Login

Let's break down what's happening here first—your error message spells out the core issue clearly:

"fieldErrors": { "userId": [ { "code": "[couldNotConvert]userId", "message": "Invalid userId on the URL [index]. This must be a valid UUID String (e.g. 25a872da-bb44-4af8-a43d-e7bcb5351ebc)." } ] }

The problem is that your request URL includes a segment (index) that FusionAuth is trying to interpret as a userId parameter, but you're actually attempting to log in using a loginId (email address). This mismatch between the endpoint you're hitting and the login method you're using is causing the validation failure.

Why This Happens

FusionAuth has two distinct login endpoints tailored to different authentication methods:

  • To log in with a userId, you use a URL with a UUID path parameter: POST /api/login/{userId} (replace {userId} with the user's valid UUID)
  • To log in with a loginId (like your test email test@test.nl), you need to send a POST request directly to /api/login—no extra path segments or trailing slashes allowed.

It seems your request is hitting a URL like http://localhost:9011/api/login/index (or even just /api/login/ with a trailing slash might trigger the server to parse an empty/invalid segment as userId). FusionAuth sees that final index part of the URL and tries to treat it as a userId, which obviously isn't a valid UUID format.

Step-by-Step Fix

  1. Update your request URL: Send your POST request to http://localhost:9011/api/login (no trailing slash, no extra path bits like index).
  2. Verify your request configuration:
    • Confirm you're using the POST HTTP method
    • Set the Content-Type header to application/json
    • Keep your request body exactly as you have it—since you're using loginId, you don't need to include a userId anywhere:
      { 
        "loginId":"test@test.nl", 
        "applicationId":"e2e45cc3-6710-4af9-b3c2-2d6f6cbbceed", 
        "password":"***********", 
        "ipAddress": "192.168.1.42" 
      }
      
  3. Quick sanity check: In the FusionAuth console, make sure your test user is actually linked to the application with ID e2e45cc3-6710-4af9-b3c2-2d6f6cbbceed—if the user isn't associated with the app, you might run into a different error after fixing the URL.

Note for FusionAuth v1.13.2

This endpoint behavior hasn't changed significantly in newer FusionAuth versions, so this fix applies directly to your v1.13.2 deployment. Just ensure your request aligns with the correct endpoint for your chosen login method.

内容的提问来源于stack exchange,提问作者Tjep Meindersma

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.06 08:37:52