Management API Post-authentication-methods Endpoint Returns 404 Error "The user identity does not exist"

Overview

A 404 error occurs when attempting to use the Management API v2 post-authentication-methods endpoint. The error message displayed is:

 

The user identity does not exist

 

The request also returns the following response body:

{
"statusCode": 404,
"error": "Not Found",
"message": "The user identity does not exist",
"errorCode": "inexistent_user"
}

Applies To

  • Management API v2
  • POST /api/v2/users/<user_id>/authentication-methods
  • Adding a passkey to a user

Cause

The issue is caused by the value set in the identity_user_id field in the body of the request. Each Auth0 user profile contains two types of identifiers: the public user_id, which is prefixed with auth0| (e.g., auth0|12345...), and an internal identity ID, which is stored in the user’s profile within the identities array.

The passkey endpoint requires the internal identity ID. When the request includes the full auth0|-prefixed user_id instead of the internal ID, the system cannot match the identifier to a user identity, resulting in the error.

Solution

To resolve the error, the internal identity ID must be used for the identity_user_id field in the request.

  1. Open the Auth0 dashboard and navigate to the user profile.
  2. Locate the Raw JSON tab of the user profile.
  3. Find the user_id field within the identities array. This value is the internal identity ID.
  4. Use this value, which is often the same as the public user_id without the auth0| prefix, for the identity_user_id in the API call.

Recommended content

No recommended content found...