According to ISO 9241-210, User Experience, or UX, is “a person’s perceptions and responses that result from the use or anticipated use of a product, system or service”. Additionally, Wikipedia has a broader definition, covering many aspects of the way users interact with a system:
[UX] involves a person’s emotions about using a particular product, system or service. User experience highlights the experiential, affective, meaningful and valuable aspects of human-computer interaction and product ownership. Additionally, it includes a person’s perceptions of the practical aspects such as utility, ease of use and efficiency of the system. — bolds added by me
So, if APIs are, by definition, Application Programming Interfaces, API User Experience can be defined as follows: