change_company
The change_company method changes the attributes of an existing company.
Syntax
{
<credentials object>,
"company": company_name,
"attributes": <attributes>
}
Request fields for change_company
The following fields can be used in the change_company method:
Field name | Obligation | Definition/Value |
---|---|---|
attributes | Required | A hash of company level attributes and values. For more information, see the Attributes table below. |
company | Required | The name of the company you want to change. |
Attributes fields
You can specify the following fields within the attributes array.
Field name | Obligation | Definition/Value |
---|---|---|
allow | Optional | A list of senders whose messages are not scanned for spam; may include wildcards. For example [email protected] and *@example.com. Maximum 1000 addresses. |
block | Optional | A list of email addresses whose messages will always be identified as spam; may include wildcards. For example, [email protected] and *@spammers- inc.com. Messages from these addresses will always be considered to be spam. Maximum is 1000 addresses. |
brand | Optional | The default brand that is used for domains that do not have a brand assigned. |
contacts | Optional | A list of up to 100 company contacts. email — The contact's email address. name — The contact's name; maximum 128 characters. notes — Optional notes; maximum 1024 characters. phone — The contact's phone number; maximum 64 characters. * type — The type of contact. Allowed values are business, technical, emergency, abuse, and billing. |
default_password _encoding | Optional | The type of password hashing/encoding to be performed when OpenSRS receives an unencrypted password to store for a user. We recommend BCRYPT encoding. |
filterdelivery | Optional | The value that is used for domains in the company that do have this attribute set. Allowed values are: quarantine — Spam messages are stored locally in the user's spam folder. passthrough — Spam messages are delivered with the specified spamtag and spamheader. |
language | Optional | The default Webmail UI language for new domains in the company. A list of valid languages is displayed in the metadata ->options field in the get_company response. |
limit_aliases | Optional | The maximum number of aliases that can be created for domains in this company. |
limit_users | Optional | The maximum number of users that can be created in domains in the company. |
notes_external | Optional | Any notes you want to add to the company. Maximum is 4096 characters. |
quota | Optional | The default quota assigned to new domains created in this company, in megabytes (MB). |
quota_maximum | Optional | The maximum quota (in megabytes) that can be set for domains in this company. |
regen_passwords | Optional | If set to true, the next time a user logs in, their passwords will be converted to the encoding specified in default_password_encoding (if their current encoding differs from the one specified in default_password_encoding). |
password_strength | Optional | The minimum level at which the password strength checks must pass (see change_user). Valid values are null, "weak", "medium", "good", and "strong". If set to null, the value will be inherited from the cluster default. |
service_imap4 | Optional | The default setting for new domains for the IMAP4 service (enabled, disabled, or suspended). If enabled, new users can log in via IMAP4. |
service_pop3 | Optional | The default setting for new domains for the POP3 service (enabled, disabled, or suspended). If enabled, new users can log in via POP3. |
service_smtpin | Optional | The current default setting for new users for the SMTPIN service (enabled, disabled, or suspended). If enabled, new users can send email. |
service_smtprelay | Optional | The default setting for new users for the SMTPRELAY service (enabled, disabled, or suspended). |
service_smtprelay _webmail | Optional | The default setting for new users for the SMTPRELAY Webmail service (enabled, disabled, or suspended). If enabled, new users can send email via Webmail. |
service_webmail | Optional | The default setting for new users for the Webmail service (enabled, disabled, or suspended). If enabled, new users can log in via Webmail. |
smtp_sent_limit | Optional | The default maximum number of messages that users in the company can send in a 24 hour period if this value is not set at the user or domain level. Maximum value is 10,000. Note: If the same message is sent to two recipients, it counts as two messages against this limit. |
spamfolder | Optional | The folder to which messages that have been identified as spam are delivered if this value is not set at the user or domain level. Maximum 128 characters. |
spamheader | Optional | The tag that will be assigned to the header of spam messages if not set at the user or domain level. The format for the header must be [Capital letter]anything[:] anything. For example, XSpam: Spam detected. Maximum 512 characters. |
spamlevel | Optional | The level of aggressiveness for spam filtering if not set at the user or domain level. Allowed values are: Normal, High, and Very High |
spamtag | Optional | The tag that is appended to an email message to identify spam if this value is not set at the user or domain level. Maximum 30 characters. |
stats_mailout | Optional | The addresses to which company snapshots emails are sent for the company. Maximum 100 email addresses. |
timezone | Deprecated | This attribute has been deprecated and is no longer used. |
wm_domainalias | Optional | The default value assigned to new domains in the company. If set to true, Webmail will offer users different From addresses based on domain aliases. |
Response fields for change_company
The following fields may be returned in response to the change_company method:
Field name | Obligation | Description/Value |
---|---|---|
error | Returned if success = false | A text string that explains the error. |
error_number | Returned if success = false | A number that represents the error. |
hints | Returned if success = false | Lists one or more attributes that had errors and suggests a possible cause of each error. |
success | Always returned | Indicates whether the request was successful or not. Allowed values are true and false. |
Examples for change_company
Example 1
Changes the spamtag and block attributes
Request
{
"credentials": {
"user": "[email protected]",
"password": "sw0rdf1sh"
},
"company": "Example Corp",
"attributes": {
"spamtag": "[JUNK]",
"block": [
"*@spammers.com"
]
}
}
Response
{
"success": true
}
Example 2
Adds a note to the company
Request
{
"credentials": {
"user": "[email protected]",
"password": "sw0rdf1sh"
},
"company": "Example Corp",
"attributes": {
"notes_external": "Talk to Bob before changing any settings here"
}
}
Response
{
"success": true
}
Updated less than a minute ago