Create a new Constant Contact client account under your technology partner account.

Only authorized technology partners have access to partner endpoints. To make authorized calls to partner endpoints, you must include your API key in the x-api-key header and the JSON Web Token (JWT) in the Authorization header. The JWT automatically expires in one hour (3,600 seconds) and cannot be refreshed. You must re-authenticate each time a JWT expires.

Make a POST call to the /partner/accounts endpoint to create a new Constant Contact client account under your technology partner account.

Creating a new client account automatically:

  • Adds the account to your default contact list.
  • Sets the billing plan type (plan_type) to a trial plan (TRIAL). Newly created accounts are free trials which give the client account up to 60 days to try Constant Contact before buying. Trial accounts have limits depending on the services that are included.
  • Sets the day of the month in which to bill the client account (billing_day_of_month) to null; the default setting for trial accounts.
  • Sets the billing status (billing_status) to Trial.
  • Enables the Email Constant Contact product feature (default setting).

After you create a client account you can view the billing plan details for the account by making a GET call to the /partner/accounts/{encoded_account_id}/plan endpoint.

When making a POST call to the /partner/accounts to create a new client account, you specify the account details in the request body. For example:

{
    
   "contact_email": "hank.smith@gmail.com",
   "contact_phone": "111-333-5656",
   "country_code": "US",
   "organization_name": "Hanks Fresh Fruit",
   "organization_phone": "401-333-1000",
   "state_code": "MA",
   "time_zone_id": "US/Eastern",
   "website": "http://www.ctct.com",
   "login_name": "partner_child_32",
   "password": "123456",
   "first_name": "Hank",
   "last_name": "Smith",
   "partner_account_id": "partner1234",
   "billing_locale": "en_us",
   "managed_site_owner": false,
   "enable_single_billing": false,
   "gdpr_opt_out": false
 
}

In the response body, the results display the unique ID (provision_uuid) used to identify the provision account request and the unique ID used to identify the new client account (encoded_account_id). For example:

{
    "provision_uuid": "4b5b4813-93d9-4c98-ac2f-064687f2e953",
    "encoded_account_id": "a07e1m09lsz5dl"
}

Parameters

Required header parameters include:

  • x-api-key: Enter the API key associated with your application.
  • Authorization: Enter the JWT to use.

In the request body, specify client account details by including values for the following properties:

PropertyTypeDescription
contact_emailstringRequired. A valid email address to associate with the client account.
contact_phonestringThe contact phone number to associate with the client account.
country_codestringRequired. The two-letter country code (ISO 3166-1 code) that specifies the country in which the client resides.
organization_namestringThe name of organization that identifies the client account.
organization_phonestringThe organization phone number. To set the organization phone number using the user interface, select My Settings and in the Organization Information section, select Edit Organization Information.
state_codestringRequired for US states and Canadian provinces. The two-letter state code that represents the US state (country_code is US ) or Canadian province (country_code is CA) where the client's organization is physically located. Leave the state_code blank for non-US states and Canadian provinces.
time_zone_idstringThe offical time zone to use to represent the physical location associated with the client account.
websitestringThe client's website URL. Specifying the website URL eliminates the need for clients to provide that information. Requires a valid URL starting with http:// or https://.
login_namestringRequired. A unique login name to associate with the client account. The name must only contain alphanumeric characters and the following:
  • -
  • _
  • .
  • +
  • @
passwordstringRequired if not using SSO or external authenticator. The password to associate with the client account. Passwords must be six characters in length and have no spaces. The password is not returned in the response payload for security reasons. If using SSO authentication, use idp_provider and idp_provider_id instead of password.
first_namestringThe client account owner's first name.
last_namestringThe client account owner's last name.
billing_localestringThe currency to use when billing the client account. Valid values are: en_US (default, US Dollars) or en_GB (British Pounds).
partner_account_idstringThe unique client account identifier that partners define and use for billing and reporting purposes.
managed_site_ownerstringBy default, if the client account is setup to be a managed account, managed_site_owner is automatically set to true and attempting to override the setting with false is ignored. This helps to avoid getting an account into an unknown state.
enable_single_billingstringIf the partner account is setup to allow for single billing and the managed_site_owner property is set to true, use this property to enable the single billing feature for the client account.
gdpr_opt_outstringWhen creating accounts for users who have opted-out of any marketing communications, set the gdpr_opt_out to true so that Constant Contact does not send any marketing communications to the account.
external_idstringThe ID used to uniquely identify the client account for the external authenticator. Do not use the password property when using an external authenticator.
external_providerstringThe name of the provider who externally authenticates this customer. For example, PayPal or Yahoo. Do not use the password property when using an external authenticator.

