NetConf new user creation fails

Hi All,
When I tried to create a new netconf user via some management agent like CLI, user is not getting created and maapi_set_elem2 get fails.
Can you please help on this issue, is any permission need to be included?
I would like to know the reason for maapi failure.

if (maapi_set_elem2(socket,handle, Username, "/aaa:aaa/authentication/users/user{%s}/name", Username) != CONFD_OK)
       LOG("Failed to set new user %s", Username));


To create a new list entry you can use:
int maapi_create(int sock, int thandle, const char *fmt, ...);

maapi_create(socket, handle, "/aaa:aaa/authentication/users/user{%s}", Username);