{"_id":"56ad512eb9ac5517006b696b","project":"569f9cf6650e1d1900f96b5b","__v":38,"category":{"_id":"56ad4e1cd21f1b0d00fd2f97","pages":["56ad4e3f2a7860170013f71c","56ad512eb9ac5517006b696b","56aea6ac70944b0d00c748ac","56aead360c1cab0d009f65dd","56afdf01bc304a0d00ace1f6","56afe3db1486990d009c0f50","56afe6f1b34d210d003d9bbf","56afe729aef9a21700da0e4f","56b006d33c70b01700facf63"],"version":"569f9cf6650e1d1900f96b5e","__v":9,"project":"569f9cf6650e1d1900f96b5b","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-01-30T23:58:20.127Z","from_sync":false,"order":4,"slug":"company-methods","title":"Company methods"},"githubsync":"","version":{"_id":"569f9cf6650e1d1900f96b5e","project":"569f9cf6650e1d1900f96b5b","__v":12,"createdAt":"2016-01-20T14:43:02.785Z","releaseDate":"2016-01-20T14:43:02.785Z","categories":["569f9cf7650e1d1900f96b5f","56abdd81d4432d1900eed235","56abe0558beeff0d003b8118","56ad2f8b1c09150d00a183a8","56ad4e1cd21f1b0d00fd2f97","56b00ad88f7a4f0d0029dc92","56b2432e9621f20d00efb2bd","56b25826147e900d00d6497a","56b7af2a4b372d2100722c48","56b8c4d938b1070d0028920f","56b8cdab14feef0d0082415d","58599813cf9e112d0032cdab"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"user":"5582e90181672a3900bb4fc7","parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-01-31T00:11:26.419Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","examples":{"codes":[]},"auth":"required","params":[],"url":""},"isReference":false,"order":1,"body":"## Syntax \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n   <credentials object>, \\n   \\\"company\\\": company_name, \\n   \\\"attributes\\\": <attributes>\\n}\",\n      \"language\": \"perl\",\n      \"name\": \"  \"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Request fields for change_company\"\n}\n[/block]\nThe following fields can be used in the **change_company** method:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Field name\",\n    \"h-1\": \"Obligation\",\n    \"h-2\": \"Definition/Value\",\n    \"0-0\": \"attributes\",\n    \"0-1\": \"Required\",\n    \"0-2\": \"A hash of company level attributes and values.\\n\\nFor more information, see the **Attributes** table below.\",\n    \"1-0\": \"company\",\n    \"1-1\": \"Required\",\n    \"1-2\": \"The name of the company you want to change.\"\n  },\n  \"cols\": 3,\n  \"rows\": 2\n}\n[/block]\n## Attributes fields \n\nYou can specify the following fields within the **attributes** array.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Field name\",\n    \"h-1\": \"Obligation\",\n    \"h-2\": \"Definition/Value\",\n    \"0-0\": \"allow\",\n    \"0-1\": \"Optional\",\n    \"0-2\": \"A list of senders whose messages are not scanned for spam; may include wildcards. For example joe_goodguy:::at:::bigmail.com and *@example.com. Maximum 1000 addresses.\",\n    \"1-0\": \"block\",\n    \"1-1\": \"Optional\",\n    \"1-2\": \"A list of email addresses whose messages will always be identified as spam; may include wildcards. For example, bob_thejerk@othermail.com and *@spammers- inc.com. Messages from these addresses will always be considered to be spam. Maximum is 1000 addresses.\",\n    \"2-0\": \"brand\",\n    \"2-1\": \"Optional\",\n    \"2-2\": \"The default brand that is used for domains that do not have a brand assigned.\",\n    \"3-0\": \"contacts\",\n    \"3-1\": \"Optional\",\n    \"3-2\": \"A list of up to 100 company contacts.\\n  * **email** — The contact's email address.\\n  \\n  * **name** — The contact's name; maximum 128 characters.\\n  \\n  * **notes** — Optional notes; maximum 1024 characters.\\n  \\n  * **phone** — The contact's phone number; maximum 64 characters.\\n  \\n  * **type** — The type of contact. Allowed values are **business, technical, emergency, abuse**, and **billing**.\",\n    \"4-0\": \"default_password _encoding\",\n    \"4-1\": \"Optional\",\n    \"4-2\": \"The type of password hashing/encoding to be performed when OpenSRS receives an unencrypted password to store for a user. We recommend BCRYPT encoding.\",\n    \"5-0\": \"filterdelivery\",\n    \"5-1\": \"Optional\",\n    \"5-2\": \"The value that is used for domains in the company that do have this attribute set. Allowed values are:\\n\\n  * **quarantine** — Spam messages are stored locally in the user's spam folder.\\n\\n  * **passthrough** — Spam messages are delivered with the specified **spamtag** and **spamheader**.\",\n    \"6-0\": \"language\",\n    \"6-1\": \"Optional\",\n    \"6-2\": \"The default Webmail UI language for new domains in the company. \\n\\nA list of valid languages is displayed in the **metadata** ->**options** field in the [get_company](https://api-opensrs-email.readme.io/v1.0/docs/get_company?bypass=8272e34bb5) response.\",\n    \"7-2\": \"The maximum number of aliases that can be created for domains in this company.\",\n    \"7-0\": \"limit_aliases\",\n    \"7-1\": \"Optional\",\n    \"8-0\": \"limit_users\",\n    \"8-1\": \"Optional\",\n    \"8-2\": \"The maximum number of users that can be created in domains in the company.\",\n    \"9-0\": \"notes_external\",\n    \"9-1\": \"Optional\",\n    \"9-2\": \"Any notes you want to add to the company. Maximum is 4096 characters.\",\n    \"10-0\": \"quota\",\n    \"10-1\": \"Optional\",\n    \"10-2\": \"The default quota assigned to new domains created in this company, in megabytes (MB).\",\n    \"11-0\": \"quota_maximum\",\n    \"11-1\": \"Optional\",\n    \"11-2\": \"The maximum quota (in megabytes) that can be set for domains in this company.\",\n    \"12-0\": \"regen_passwords\",\n    \"12-1\": \"Optional\",\n    \"12-2\": \"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**).\",\n    \"14-0\": \"service_imap4\",\n    \"14-1\": \"Optional\",\n    \"14-2\": \"The default setting for new domains for the IMAP4 service (**enabled**, **disabled**, or **suspended**). If **enabled**, new users can log in via IMAP4.\",\n    \"15-0\": \"service_pop3\",\n    \"15-1\": \"Optional\",\n    \"15-2\": \"The default setting for new domains for the POP3 service (**enabled, disabled**, or **suspended**). If **enabled**, new users can log in via POP3.\",\n    \"16-0\": \"service_smtpin\",\n    \"16-1\": \"Optional\",\n    \"16-2\": \"The current default setting for new users for the SMTPIN service (**enabled, disabled**, or **suspended**). If enabled, new users can send email.\",\n    \"17-0\": \"service_smtprelay\",\n    \"17-1\": \"Optional\",\n    \"17-2\": \"The default setting for new users for the SMTPRELAY service (**enabled, disabled**, or **suspended**).\",\n    \"18-0\": \"service_smtprelay _webmail\",\n    \"18-1\": \"Optional\",\n    \"18-2\": \"The default setting for new users for the SMTPRELAY Webmail service (**enabled, disabled**, or **suspended**). If **enabled**, new users can send email via Webmail.\",\n    \"19-0\": \"service_webmail\",\n    \"19-1\": \"Optional\",\n    \"19-2\": \"The default setting for new users for the Webmail service (**enabled, disabled**, or **suspended**). If **enabled**, new users can log in via Webmail.\",\n    \"20-0\": \"smtp_sent_limit\",\n    \"20-1\": \"Optional\",\n    \"20-2\": \"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.\\n\\n**Note**: If the same message is sent to two recipients, it counts as two messages against this limit.\",\n    \"21-0\": \"spamfolder\",\n    \"21-1\": \"Optional\",\n    \"21-2\": \"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.\",\n    \"22-0\": \"spamheader\",\n    \"22-1\": \"Optional\",\n    \"22-2\": \"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.\",\n    \"23-0\": \"spamlevel\",\n    \"23-1\": \"Optional\",\n    \"23-2\": \"The level of aggressiveness for spam filtering if not set at the user or domain level. Allowed values are: **Normal, High**, and **Very High**\",\n    \"24-0\": \"spamtag\",\n    \"24-1\": \"Optional\",\n    \"24-2\": \"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.\",\n    \"25-0\": \"stats_mailout\",\n    \"25-1\": \"Optional\",\n    \"25-2\": \"The addresses to which company snapshots emails are sent for the company. Maximum 100 email addresses.\",\n    \"26-0\": \"timezone\",\n    \"26-1\": \"Deprecated\",\n    \"26-2\": \"This attribute has been deprecated and is no longer used.\",\n    \"27-0\": \"wm_domainalias\",\n    \"27-1\": \"Optional\",\n    \"27-2\": \"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.\",\n    \"13-0\": \"password_strength\",\n    \"13-1\": \"Optional\",\n    \"13-2\": \"The minimum level at which the password strength checks must pass (see change_user).\\n\\nValid values are null, \\\"weak\\\", \\\"medium\\\", \\\"good\\\", and \\\"strong\\\".\\n\\nIf set to null, the value will be inherited from the cluster default.\"\n  },\n  \"cols\": 3,\n  \"rows\": 28\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Response fields for change_company\"\n}\n[/block]\nThe following fields may be returned in response to the **change_company** method:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Field name\",\n    \"h-1\": \"Obligation\",\n    \"h-2\": \"Description/Value\",\n    \"0-0\": \"error\",\n    \"0-1\": \"Returned if **success = false**\",\n    \"0-2\": \"A text string that explains the error.\",\n    \"1-0\": \"error_number\",\n    \"1-1\": \"Returned if **success = false**\",\n    \"1-2\": \"A number that represents the error.\",\n    \"2-0\": \"hints\",\n    \"2-1\": \"Returned if **success = false**\",\n    \"2-2\": \"Lists one or more attributes that had errors and suggests a possible cause of each error.\",\n    \"3-0\": \"success\",\n    \"3-1\": \"Always returned\",\n    \"3-2\": \"Indicates whether the request was successful or not. Allowed values are **true** and **false**.\"\n  },\n  \"cols\": 3,\n  \"rows\": 4\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Examples for change_company\"\n}\n[/block]\n## Example 1 \n\nChanges the spamtag and block attributes\n\n**Request** \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"credentials\\\": {\\n    \\\"user\\\": \\\"company_admin@example.adm\\\",\\n    \\\"password\\\": \\\"sw0rdf1sh\\\"\\n  },\\n  \\\"company\\\": \\\"Example Corp\\\",\\n  \\\"attributes\\\": {\\n    \\\"spamtag\\\": \\\"[JUNK]\\\",\\n    \\\"block\\\": [\\n      \\\"*@spammers.com\\\"\\n    ]\\n\\t} \\n}\",\n      \"language\": \"text\",\n      \"name\": \"  \"\n    }\n  ]\n}\n[/block]\n**Response** \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n   \\\"success\\\": true\\n}\",\n      \"language\": \"perl\",\n      \"name\": \"  \"\n    }\n  ]\n}\n[/block]\n**Example 2** \n\nAdds a note to the company\n\n**Request** \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"credentials\\\": {\\n  \\\"user\\\": \\\"company_admin@example.adm\\\",\\n    \\\"password\\\": \\\"sw0rdf1sh\\\"\\n  },\\n  \\\"company\\\": \\\"Example Corp\\\",\\n  \\\"attributes\\\": {\\n    \\\"notes_external\\\": \\\"Talk to Bob before changing any settings here\\\" \\n  }\\n}\\n\",\n      \"language\": \"perl\",\n      \"name\": \"  \"\n    }\n  ]\n}\n[/block]\n**Response** \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n   \\\"success\\\": true\\n}\",\n      \"language\": \"perl\",\n      \"name\": \"  \"\n    }\n  ]\n}\n[/block]","excerpt":"The **change_company** method changes the attributes of an existing company.","slug":"change_company","type":"basic","title":"change_company"}

change_company

The **change_company** method changes the attributes of an existing company.

## Syntax [block:code] { "codes": [ { "code": "{\n <credentials object>, \n \"company\": company_name, \n \"attributes\": <attributes>\n}", "language": "perl", "name": " " } ] } [/block] [block:api-header] { "type": "basic", "title": "Request fields for change_company" } [/block] The following fields can be used in the **change_company** method: [block:parameters] { "data": { "h-0": "Field name", "h-1": "Obligation", "h-2": "Definition/Value", "0-0": "attributes", "0-1": "Required", "0-2": "A hash of company level attributes and values.\n\nFor more information, see the **Attributes** table below.", "1-0": "company", "1-1": "Required", "1-2": "The name of the company you want to change." }, "cols": 3, "rows": 2 } [/block] ## Attributes fields You can specify the following fields within the **attributes** array. [block:parameters] { "data": { "h-0": "Field name", "h-1": "Obligation", "h-2": "Definition/Value", "0-0": "allow", "0-1": "Optional", "0-2": "A list of senders whose messages are not scanned for spam; may include wildcards. For example joe_goodguy@bigmail.com and *@example.com. Maximum 1000 addresses.", "1-0": "block", "1-1": "Optional", "1-2": "A list of email addresses whose messages will always be identified as spam; may include wildcards. For example, bob_thejerk@othermail.com and *@spammers- inc.com. Messages from these addresses will always be considered to be spam. Maximum is 1000 addresses.", "2-0": "brand", "2-1": "Optional", "2-2": "The default brand that is used for domains that do not have a brand assigned.", "3-0": "contacts", "3-1": "Optional", "3-2": "A list of up to 100 company contacts.\n * **email** — The contact's email address.\n \n * **name** — The contact's name; maximum 128 characters.\n \n * **notes** — Optional notes; maximum 1024 characters.\n \n * **phone** — The contact's phone number; maximum 64 characters.\n \n * **type** — The type of contact. Allowed values are **business, technical, emergency, abuse**, and **billing**.", "4-0": "default_password _encoding", "4-1": "Optional", "4-2": "The type of password hashing/encoding to be performed when OpenSRS receives an unencrypted password to store for a user. We recommend BCRYPT encoding.", "5-0": "filterdelivery", "5-1": "Optional", "5-2": "The value that is used for domains in the company that do have this attribute set. Allowed values are:\n\n * **quarantine** — Spam messages are stored locally in the user's spam folder.\n\n * **passthrough** — Spam messages are delivered with the specified **spamtag** and **spamheader**.", "6-0": "language", "6-1": "Optional", "6-2": "The default Webmail UI language for new domains in the company. \n\nA list of valid languages is displayed in the **metadata** ->**options** field in the [get_company](https://api-opensrs-email.readme.io/v1.0/docs/get_company?bypass=8272e34bb5) response.", "7-2": "The maximum number of aliases that can be created for domains in this company.", "7-0": "limit_aliases", "7-1": "Optional", "8-0": "limit_users", "8-1": "Optional", "8-2": "The maximum number of users that can be created in domains in the company.", "9-0": "notes_external", "9-1": "Optional", "9-2": "Any notes you want to add to the company. Maximum is 4096 characters.", "10-0": "quota", "10-1": "Optional", "10-2": "The default quota assigned to new domains created in this company, in megabytes (MB).", "11-0": "quota_maximum", "11-1": "Optional", "11-2": "The maximum quota (in megabytes) that can be set for domains in this company.", "12-0": "regen_passwords", "12-1": "Optional", "12-2": "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**).", "14-0": "service_imap4", "14-1": "Optional", "14-2": "The default setting for new domains for the IMAP4 service (**enabled**, **disabled**, or **suspended**). If **enabled**, new users can log in via IMAP4.", "15-0": "service_pop3", "15-1": "Optional", "15-2": "The default setting for new domains for the POP3 service (**enabled, disabled**, or **suspended**). If **enabled**, new users can log in via POP3.", "16-0": "service_smtpin", "16-1": "Optional", "16-2": "The current default setting for new users for the SMTPIN service (**enabled, disabled**, or **suspended**). If enabled, new users can send email.", "17-0": "service_smtprelay", "17-1": "Optional", "17-2": "The default setting for new users for the SMTPRELAY service (**enabled, disabled**, or **suspended**).", "18-0": "service_smtprelay _webmail", "18-1": "Optional", "18-2": "The default setting for new users for the SMTPRELAY Webmail service (**enabled, disabled**, or **suspended**). If **enabled**, new users can send email via Webmail.", "19-0": "service_webmail", "19-1": "Optional", "19-2": "The default setting for new users for the Webmail service (**enabled, disabled**, or **suspended**). If **enabled**, new users can log in via Webmail.", "20-0": "smtp_sent_limit", "20-1": "Optional", "20-2": "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.\n\n**Note**: If the same message is sent to two recipients, it counts as two messages against this limit.", "21-0": "spamfolder", "21-1": "Optional", "21-2": "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.", "22-0": "spamheader", "22-1": "Optional", "22-2": "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.", "23-0": "spamlevel", "23-1": "Optional", "23-2": "The level of aggressiveness for spam filtering if not set at the user or domain level. Allowed values are: **Normal, High**, and **Very High**", "24-0": "spamtag", "24-1": "Optional", "24-2": "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.", "25-0": "stats_mailout", "25-1": "Optional", "25-2": "The addresses to which company snapshots emails are sent for the company. Maximum 100 email addresses.", "26-0": "timezone", "26-1": "Deprecated", "26-2": "This attribute has been deprecated and is no longer used.", "27-0": "wm_domainalias", "27-1": "Optional", "27-2": "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.", "13-0": "password_strength", "13-1": "Optional", "13-2": "The minimum level at which the password strength checks must pass (see change_user).\n\nValid values are null, \"weak\", \"medium\", \"good\", and \"strong\".\n\nIf set to null, the value will be inherited from the cluster default." }, "cols": 3, "rows": 28 } [/block] [block:api-header] { "type": "basic", "title": "Response fields for change_company" } [/block] The following fields may be returned in response to the **change_company** method: [block:parameters] { "data": { "h-0": "Field name", "h-1": "Obligation", "h-2": "Description/Value", "0-0": "error", "0-1": "Returned if **success = false**", "0-2": "A text string that explains the error.", "1-0": "error_number", "1-1": "Returned if **success = false**", "1-2": "A number that represents the error.", "2-0": "hints", "2-1": "Returned if **success = false**", "2-2": "Lists one or more attributes that had errors and suggests a possible cause of each error.", "3-0": "success", "3-1": "Always returned", "3-2": "Indicates whether the request was successful or not. Allowed values are **true** and **false**." }, "cols": 3, "rows": 4 } [/block] [block:api-header] { "type": "basic", "title": "Examples for change_company" } [/block] ## Example 1 Changes the spamtag and block attributes **Request** [block:code] { "codes": [ { "code": "{\n \"credentials\": {\n \"user\": \"company_admin@example.adm\",\n \"password\": \"sw0rdf1sh\"\n },\n \"company\": \"Example Corp\",\n \"attributes\": {\n \"spamtag\": \"[JUNK]\",\n \"block\": [\n \"*@spammers.com\"\n ]\n\t} \n}", "language": "text", "name": " " } ] } [/block] **Response** [block:code] { "codes": [ { "code": "{\n \"success\": true\n}", "language": "perl", "name": " " } ] } [/block] **Example 2** Adds a note to the company **Request** [block:code] { "codes": [ { "code": "{\n \"credentials\": {\n \"user\": \"company_admin@example.adm\",\n \"password\": \"sw0rdf1sh\"\n },\n \"company\": \"Example Corp\",\n \"attributes\": {\n \"notes_external\": \"Talk to Bob before changing any settings here\" \n }\n}\n", "language": "perl", "name": " " } ] } [/block] **Response** [block:code] { "codes": [ { "code": "{\n \"success\": true\n}", "language": "perl", "name": " " } ] } [/block]