If a field validation error occurs, a 400 response message is returned.

If provisioning is not successfully completed due to unavailable dependencies, such as database or dependent services, a 503 response message is returned. By default, the client account provision data is stored and processed when provisioning becomes available.

Example POST (create) a New Partner Client Account Request

POST https://api.cc.email/v3/partner/accounts

<?php

$request = new HttpRequest();
$request->setUrl('https://api.cc.email/v3/partner/accounts');
$request->setMethod(HTTP_METH_POST);

$request->setQueryData(array(
  'partner_uid' => '1100599312345'
));

$request->setHeaders(array(
  'cache-control' => 'no-cache',
  'Content-Type' => 'application/json',
  'Authorization' => 'xxxxxxxxxxxxxWQzZGTG9DS0RGTkYzT2w0XC9KaDU2TUFtc3RnQT0iLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiI2cjZ0bzVmb2UxZ2luNWt0N3Y2Y2JoanNjcyIsInRva2VuX3VzZSI6ImFjY2VzcyIsInNjb3BlIjoidjNhcGlcL2dlbmVyYWwucGFydG5lciIsImF1dGhfdGltZSI6MTU5MTEwMTg4OCwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfTUd4alFNTTRQIiwiZXhwIjoxNTkxMTA1NDg4LCJpYXQiOjE1OTExMDE4ODgsInZlcnNpb24iOjIsImp0aSI6IjdmOWFiODI3LWIwZjktNDRmYi1iZTcwLTc3OGE5MTg0Y2MwMyIsImNsaWVudF9pZCI6IjZyNnRvNWZvZTFnaW41a3Q3djZjYmhqc2NzIn0.lLvhRdv_k1swxxxxxxxxxxxxxxxxxxxxxxxa3ZjMU4KAXitot-3VCOZ_95rErSmP7aST2oAENKiVEbttq2QJaJqVvuce2sJSx9dstWzlXixeQt5MFwkrzC3vBpT02qBotAUpoEz28zcRft5LFYxFs4Z5ycTzkgmBCdX6GtHL8bj6QihYrsi5wKdO0JatMlyt2cv1qRwN_dAKFrPx9QuXdz2x7Xnip0g7jCZDEJpYFJVe_aAoiutRGJNtpemI70_A42MU9XDTuXg0i75ISStcnjYP27SNtgKyg6So3EOnZLR5nyHeYUE3wTZfMt13wBUIsKvX_SgMgdQLOC7lOhsix8okA,xxxxxxx3N2Yxxxxxxxxxxxxxxxxxx',
  'x-api-key' => '4x1cx312-123b-436d-97c3-0f7f502218f1',
  'Accept' => '*/*'
));

$request->setBody('{
    "contact_email": "hank.smith@gmail.com",
    "contact_phone": "111-333-5656",
    "country_code": "US",
    "organization_name": "Hanks Fresh Fruit",
    "organization_phone": "401-333,1000",
    "state_code": "MA",
    "time_zone_id": "US/Eastern",
    "website": "http://www.ctct.com",
    "login_name": "partner_child_Juliana32",
    "password": "123456",
    "first_name": "Hank",
    "last_name": "Smith",
    "partner_account_id": "partner1234",
    "billing_locale": "en_us",
    "managed_site_owner": false,
    "enable_single_billing": false,
    "gdpr_opt_out": false
}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
 <?php
 
 
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n    \"contact_email\": \"hank.smith@gmail.com\",\n    \"contact_phone\": \"111-333-5656\",\n    \"country_code\": \"US\",\n    \"organization_name\": \"Hanks Fresh Fruit\",\n    \"organization_phone\": \"401-333,1000\",\n    \"state_code\": \"MA\",\n    \"time_zone_id\": \"US/Eastern\",\n    \"website\": \"http://www.ctct.com\",\n    \"login_name\": \"partner_child_32\",\n    \"password\": \"123456\",\n    \"first_name\": \"Hank\",\n    \"last_name\": \"Smith\",\n    \"partner_account_id\": \"partner1234\",\n    \"billing_locale\": \"en_us\",\n    \"managed_site_owner\": false,\n    \"enable_single_billing\": false,\n    \"gdpr_opt_out\": false\n}");
Request request = new Request.Builder()
  .url("https://api.cc.email/v3/partner/accounts")
  .post(body)
  .addHeader("Accept", "*/*")
  .addHeader("x-api-key", "4x1cx312-123b-436d-97c3-0f7f502218f1")
  .addHeader("Authorization", "xxxxxxxxxxxxxWQzZGTG9DS0RGTkYzT2w0XC9KaDU2TUFtc3RnQT0iLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiI2cjZ0bzVmb2UxZ2luNWt0N3Y2Y2JoanNjcyIsInRva2VuX3VzZSI6ImFjY2VzcyIsInNjb3BlIjoidjNhcGlcL2dlbmVyYWwucGFydG5lciIsImF1dGhfdGltZSI6MTU5MTEwMTg4OCwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfTUd4alFNTTRQIiwiZXhwIjoxNTkxMTA1NDg4LCJpYXQiOjE1OTExMDE4ODgsInZlcnNpb24iOjIsImp0aSI6IjdmOWFiODI3LWIwZjktNDRmYi1iZTcwLTc3OGE5MTg0Y2MwMyIsImNsaWVudF9pZCI6IjZyNnRvNWZvZTFnaW41a3Q3djZjYmhqc2NzIn0.lLvhRdv_k1swxxxxxxxxxxxxxxxxxxxxxxxa3ZjMU4KAXitot-3VCOZ_95rErSmP7aST2oAENKiVEbttq2QJaJqVvuce2sJSx9dstWzlXixeQt5MFwkrzC3vBpT02qBotAUpoEz28zcRft5LFYxFs4Z5ycTzkgmBCdX6GtHL8bj6QihYrsi5wKdO0JatMlyt2cv1qRwN_dAKFrPx9QuXdz2x7Xnip0g7jCZDEJpYFJVe_aAoiutRGJNtpemI70_A42MU9XDTuXg0i75ISStcnjYP27SNtgKyg6So3EOnZLR5nyHeYUE3wTZfMt13wBUIsKvX_SgMgdQLOC7lOhsix8okA,xxxxxxx3N2Yxxxxxxxxxxxxxxxxxx")
  .addHeader("Content-Type", "application/json")
  .addHeader("cache-control", "no-cache")
  .build();

