---
updatedAt: 2025-04-22T20:07:33.000Z
agentTools:
  projectIndex: https://email.opensrs.guide/llms.txt
---

# change_company

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

## Syntax

```perl
{
   <credentials object>, 
   "company": company_name, 
   "attributes": <attributes>
}
```

## Request fields for change\_company

The following fields can be used in the **change\_company** method:

<Table align={["left","left","left"]}>
  <thead>
    <tr>
      <th>
        Field name
      </th>

      <th>
        Obligation
      </th>

      <th>
        Definition/Value
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        attributes
      </td>

      <td>
        Required
      </td>

      <td>
        A hash of company level attributes and values.

        For more information, see the **Attributes** table below.
      </td>
    </tr>

    <tr>
      <td>
        company
      </td>

      <td>
        Required
      </td>

      <td>
        The name of the company you want to change.
      </td>
    </tr>
  </tbody>
</Table>

## Attributes fields

You can specify the following fields within the **attributes** array.

<Table align={["left","left","left"]}>
  <thead>
    <tr>
      <th>
        Field name
      </th>

      <th>
        Obligation
      </th>

      <th>
        Definition/Value
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        allow
      </td>

      <td>
        Optional
      </td>

      <td>
        A list of senders whose messages are not scanned for spam; may include wildcards. For example [joe\_goodguy@bigmail.com](mailto:joe_goodguy@bigmail.com) and \*@example.com. Maximum 1000 addresses.
      </td>
    </tr>

    <tr>
      <td>
        block
      </td>

      <td>
        Optional
      </td>

      <td>
        A list of email addresses whose messages will always be identified as spam; may include wildcards. For example, [bob\_thejerk@othermail.com](mailto:bob_thejerk@othermail.com) and \*@spammers- inc.com. Messages from these addresses will always be considered to be spam. Maximum is 1000 addresses.
      </td>
    </tr>

    <tr>
      <td>
        brand
      </td>

      <td>
        Optional
      </td>

      <td>
        The default brand that is used for domains that do not have a brand assigned.
      </td>
    </tr>

    <tr>
      <td>
        contacts
      </td>

      <td>
        Optional
      </td>

      <td>
        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**.
      </td>
    </tr>

    <tr>
      <td>
        default\_password \_encoding
      </td>

      <td>
        Optional
      </td>

      <td>
        The type of password hashing/encoding to be performed when OpenSRS receives an unencrypted password to store for a user. We recommend BCRYPT encoding.
      </td>
    </tr>

    <tr>
      <td>
        domain\_push\_allowed
      </td>

      <td>
        Optional
      </td>

      <td>
        A list of company\_ids for resellers that are allowed to push domains to this company (see push\_domain method)
      </td>
    </tr>

    <tr>
      <td>
        domain\_push\_notify
      </td>

      <td>
        Optional
      </td>

      <td>
        An email address notifications are sent to whenever a domain is pushed to this company (see push\_domain method)
      </td>
    </tr>

    <tr>
      <td>
        filterdelivery
      </td>

      <td>
        Optional
      </td>

      <td>
        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**.
      </td>
    </tr>

    <tr>
      <td>
        language
      </td>

      <td>
        Optional
      </td>

      <td>
        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](https://api-opensrs-email.readme.io/v1.0/docs/get_company?bypass=8272e34bb5) response.
      </td>
    </tr>

    <tr>
      <td>
        limit\_aliases
      </td>

      <td>
        Optional
      </td>

      <td>
        The maximum number of aliases that can be created for domains in this company.
      </td>
    </tr>

    <tr>
      <td>
        limit\_users
      </td>

      <td>
        Optional
      </td>

      <td>
        The maximum number of users that can be created in domains in the company.
      </td>
    </tr>

    <tr>
      <td>
        notes\_external
      </td>

      <td>
        Optional
      </td>

      <td>
        Any notes you want to add to the company. Maximum is 4096 characters.
      </td>
    </tr>

    <tr>
      <td>
        quota
      </td>

      <td>
        Optional
      </td>

      <td>
        The default quota assigned to new domains created in this company, in megabytes (MB).
      </td>
    </tr>

    <tr>
      <td>
        quota\_maximum
      </td>

      <td>
        Optional
      </td>

      <td>
        The maximum quota (in megabytes) that can be set for domains in this company.
      </td>
    </tr>

    <tr>
      <td>
        regen\_passwords
      </td>

      <td>
        Optional
      </td>

      <td>
        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**).
      </td>
    </tr>

    <tr>
      <td>
        password\_strength
      </td>

      <td>
        Optional
      </td>

      <td>
        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.
      </td>
    </tr>

    <tr>
      <td>
        service\_imap4
      </td>

      <td>
        Optional
      </td>

      <td>
        The default setting for new domains for the IMAP4 service (**enabled**, **disabled**, or **suspended**). If **enabled**, new users can log in via IMAP4.
      </td>
    </tr>

    <tr>
      <td>
        service\_pop3
      </td>

      <td>
        Optional
      </td>

      <td>
        The default setting for new domains for the POP3 service (**enabled, disabled**, or **suspended**). If **enabled**, new users can log in via POP3.
      </td>
    </tr>

    <tr>
      <td>
        service\_smtpin
      </td>

      <td>
        Optional
      </td>

      <td>
        The current default setting for new users for the SMTPIN service (**enabled, disabled**, or **suspended**). If enabled, new users can send email.
      </td>
    </tr>

    <tr>
      <td>
        service\_smtprelay
      </td>

      <td>
        Optional
      </td>

      <td>
        The default setting for new users for the SMTPRELAY service (**enabled, disabled**, or **suspended**).
      </td>
    </tr>

    <tr>
      <td>
        service\_smtprelay \_webmail
      </td>

      <td>
        Optional
      </td>

      <td>
        The default setting for new users for the SMTPRELAY Webmail service (**enabled, disabled**, or **suspended**). If **enabled**, new users can send email via Webmail.
      </td>
    </tr>

    <tr>
      <td>
        service\_webmail
      </td>

      <td>
        Optional
      </td>

      <td>
        The default setting for new users for the Webmail service (**enabled, disabled**, or **suspended**). If **enabled**, new users can log in via Webmail.
      </td>
    </tr>

    <tr>
      <td>
        smtp\_sent\_limit
      </td>

      <td>
        Optional
      </td>

      <td>
        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.
      </td>
    </tr>

    <tr>
      <td>
        spamfolder
      </td>

      <td>
        Optional
      </td>

      <td>
        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.
      </td>
    </tr>

    <tr>
      <td>
        spamheader
      </td>

      <td>
        Optional
      </td>

      <td>
        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.
      </td>
    </tr>

    <tr>
      <td>
        spamlevel
      </td>

      <td>
        Optional
      </td>

      <td>
        The level of aggressiveness for spam filtering if not set at the user or domain level. Allowed values are: **Normal, High**, and **Very High**
      </td>
    </tr>

    <tr>
      <td>
        spamtag
      </td>

      <td>
        Optional
      </td>

      <td>
        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.
      </td>
    </tr>

    <tr>
      <td>
        stats\_mailout
      </td>

      <td>
        Optional
      </td>

      <td>
        The addresses to which company snapshots emails are sent for the company. Maximum 100 email addresses.
      </td>
    </tr>

    <tr>
      <td>
        timezone
      </td>

      <td>
        Deprecated
      </td>

      <td>
        This attribute has been deprecated and is no longer used.
      </td>
    </tr>

    <tr>
      <td>
        wm\_domainalias
      </td>

      <td>
        Optional
      </td>

      <td>
        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.
      </td>
    </tr>
  </tbody>
