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 nameObligationDefinition/Value
attributesRequiredA hash of company level attributes and values.

For more information, see the Attributes table below.
companyRequiredThe name of the company you want to change.

Attributes fields

You can specify the following fields within the attributes array.

Field nameObligationDefinition/Value
allowOptionalA list of senders whose messages are not scanned for spam; may include wildcards. For example [email protected] and *@example.com. Maximum 1000 addresses.
blockOptionalA 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.
brandOptionalThe default brand that is used for domains that do not have a brand assigned.
contactsOptionalA 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 _encodingOptionalThe type of password hashing/encoding to be performed when OpenSRS receives an unencrypted password to store for a user. We recommend BCRYPT encoding.
filterdeliveryOptionalThe 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.
languageOptionalThe 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_aliasesOptionalThe maximum number of aliases that can be created for domains in this company.
limit_usersOptionalThe maximum number of users that can be created in domains in the company.
notes_externalOptionalAny notes you want to add to the company. Maximum is 4096 characters.
quotaOptionalThe default quota assigned to new domains created in this company, in megabytes (MB).
quota_maximumOptionalThe maximum quota (in megabytes) that can be set for domains in this company.
regen_passwordsOptionalIf 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_strengthOptionalThe 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_imap4OptionalThe default setting for new domains for the IMAP4 service (enabled, disabled, or suspended). If enabled, new users can log in via IMAP4.
service_pop3OptionalThe default setting for new domains for the POP3 service (enabled, disabled, or suspended). If enabled, new users can log in via POP3.
service_smtpinOptionalThe current default setting for new users for the SMTPIN service (enabled, disabled, or suspended). If enabled, new users can send email.
service_smtprelayOptionalThe default setting for new users for the SMTPRELAY service (enabled, disabled, or suspended).
service_smtprelay _webmailOptionalThe default setting for new users for the SMTPRELAY Webmail service (enabled, disabled, or suspended). If enabled, new users can send email via Webmail.
service_webmailOptionalThe default setting for new users for the Webmail service (enabled, disabled, or suspended). If enabled, new users can log in via Webmail.
smtp_sent_limitOptionalThe 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.
spamfolderOptionalThe 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.
spamheaderOptionalThe 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.
spamlevelOptionalThe level of aggressiveness for spam filtering if not set at the user or domain level. Allowed values are: Normal, High, and Very High
spamtagOptionalThe 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_mailoutOptionalThe addresses to which company snapshots emails are sent for the company. Maximum 100 email addresses.
timezoneDeprecatedThis attribute has been deprecated and is no longer used.
wm_domainaliasOptionalThe 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 nameObligationDescription/Value
errorReturned if success = falseA text string that explains the error.
error_numberReturned if success = falseA number that represents the error.
hintsReturned if success = falseLists one or more attributes that had errors and suggests a possible cause of each error.
successAlways returnedIndicates 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
}