Create or update an account
Creates an account with its phone numbers and email addresses, or updates it if an account with the same accountid already exists.
Fields are nested: send them as account[first_name], phones[0][phone_number] and so on, or as a JSON body with Content-Type: application/json.
Parameters
Send as application/x-www-form-urlencoded.
typestringrequiredSelects the operation. Always
add_accountfor this endpoint.tokenstringrequiredYour API token from Log in. See Authentication.
Your DCDial company ID.
Example101Your reference for the account. If an account with this reference exists, it is updated. If you leave it out, DCDial generates one (for example 2026-04512).
ExampleACC-10045First name.
ExampleJaneLast name.
ExampleDoePrimary email address. Defaults to the first of emails.
Example[email protected]Primary phone number. Defaults to the first of phones.
Example5550100123Address line 1.
Example100 Main StCity.
ExampleAtlantaTwo-letter state code.
ExampleGAZIP or postal code.
Example30301Country code.
ExampleUSOutstanding balance.
Example1250.5Date of birth (YYYY-MM-DD).
Company name, for business accounts.
Custom fields custom1 to custom20, for your own data.
List to add the account's phone numbers and emails to, so campaigns can reach them.
Example2048A phone number. Repeat with phones[1], phones[2] … for more.
Example5550100123Type of the number, for example MOBILE, HOME or WORK.
ExampleMOBILEUTC offset of the number, such as -6.00. Defaults to US Eastern time.
Example-5.00An email address. Repeat with emails[1] … for more.
Example[email protected]
Notes
This endpoint returns its data without the response wrapper. Use Add an account to a campaign instead if you want the account placed straight into a campaign.
curl https://api.dcdial.com/api/ \ -d type=add_account \ -d token="$DCDIAL_TOKEN" \ -d account[company_id]=101 \ -d account[accountid]=ACC-10045 \ -d account[first_name]=Jane \ -d account[last_name]=Doe \ -d account[balance]=1250.5 \ -d accounts_leads[list_id]=2048 \ -d phones[0][phone_number]=5550100123 \ -d phones[0][phone_type]=MOBILE \<?php$ch = curl_init('https://api.dcdial.com/api/');curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_POSTFIELDS => http_build_query([ 'type' => 'add_account', 'token' => getenv('DCDIAL_TOKEN'), 'account[company_id]' => 101, 'account[accountid]' => 'ACC-10045', 'account[first_name]' => 'Jane', 'account[last_name]' => 'Doe', 'account[balance]' => 1250.5, 'accounts_leads[list_id]' => 2048, 'phones[0][phone_number]' => '5550100123', 'phones[0][phone_type]' => 'MOBILE', ]),]);$result = json_decode(curl_exec($ch), true);curl_close($ch);
if (($result['response']['success'] ?? 0) != 1) { throw new RuntimeException($result['response']['error'] ?? 'Request failed');}const res = await fetch('https://api.dcdial.com/api/', { method: 'POST', body: new URLSearchParams({ type: "add_account", token: process.env.DCDIAL_TOKEN, 'account[company_id]': "101", 'account[accountid]': "ACC-10045", 'account[first_name]': "Jane", 'account[last_name]': "Doe", 'account[balance]': "1250.5", 'accounts_leads[list_id]': "2048", 'phones[0][phone_number]': "5550100123", 'phones[0][phone_type]': "MOBILE", }),});const { response } = await res.json();if (response.success != 1) throw new Error(response.error);import osimport requests
r = requests.post( "https://api.dcdial.com/api/", data={ "type": "add_account", "token": os.environ["DCDIAL_TOKEN"], "account[company_id]": 101, "account[accountid]": "ACC-10045", "account[first_name]": "Jane", "account[last_name]": "Doe", "account[balance]": 1250.5, "accounts_leads[list_id]": 2048, "phones[0][phone_number]": "5550100123", "phones[0][phone_type]": "MOBILE", }, timeout=30,)response = r.json()["response"]if str(response.get("success")) != "1": raise RuntimeError(response.get("error")){ "accounts_id": 55120, "accountid": "ACC-10045", "success": 1}Try it