« Back to Documentation Overview

set_account_status

Section: Servers
Version: 1.5.0


Enable or disable account or its features.

    Conditions:
  • account (mandatory) – Identifier of account. If identifier is incorrect then Missing account error will be returned.
  • status (optional) – May be ‘enabled’ or ‘disabled’. If this param is skipped existing status is not modified.
  • block_features (optional) - Prevent account from accessing specific features. Names of those features can be seen on "Owner settings" -> "Accounts List" -> "edit details" -> "Features blocked" pulldown menu. If this param is skipped existing blocks are not modified. If this param is given previous blocks are removed and new list of blocks is applied. Therefore to remove all blocks (enable all features) empty array should be passed as param value. Current list of blocks can be obtained using get_account method.
  • send_limit (optional) - Maximum amount of emails that account can send. If this param is skipped existing limit is not modified. If this param is null then any existing limit is removed. If this param is given limit is set but without modifying existing "used" or "reseted_on" values - which can be checked in get_account method under "send_limit".

Warning: Setting send_limit with and without removing previous limit behaves differently. Let's say you have account that was created in January.
  • in January send_limit was set to 1000, in February send_limit was set to 2000, in March send_limit was set to 3000
  • in January send_limit was set to 1000, in February previous send_limit was removed and new send_limit was set to 1000, in March previous send_limit was removed and new send_limit was set to 1000

In both cases account can send 3000 emails within 3 months. But in first case account can use remaining pool from previous months (for example it can send 100 emails in January, 100 emails in February and 2800 emails in March) while in second case it is not possible.
Warning: Never use batch call to reset previous limit and set a new one in one call because - according to the spec - server may process those two requests in any order.


Parameters
stringAPI_KEY
object
stringaccountACCOUNT_ID
stringstatusenabled
arrayblock_features
stringCreateCampaign
stringMultimedia
integersend_limit1048576
Return Value
objectresult
stringupdated1

Example Request JSON

[
    "API_KEY",
    {
        "account": "ACCOUNT_ID",
        "status": "enabled",
        "block_features": [
            "CreateCampaign",
            "Multimedia"
        ],
        "send_limit": 1048576
    }
]

Example Response JSON

{
    "result": {
        "updated": "1"
    }
}

Example Error Response JSON

{
    "code": -1,
    "message": "Invalid feature name"
}
Method-specific Errors
Owner privileges missing
Missing account
Cannot modify owner account
Invalid feature name
API-wide Errors
API key verification failed API key verification failed
API client IP not allowed API client IP not allowed
Invalid params Attribute params must be reference to hash