Response response = client.newCall(request).execute();
curl -X POST \
  'https://api.cc.email/v3/partner/accounts' \
  -H 'Accept: */*' \
  -H 'Authorization: "xxxxxxxxxxxxxWQzZGTG9DS0RGTkYzT2w0XC9KaDU2TUFtc3RnQT0iLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiI2cjZ0bzVmb2UxZ2luNWt0N3Y2Y2JoanNjcyIsInRva2VuX3VzZSI6ImFjY2VzcyIsInNjb3BlIjoidjNhcGlcL2dlbmVyYWwucGFydG5lciIsImF1dGhfdGltZSI6MTU5MTEwMTg4OCwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfTUd4alFNTTRQIiwiZXhwIjoxNTkxMTA1NDg4LCJpYXQiOjE1OTExMDE4ODgsInZlcnNpb24iOjIsImp0aSI6IjdmOWFiODI3LWIwZjktNDRmYi1iZTcwLTc3OGE5MTg0Y2MwMyIsImNsaWVudF9pZCI6IjZyNnRvNWZvZTFnaW41a3Q3djZjYmhqc2NzIn0.lLvhRdv_k1swxxxxxxxxxxxxxxxxxxxxxxxa3ZjMU4KAXitot-3VCOZ_95rErSmP7aST2oAENKiVEbttq2QJaJqVvuce2sJSx9dstWzlXixeQt5MFwkrzC3vBpT02qBotAUpoEz28zcRft5LFYxFs4Z5ycTzkgmBCdX6GtHL8bj6QihYrsi5wKdO0JatMlyt2cv1qRwN_dAKFrPx9QuXdz2x7Xnip0g7jCZDEJpYFJVe_aAoiutRGJNtpemI70_A42MU9XDTuXg0i75ISStcnjYP27SNtgKyg6So3EOnZLR5nyHeYUE3wTZfMt13wBUIsKvX_SgMgdQLOC7lOhsix8okA,xxxxxxx3N2Yxxxxxxxxxxxxxxxxxx' \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache' \
  -H 'x-api-key: 4x1cx312-123b-436d-97c3-0f7f502218f1' \
  -d '{
    "contact_email": "hank.smith@gmail.com",
    "contact_phone": "111-333-5656",
    "country_code": "US",
    "organization_name": "Hanks Fresh Fruit",
    "organization_phone": "401-333,1000",
    "state_code": "MA",
    "time_zone_id": "US/Eastern",
    "website": "http://www.ctct.com",
    "login_name": "partner_child_32",
    "password": "123456",
    "first_name": "Hank",
    "last_name": "Smith",
    "partner_account_id": "partner1234",
    "billing_locale": "en_us",
    "managed_site_owner": false,
    "enable_single_billing": false,
    "gdpr_opt_out": false
}'

View it! Although technology partner endpoints cannot be tested using our API Reference Tester, response samples and schema are available to view for this endpoint.