« Back to Documentation Overview

add_account

Section: Servers
Version: 1.5.0


Add new account to server.
Conditions:

  • password (mandatory) – Must be at least 8 characters including lowercase letter, uppercase letter, digit or special character. Note for polish users: this conforms GIODO increased and high security levels.
  • first_name (mandatory) – At least one character.
  • last_name (mandatory) – At least one character.
  • email (mandatory) – Valid email address.
  • company_name (optional) – At least one character.
  • phone (mandatory) – At least one character. No format is forced.
  • country_code (mandatory) – Two letter country code as described in ISO 3166-1.
  • country (mandatory) – Name of country as described in ISO 3166-1. Must match country_code.
  • city (mandatory) – At least one character.
  • state (optional) – At least one character.
  • street (mandatory) – At least one character.
  • zip_code (mandatory) – At least one character. No format is forced.
  • campaign (mandatory) – Every account created must also have default campaign. Conditions are explained on add_campaign method with few differences:
  • campaign from_field / reply_to_field – Are not passed because default campaign inherits account email address.
  • campaign confirmation_subject (mandatory) – CONFIRMATION_SUBJECT_ID obtained from get_confirmation_subjects. Used in confirmation messages sent from this campaign.
  • campaign confirmation_body (mandatory) – CONFIRMATION_BODY_ID obtained from get_confirmation_bodies. Used in confirmation messages sent from this campaign.
  • campaign optin (optional) – Allows to set campaign optin mode to single (unconfirmed) or double (confirmed). Note that campaign confirmation_subject / confirmation_body are mandatory even if optin is single.

Every account added through API has its own API KEY generated by default.


Parameters
stringAPI_KEY
object
stringpassword12#$qwER
stringfirst_nameJohn
stringlast_nameDoe
stringemailjohn.doe@example.mail
stringcompany_nameImplix
stringphone+48111111111
stringcountry_codePL
stringcountryPoland
stringcityGdau0144sk
stringstatepomorskie
stringstreetu017babianska
stringzip_code24-213
objectcampaign
stringnametrains
stringdescriptionFani pociu0105gu00f3w.
stringconfirmation_subjectCONFIRMATION_SUBJECT_ID
stringconfirmation_bodyCONFIRMATION_BODY_ID
stringlanguage_codePL
stringoptinsingle
Return Value
stringACCOUNT_IDabc123
integeradded1

Example Request JSON

[
    "API_KEY",
    {
        "password": "12#$qwER",
        "first_name": "John",
        "last_name": "Doe",
        "email": "john.doe@example.mail",
        "company_name": "Implix",
        "phone": "+48111111111",
        "country_code": "PL",
        "country": "Poland",
        "city": "Gdau0144sk",
        "state": "pomorskie",
        "street": "u017babianska",
        "zip_code": "24-213",
        "campaign": {
            "name": "trains",
            "description": "Fani pociu0105gu00f3w.",
            "confirmation_subject": "CONFIRMATION_SUBJECT_ID",
            "confirmation_body": "CONFIRMATION_BODY_ID",
            "language_code": "PL",
            "optin": "single"
        }
    }
]

Example Response JSON

{
    "ACCOUNT_ID": "abc123",
    "added": 1
}

Example Error Response JSON

{
    "code": -1,
    "message": "Invalid country"
}
Method-specific Errors
Owner privilege missing
Invalid email syntax
Email already taken
Password too weak
Invalid country
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