cPanel module
UserData
2 functions, invoked through the cpanel_uapi tool.
scope cpanel:uapi
Call any function with
cpanel_uapi(service_id, module="UserData", function, params). Live availability depends on the cPanel features JetHost has enabled on your account — call list_cpanel_operations to see what is active.get_scoped_userdata GET#
Return scoped userdata mapping
This function returns all userdata key/value pairs for a given scope.
scopestringRequired
The scope name whose userdata you wish to retrieve.
Response — normalized as { ok, data, errors[], warnings[] }; data contains:
The requested scoped userdata mapping.
set_scoped_userdata GET#
Set scoped userdata key/value
This function sets (creates or updates) a userdata key/value pair within a specified scope and returns the full updated mapping for that scope.
scopestringRequired
The scope name to modify.
jsonstringOptional
A json string to save to the specified scope. Note: The "json" argument cannot be used with the "key" or "value" arguments.
keystringOptional
The userdata key to set. Note: The "json" argument cannot be used with the "key" or "value" arguments.
valuestringOptional
The value to assign to the key. Note: The "json" argument cannot be used with the "key" or "value" arguments.
Response — normalized as { ok, data, errors[], warnings[] }; data contains:
The updated scoped userdata mapping after the key/value was set.