Import email accounts from CSV file

This function imports email accounts from an already uploaded CSV file.

SecurityBasicAuth
Request
query Parameters
domain
required
string <domain>

The domain under which to add the email accounts.

Example: domain=example.com
id
required
string

The unique ID of the import operation. The cPanel API 2 CSVImport::uploadimport function generates this ID and stores it in the CPVAR attribute named csvimportid.

Example: id=Leq58oid3sF3Moye3_YbJGqoMvCb7M4j
type
required
string

The type of email address to add.

  • email — A regular email account.
  • fwd — A forwarder.
Enum: "email" "fwd"
Example: type=email
Responses
200

HTTP Request was successful.

Response Schema: application/json
apiversion
integer

The version of the API.

func
string

The name of the method called.

module
string

The name of the module called.

object
get/CSVImport/doimport
Request samples
uapi --output=jsonpretty \
  --user=username \
  CSVImport \
  doimport \
  id='Leq58oid3sF3Moye3_YbJGqoMvCb7M4j' \
  type='email' \
  domain='example.com'
Response samples
application/json
{
  • "apiversion": 3,
  • "func": "doimport",
  • "module": "CSVImport",
  • "result": {
    • "data": {
      • "results": [
        • {
          • "email": "j.doe@example.com",
          • "reason": "OK",
          • "status": 1,
          • "type": "email"
          },
        • {
          • "email": "jdoe@example.com",
          • "reason": "The account jdoe@example.com already exists!",
          • "status": 0,
          • "type": "email"
          }
        ]
      },
    • "errors": [
      • "1 error(s) were encountered while importing accounts."
      ],
    • "messages": null,
    • "metadata": { },
    • "status": 0,
    • "warnings": null
    }
}