Create subaccount

POST
https://www.digicert.com/services/v2/account

If subaccounts have not been enabled by your account representative, you will receive access_denied|missing_permission error.

Use this endpoint to create a new subaccount.

When creating a managed account, the API key is shown only this one time in the api_key parameter of the response body. It will never be shown again and there is no way to retrieve it if lost.

cURL
curl -X POST \
  https://www.digicert.com/services/v2/account \
  -H 'Content-Type: application/json' \
  -H 'X-DC-DEVKEY: {{api_key}}' \
  -d '{
  "account_type": "retail",
  "allowed_grandchildren": [
    "retail",
    "enterprise",
    "reseller"
  ],
  "account_manager_user_id": 12345,
  "user": {
    "first_name": "John",
    "last_name": "Smith",
    "email": "john.smith@example.com",
    "username": "john.smith@example.com",
    "job_title": "Statistician",
    "telephone": "111-222-333-4444"
  },
  "organization": {
    "name": "Example Company, LLC",
    "address": "123 Fake Street",
    "address2": "Suite 321",
    "zip": "93090",
    "city": "Toledo",
    "state": "AL",
    "country": "US",
    "telephone": "111-222-333-4445"
  }
}'
Python
import requests

url = "https://www.digicert.com/services/v2/account"

payload = "{\n  \"account_type\": \"retail\",\n  \"allowed_grandchildren\": [\n    \"retail\",\n    \"enterprise\",\n    \"reseller\"\n  ],\n  \"account_manager_user_id\": 12345,\n  \"user\": {\n    \"first_name\": \"John\",\n    \"last_name\": \"Smith\",\n    \"email\": \"john.smith@example.com\",\n    \"username\": \"john.smith@example.com\",\n    \"job_title\": \"Statistician\",\n    \"telephone\": \"111-222-333-4444\"\n  },\n  \"organization\": {\n    \"name\": \"Example Company, LLC\",\n    \"address\": \"123 Fake Street\",\n    \"address2\": \"Suite 321\",\n    \"zip\": \"93090\",\n    \"city\": \"Toledo\",\n    \"state\": \"AL\",\n    \"country\": \"US\",\n    \"telephone\": \"111-222-333-4445\"\n  }\n}"
headers = {
    'X-DC-DEVKEY': "{{api_key}}",
    'Content-Type': "application/json"
    }

response = requests.request("POST", url, data=payload, headers=headers)

