Update an account¶
Update certain properties of an account of any permission level
- HTTP Method:
PATCH
- URL:
https://example.domain.tld/api/v1/accounts/<username>/
- Require authentication:
Yes
Path parameters¶
Parameter | Type | Description | Required |
---|---|---|---|
username | str | Account username to update | Required |
Editing own account¶
All permission levels have the ability to update the following properties of their own account:
- password
- recovery_email
- language
Update MasterAdmin¶
- Permission level required:
MasterAdmin
Request parameters¶
Parameter | Type | Description | Required |
---|---|---|---|
password | str | Account password | Optional |
api_access | int | Enable (1) or disable (0) API access | Optional |
enabled | int | Enable (1) or disable (0) account | Optional |
recovery_email | str | Email to use for password reset | Optional |
language | str | ISO 639-1 or ISO 639-2 language code | Optional |
Any one of the above parameter is required.
password
can be in plain-text or hashed form. Hash must use SHA512-Crypt
scheme and must be of the following format: {SHA512-CRYPT}$6$...
Response¶
Updated parameter(s) and value(s)
Update DomainAdmin¶
- Permission level required:
MasterAdmin
Request parameters¶
Parameter | Type | Description | Required |
---|---|---|---|
password | str | Account password | Optional |
api_access | int | Enable (1) or disable (0) API access | Optional |
enabled | int | Enable (1) or disable (0) account | Optional |
recovery_email | str | Email to use for password reset | Optional |
language | str | ISO 639-1 or ISO 639-2 language code | Optional |
domains | str | Comma separated list of administered domains | Optional |
storagequota_total | int | Storage quota in MB | Optional |
quota_domains | int | Domains quota | Optional |
quota_mailboxes | int | Mailboxes quota | Optional |
quota_aliases | int | Aliases quota | Optional |
quota_domainaliases | int | Domain aliases quota | Optional |
Any one of the above parameter is required.
password
can be in plain-text or hashed form. Hash must use SHA512-Crypt
scheme and must be of the following format: {SHA512-CRYPT}$6$...
Response¶
Updated parameter(s) and value(s)
Update MailUser¶
- Permission level required:
MasterAdmin
/DomainAdmin
Request parameters¶
Parameter | Type | Description | Required |
---|---|---|---|
password | str | Account password | Optional |
api_access | int | Enable (1) or disable (0) API access | Optional |
enabled | int | Enable (1) or disable (0) account | Optional |
recovery_email | str | Email to use for password reset | Optional |
language | str | ISO 639-1 or ISO 639-2 language code | Optional |
storagequota_total | int | Storage quota in MB | Optional |
Any one of the above parameter is required.
password
can be in plain-text or hashed form. Hash must use SHA512-Crypt
scheme and must be of the following format: {SHA512-CRYPT}$6$...
Response¶
Updated parameter(s) and value(s)
Example request (Python)¶
import requests
import json
from pprint import pprint
url = "https://example.domain.tld/api/v1/accounts/u1@vonmail.com/"
data = {
"storagequota_total" : 100
}
r = requests.patch(url, json=data, auth=("admin","long-auth_token-here"))
try:
pprint(r.json())
except:
print(r.text)
Example response (JSON)¶
{'storagequota_total': 100}