Skip to main content

accounts

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

Overview​

Nameaccounts
TypeResource
Idovh.email_domain.accounts

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
account_namestringName of account (wire: accountName)
descriptionstringAccount description
domainstringName of domain
emailstringEmail
is_blockedbooleanIf true your account is blocked (wire: isBlocked)
sizeintegerSize of your account in bytes

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectaccount_name, domainGet an email account. Returns the email address, description, size in bytes and blocked state of the email account.
listselectdomainaccount_name, description, x_pagination_modeList email accounts. Returns the names of the email accounts of the domain. Filter them by accountName or description.
createinsertdomain, account_name, passwordCreate an email account. Creates an email account with a name, a password, and optionally a description and a size in bytes, and returns the task. The size is 5 GB by default; the allowed sizes are in allowedAccountSize of the email domain. The password needs 8 to 30 characters and no accents.
updateupdateaccount_name, domainUpdate an email account. Updates the description or the size in bytes of the email account. The allowed sizes are in allowedAccountSize of the email domain.
deletedeleteaccount_name, domainDelete an email account. Deletes the email account of the domain and returns the task. Follow it under task/account/{id}.
change_passwordexecaccountName, domain, passwordChange an email account password. Sets a new password and returns the task. The password needs 8 to 30 characters and no accents.
update_usageexecaccountName, domainRefresh email account usage. Asks for the figures returned by usage to be recomputed; they are updated asynchronously.

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
accountNamestringName of account
account_namestringName of account (wire: accountName)
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"}})
domainstringName of your domain name
account_namestringAccount name (wire: accountName)
descriptionstringAccount description
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 email address, description, size in bytes and blocked state of the email account.

SELECT
account_name,
description,
domain,
email,
is_blocked,
size
FROM ovh.email_domain.accounts
WHERE account_name = '{{ account_name }}' -- required
AND domain = '{{ domain }}' -- required
;

INSERT examples​

Create an email account. Creates an email account with a name, a password, and optionally a description and a size in bytes, and returns the task. The size is 5 GB by default; the allowed sizes are in allowedAccountSize of the email domain. The password needs 8 to 30 characters and no accents.

INSERT INTO ovh.email_domain.accounts (
account_name,
description,
password,
size,
domain
)
SELECT
'{{ account_name }}' /* required */,
'{{ description }}',
'{{ password }}' /* required */,
{{ size }},
'{{ domain }}'
RETURNING
id,
name,
action,
date,
domain
;

UPDATE examples​

Update an email account. Updates the description or the size in bytes of the email account. The allowed sizes are in allowedAccountSize of the email domain.

UPDATE ovh.email_domain.accounts
SET
description = '{{ description }}',
size = {{ size }}
WHERE
account_name = '{{ account_name }}' --required
AND domain = '{{ domain }}' --required;

DELETE examples​

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

DELETE FROM ovh.email_domain.accounts
WHERE account_name = '{{ account_name }}' --required
AND domain = '{{ domain }}' --required
;

Lifecycle Methods​

EXEC variables use wire (API) names.

Change an email account password. Sets a new password and returns the task. The password needs 8 to 30 characters and no accents.

EXEC ovh.email_domain.accounts.change_password
@accountName='{{ accountName }}' --required,
@domain='{{ domain }}' --required
@@json=
'{
"password": "{{ password }}"
}'
;