print(response.text)
Go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://www.digicert.com/services/v2/account"

	payload := strings.NewReader("{\n  \"account_type\": \"retail\",\n  \"allowed_grandchildren\": [\n    \"retail\",\n    \"enterprise\",\n    \"reseller\"\n  ],\n  \"account_manager_user_id\": 12345,\n  \"user\": {\n    \"first_name\": \"John\",\n    \"last_name\": \"Smith\",\n    \"email\": \"john.smith@example.com\",\n    \"username\": \"john.smith@example.com\",\n    \"job_title\": \"Statistician\",\n    \"telephone\": \"111-222-333-4444\"\n  },\n  \"organization\": {\n    \"name\": \"Example Company, LLC\",\n    \"address\": \"123 Fake Street\",\n    \"address2\": \"Suite 321\",\n    \"zip\": \"93090\",\n    \"city\": \"Toledo\",\n    \"state\": \"AL\",\n    \"country\": \"US\",\n    \"telephone\": \"111-222-333-4445\"\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("X-DC-DEVKEY", "{{api_key}}")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
NodeJS
var request = require("request");

var options = { method: 'POST',
  url: 'https://www.digicert.com/services/v2/account',
  headers: 
   { 'Content-Type': 'application/json',
     'X-DC-DEVKEY': '{{api_key}}' },
  body: 
   { account_type: 'retail',
     allowed_grandchildren: [ 'retail', 'enterprise', 'reseller' ],
     account_manager_user_id: 12345,
     user: 
      { first_name: 'John',
        last_name: 'Smith',
        email: 'john.smith@example.com',
        username: 'john.smith@example.com',
        job_title: 'Statistician',
        telephone: '111-222-333-4444' },
     organization: 
      { name: 'Example Company, LLC',
        address: '123 Fake Street',
        address2: 'Suite 321',
        zip: '93090',
        city: 'Toledo',
        state: 'AL',
        country: 'US',
        telephone: '111-222-333-4445' } },
  json: true };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
201 Created
{
  "id": 1122334,
  "account_type": "retail",
  "account_manager_user_id": 12345,
  "organization": {
    "id": 3344556,
    "status": "active",
    "name": "Example Company, LLC",
    "display_name": "Example Company, LLC",
    "is_active": true,
    "address": "123 Fake Street",
    "zip": "93090",
    "city": "Toledo",
    "state": "AL",
    "country": "us",
    "telephone": "111-222-333-4445",
    "container": {
      "id": 112234,
      "parent_id": 0,
      "name": "Example Company, LLC",
      "is_active": true
    }
  },
  "user": {
    "id": 45321,
    "username": "john.smith@example.com",
    "account_id": 12121,
    "first_name": "John",
    "last_name": "Smith",
    "email": "john.smith@example.com",
    "job_title": "Statistician",
    "telephone": "111-222-333-4444",
    "type": "standard"
  }
}
201 Created (managed subaccount)
{
  "id": 1122334,
  "account_type": "managed",
  "account_manager_user_id": 12345,
  "organization": {
    "id": 3344556,
    "status": "active",
    "name": "Example Company, LLC",
    "display_name": "Example Company, LLC",
    "is_active": true,
    "address": "123 Fake Street",
    "zip": "93090",
    "city": "Toledo",
    "state": "AL",
    "country": "us",
    "telephone": "111-222-333-4445",
    "container": {
      "id": 112234,
      "parent_id": 0,
      "name": "Example Company, LLC",
      "is_active": true
    }
  },
  "user": {
    "id": 45321,
    "username": "john.smith@example.com",
    "account_id": 12121,
    "first_name": "John",
    "last_name": "Smith",
    "email": "john.smith@example.com",
    "job_title": "Statistician",
    "telephone": "111-222-333-4444",
    "type": "standard"
  },
  "api_key": "{{api_key}}"
}

Request parameters

Name Req/Opt Type Description
account_type required string Specify type of subaccount to create.
See Glossary – Subaccount types
Allowed values: standard, enterprise, reseller, managed
allowed_grandchildren required array List of account types that can be created under the account.
See Glossary – Subaccount types
Allowed values: standard, enterprise, reseller
account_manager_user_id optional int ID of an existing user that will manage the subaccount.
bill_parent optional bool Specify if the parent account should be billed for all certificate orders.
Default: false
user required object Details about the new subaccount user to create.
.. first_name required string First name of the subaccount user.
.. last_name required string Last name of the subaccount user.
.. email required string Email address of the subaccount user.
The account creation email will be sent to this address.
.. username optional string Username used to sign in to the subaccount.
If omitted, the email value will be used as the username.
.. job_title optional string Job title of the subaccount user.
.. telephone optional string Telephone number of the subaccount user.
organization required object Details about the subaccount's primary organization
.. name required string Legal name of the organization.
.. assumed_name optional string Public name of the organization.
Also called DBA name.
.. address required string Address of the organization.
.. address2 optional string
.. zip required string Postal code of the organization.
.. city required string City where the organization is located.
.. state required string State where the organization is located.
.. country required string Country where the organization is located.
.. telephone optional string Organization telephone number.

Response parameters

Name Type Description
id int Account ID of the subaccount.
account_type string Account type of the subaccount.
account_manager_user_id int User ID of the subaccount manager.
bill_parent bool Specifies if parent account is billed for certificate orders.
organization object Details about the subaccount's primary organization.
.. id int Organization ID.
.. status string Organization status.
Possible values: active, inactive
.. name string Legal name of the organization.
.. assumed_name string Public name of the organization.
Also called DBA name.
.. display_name string Full name of the organization.
Constructed using name + assumed_name.
.. is_active bool Active status of the organization.
.. address string Address of the organization.
.. address2 string
.. zip string Postal code of the organization.
.. city string City where the organization is located.
.. state string State where the organization is located.
.. country string Country where the organization is located.
.. telephone string Organization telephone number.
.. container object Primary container the organization is attached to.
.. .. id int Container ID.
.. .. parent_id int ID of the container's parent.
.. .. name string Name of the container.
.. .. is_active bool Active status of the organization.
user object Details about the new subaccount user.
.. id int User ID.
.. username string Username used to sign in to the subaccount.
.. account_id int Account ID of the new subaccount.
.. first_name string First name of the user.
.. last_name string Last name of the user.
.. email string Email address of the user.
.. job_title string Job title of the user.
.. telephone string Telephone number of the user.
.. type string User type.
Possible values: standard
api_key string Generated API key for the subaccount.
Only returned if subaccount_type is managed.