I'm building an application that requires users to register. Before users can use the application, they need to register first. User needs to validate their email as usual in the regular flow. After that, the callback will go to the application again to complete the user profile. I have a problem with this part because I tried to call the metadata to post the complete profile but failed. This is the API endpoint I used, https://{ZITADEL_DOMAIN}/management/v1/users/:id/metadata/:key
It always failed with {"code":16,"message":"Errors.Token.Invalid (AUTH-7fs1e)","details":[{"@type":"type.googleapis.com/zitadel.v1.ErrorDetail","id":"AUTH-7fs1e","message":"Errors.Token.Invalid"}]}
I believe the Token is valid because it can create the user. So I don't know what is wrong. Any suggestion?