API - Planyo Web Services - add_site_moderator

You are here: Planyo » Help » API » add_site_moderator

add_site_moderator

Description:

Use this function to add a new moderator to a site. You cannot make into a moderator a user who is a moderator or resource admin of another unrelated Planyo site.
If the user has been added by an admin / API call or is already a moderator or resource admin of the site, they will be automatically assigned as moderator. Otherwise, a confirmation email will be sent to the user's email address and the user will be assigned as moderator once they confirm the action. Check the status output field to find out if the assignment was immediate. Note that the user should have a login and password associated with their Planyo account.

Input:

user_id int required
ID of the user to be added as moderator. The user needs to have a valid email address associated with their account.
is_main_moderator bool required
Set to true if the moderator should become the main moderator for the site. Main moderator can receive separate notifications for any event.
site_id int optional
Planyo site ID for the new moderator. This parameter is only required if using an API key for a meta site.
method string required
must be set to add_site_moderator
language string optional
by specifying a 2-letter (ISO 639-1) language code (all capital letters e.g. EN, DE, FR, ES, IT) you can change the language of the text values returned
api_key string required
your API key - Click here to get your key. If your API key uses a hash key, you must also include the parameters hash_key and hash_timestamp.

Output:

status string
If the moderator assignment was successful, this will be one of: ok meaning that the moderator role was assigned immediately, or pending if an email confirmation must be done

API playground:

Click here to test this function in the API playground.