Skip to main content

accounts

Creates, updates, deletes, gets or lists an accounts resource.

Overview​

Nameaccounts
TypeResource
Idovh.email_mxplan.accounts

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
idintegerAccount id
task_pending_idintegerPending tasks for this account (wire: taskPendingId)
display_namestringAccount display name (wire: displayName)
first_namestringAccount first name (wire: firstName)
last_namestringAccount last name (wire: lastName)
sam_account_namestringSAM account name (wire: SAMAccountName)
configuredbooleanIndicates if the account is configured
creation_datestring (date-time)Creation date (wire: creationDate)
current_usageintegerMailbox usage (wire: currentUsage)
delete_at_expirationbooleandelete at expiration (wire: deleteAtExpiration)
domainstringEmail domain
expiration_datestring (date-time)expiration date (wire: expirationDate)
expiration_outlook_datestring (date-time)expiration date (wire: expirationOutlookDate)
hidden_from_galbooleanHide account in Global Address List (wire: hiddenFromGAL)
initialstringAccount initials
last_logoff_datestring (date-time)Last logoff (wire: lastLogoffDate)
last_logon_datestring (date-time)Last logon (wire: lastLogonDate)
last_update_datestring (date-time)Last update (wire: lastUpdateDate)
loginstringAccount login
mailing_filterarrayEnable or disable anti-virus and anti-spam (wire: mailingFilter)
password_last_updatestring (date-time)Time of account's password last update (wire: passwordLastUpdate)
primary_email_addressstringDefault email for this mailbox (wire: primaryEmailAddress)
quotanumberAccount maximum size
renew_periodstringchange the renew period (monthly, yearly) (wire: renewPeriod)
spam_and_virus_configurationobjectSpam and Antivirus configuration (wire: spamAndVirusConfiguration)
spam_detectedbooleanAccount was sending spam (wire: spamDetected)
spam_ticket_numberintegerTicket number of spam detection (wire: spamTicketNumber)
statestringAccount state (creating, deleting, ok, reopening, suspended, suspending, unknown)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectemail, serviceGet an email account. Returns the login, names, domain, state, quota and usage of the email account, its renewal and expiration settings, and its spam and virus configuration.
listselectserviceid, primary_email_address, x_pagination_modeList email accounts. Returns the email addresses of the email accounts of the service. Filter them by primaryEmailAddress or id.
updateupdateemail, serviceUpdate an email account. Updates the login, names, domain, quota, renewal period, deletion at expiration, Global Address List visibility and spam and virus configuration of the email account.
deletedeleteemail, serviceDelete an email account. Deletes the email account of the MX Plan service and returns the task. Follow it under task/{id}.
change_passwordexecemail, service, passwordChange an email account password. Sets the new password of the email account and returns the task that applies it.

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
api_hoststringThe OVHcloud API host. Selected by OVH_ENDPOINT (ovh-eu, ovh-ca or ovh-us; default ovh-eu). (default: api.eu.ovhcloud.com, x-stackQL-envVarSelector: {"envVar":"OVH_ENDPOINT","default":"ovh-eu","values":{"ovh-eu":"api.eu.ovhcloud.com","ovh-ca":"api.ca.ovhcloud.com","ovh-us":"api.us.ovhcloud.com"}})
emailstringDefault email for this mailbox
servicestringThe internal name of your mxplan organization
idintegerFilter the value of id property (like)
primary_email_addressstringFilter the value of primaryEmailAddress property (like) (wire: primaryEmailAddress)
x_pagination_modestringSent as CachedObjectList-Pages by default so the list returns the full objects rather than their identifiers. (wire: X-Pagination-Mode)

SELECT examples​

Get an email account. Returns the login, names, domain, state, quota and usage of the email account, its renewal and expiration settings, and its spam and virus configuration.

SELECT
id,
task_pending_id,
display_name,
first_name,
last_name,
sam_account_name,
configured,
creation_date,
current_usage,
delete_at_expiration,
domain,
expiration_date,
expiration_outlook_date,
hidden_from_gal,
initial,
last_logoff_date,
last_logon_date,
last_update_date,
login,
mailing_filter,
password_last_update,
primary_email_address,
quota,
renew_period,
spam_and_virus_configuration,
spam_detected,
spam_ticket_number,
state
FROM ovh.email_mxplan.accounts
WHERE email = '{{ email }}' -- required
AND service = '{{ service }}' -- required
;

UPDATE examples​

Update an email account. Updates the login, names, domain, quota, renewal period, deletion at expiration, Global Address List visibility and spam and virus configuration of the email account.

UPDATE ovh.email_mxplan.accounts
SET
delete_at_expiration = {{ delete_at_expiration }},
display_name = '{{ display_name }}',
domain = '{{ domain }}',
first_name = '{{ first_name }}',
hidden_from_gal = {{ hidden_from_gal }},
initial = '{{ initial }}',
last_name = '{{ last_name }}',
login = '{{ login }}',
mailing_filter = '{{ mailing_filter }}',
quota = {{ quota }},
renew_period = '{{ renew_period }}',
spam_and_virus_configuration = '{{ spam_and_virus_configuration }}'
WHERE
email = '{{ email }}' --required
AND service = '{{ service }}' --required;

DELETE examples​

Delete an email account. Deletes the email account of the MX Plan service and returns the task. Follow it under task/{id}.

DELETE FROM ovh.email_mxplan.accounts
WHERE email = '{{ email }}' --required
AND service = '{{ service }}' --required
;

Lifecycle Methods​

EXEC variables use wire (API) names.

Change an email account password. Sets the new password of the email account and returns the task that applies it.

EXEC ovh.email_mxplan.accounts.change_password
@email='{{ email }}' --required,
@service='{{ service }}' --required
@@json=
'{
"password": "{{ password }}"
}'
;