</Table>

## Response fields for change\_company

The following fields may be returned in response to the **change\_company** method:

<Table align={["left","left","left"]}>
  <thead>
    <tr>
      <th>
        Field name
      </th>

      <th>
        Obligation
      </th>

      <th>
        Description/Value
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        error
      </td>

      <td>
        Returned if **success = false**
      </td>

      <td>
        A text string that explains the error.
      </td>
    </tr>

    <tr>
      <td>
        error\_number
      </td>

      <td>
        Returned if **success = false**
      </td>

      <td>
        A number that represents the error.
      </td>
    </tr>

    <tr>
      <td>
        hints
      </td>

      <td>
        Returned if **success = false**
      </td>

      <td>
        Lists one or more attributes that had errors and suggests a possible cause of each error.
      </td>
    </tr>

    <tr>
      <td>
        success
      </td>

      <td>
        Always returned
      </td>

      <td>
        Indicates whether the request was successful or not. Allowed values are **true** and **false**.
      </td>
    </tr>
  </tbody>
</Table>

## Examples for change\_company

## Example 1

Changes the spamtag and block attributes

**Request**

```text
{
  "credentials": {
    "user": "company_admin@example.adm",
    "password": "sw0rdf1sh"
  },
  "company": "Example Corp",
  "attributes": {
    "spamtag": "[JUNK]",
    "block": [
      "*@spammers.com"
    ]
	} 
}
```

**Response**

```perl
{
   "success": true
}
```

**Example 2**

Adds a note to the company

**Request**

```perl
{
  "credentials": {
  "user": "company_admin@example.adm",
    "password": "sw0rdf1sh"
  },
  "company": "Example Corp",
  "attributes": {
    "notes_external": "Talk to Bob before changing any settings here" 
  }
}
```

**Response**

```perl
{
   "success": true
}
```