Dear All,
Admin user works because that user has 'SA' privs on profile hence no permission checks are done.To attach a category the user who is being used in the session of lapi should have 'S,SC' on the category object.Mostly in your code you must be doing a 'FetchVersion' of the category object.Trap the error here and see if lapi is giving you "insufficient permissions".Usually most people store categories in the categories volume where OT themselves has put S,SC for Public Access.If your lapi session user does not have perms to the category object as defined explicitly on its ACL then the lapi code will try to use Public Access.Problems with setting up a user without Public Access in a user's profile can lead to further complications as well.One thing is puzzling you say thru the GUI it works,are you sure it is the same user as the user in lapi.If this is as you say then one would want to look closely using builder or logs as I have not encountered this error(S,SC on category object) but fails to add cats thru lapi.Also post your code in case we want to try it out.