@radhika BR success and failure messages are configured in the Message Master. And dynamic paths cannot be added in the Message Master.
If you want to display dynamic message which comes as API response you may refer the below link
Also, to change the default authentication message you may refer the below link