New-UDEndpointInitialization. See the section below on Working with Variables, Functions and Modules for more information.
New-UDMonitor, have a matching output cmdlet you should use, like
Out-UDMonitorData, to return data from you endpoint.
Endpointparameter's script block is called whenever a user visits the website or the UDMonitor refreshes its data. Keep this in mind when defining script block functionality because long running endpoints can cause slow responses within your web site.
EndpointInitializationparameter. You can use
New-UDEndpointInitializationto create a new initial session state for the runspaces created within UD. This is a good place to define any modules, functions or variables you'd like defined globally.