curl --request POST \
--url https://api.dev.name.com/core/v1/accounts \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"account": {
"accountName": "reseller_subaccount",
"password": "SecureP4ss!",
"contacts": {
"registrant": {
"firstName": "Jane",
"lastName": "Doe",
"address1": "123 Main St.",
"city": "Denver",
"state": "CO",
"zip": "12345",
"country": "US",
"phone": "+13035551212",
"email": "admin@example.net"
}
}
},
"apiTos": true,
"tos": true
}
'import requests
url = "https://api.dev.name.com/core/v1/accounts"
payload = {
"account": {
"accountName": "reseller_subaccount",
"password": "SecureP4ss!",
"contacts": { "registrant": {
"firstName": "Jane",
"lastName": "Doe",
"address1": "123 Main St.",
"city": "Denver",
"state": "CO",
"zip": "12345",
"country": "US",
"phone": "+13035551212",
"email": "admin@example.net"
} }
},
"apiTos": True,
"tos": True
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
account: {
accountName: 'reseller_subaccount',
password: 'SecureP4ss!',
contacts: {
registrant: {
firstName: 'Jane',
lastName: 'Doe',
address1: '123 Main St.',
city: 'Denver',
state: 'CO',
zip: '12345',
country: 'US',
phone: '+13035551212',
email: 'admin@example.net'
}
}
},
apiTos: true,
tos: true
})
};
fetch('https://api.dev.name.com/core/v1/accounts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.dev.name.com/core/v1/accounts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'account' => [
'accountName' => 'reseller_subaccount',
'password' => 'SecureP4ss!',
'contacts' => [
'registrant' => [
'firstName' => 'Jane',
'lastName' => 'Doe',
'address1' => '123 Main St.',
'city' => 'Denver',
'state' => 'CO',
'zip' => '12345',
'country' => 'US',
'phone' => '+13035551212',
'email' => 'admin@example.net'
]
]
],
'apiTos' => true,
'tos' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.dev.name.com/core/v1/accounts"
payload := strings.NewReader("{\n \"account\": {\n \"accountName\": \"reseller_subaccount\",\n \"password\": \"SecureP4ss!\",\n \"contacts\": {\n \"registrant\": {\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"address1\": \"123 Main St.\",\n \"city\": \"Denver\",\n \"state\": \"CO\",\n \"zip\": \"12345\",\n \"country\": \"US\",\n \"phone\": \"+13035551212\",\n \"email\": \"admin@example.net\"\n }\n }\n },\n \"apiTos\": true,\n \"tos\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.dev.name.com/core/v1/accounts")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"account\": {\n \"accountName\": \"reseller_subaccount\",\n \"password\": \"SecureP4ss!\",\n \"contacts\": {\n \"registrant\": {\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"address1\": \"123 Main St.\",\n \"city\": \"Denver\",\n \"state\": \"CO\",\n \"zip\": \"12345\",\n \"country\": \"US\",\n \"phone\": \"+13035551212\",\n \"email\": \"admin@example.net\"\n }\n }\n },\n \"apiTos\": true,\n \"tos\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dev.name.com/core/v1/accounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"account\": {\n \"accountName\": \"reseller_subaccount\",\n \"password\": \"SecureP4ss!\",\n \"contacts\": {\n \"registrant\": {\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"address1\": \"123 Main St.\",\n \"city\": \"Denver\",\n \"state\": \"CO\",\n \"zip\": \"12345\",\n \"country\": \"US\",\n \"phone\": \"+13035551212\",\n \"email\": \"admin@example.net\"\n }\n }\n },\n \"apiTos\": true,\n \"tos\": true\n}"
response = http.request(request)
puts response.read_body{
"accountName": "new_reseller_account",
"apiToken": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"apiTokenName": "my_reseller_token"
}{
"message": "Bad Request",
"details": "'domainName' cannot be null"
}{
"message": "Unauthorized"
}{
"message": "Permission denied",
"details": "Failed authentication"
}{
"message": "Method Not Allowed"
}{
"message": "The 'Content-Type' header must be 'application/json' for this request."
}{
"message": "Rate Limit Exceeded"
}{
"message": "Internal Server Error",
"details": "Something went wrong."
}{
"message": "The server received an invalid response from the upstream server."
}{
"message": "Service Unavailable",
"details": "The API is offline for scheduled maintenance. See https://status.name.com for updates."
}{
"message": "The upstream server is taking too long to respond."
}Create Account
Creates a new sub-account under your authenticated reseller account and returns API credentials for the new account. This endpoint is only available to approved reseller accounts. Contact name.com support to request access.
curl --request POST \
--url https://api.dev.name.com/core/v1/accounts \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"account": {
"accountName": "reseller_subaccount",
"password": "SecureP4ss!",
"contacts": {
"registrant": {
"firstName": "Jane",
"lastName": "Doe",
"address1": "123 Main St.",
"city": "Denver",
"state": "CO",
"zip": "12345",
"country": "US",
"phone": "+13035551212",
"email": "admin@example.net"
}
}
},
"apiTos": true,
"tos": true
}
'import requests
url = "https://api.dev.name.com/core/v1/accounts"
payload = {
"account": {
"accountName": "reseller_subaccount",
"password": "SecureP4ss!",
"contacts": { "registrant": {
"firstName": "Jane",
"lastName": "Doe",
"address1": "123 Main St.",
"city": "Denver",
"state": "CO",
"zip": "12345",
"country": "US",
"phone": "+13035551212",
"email": "admin@example.net"
} }
},
"apiTos": True,
"tos": True
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
account: {
accountName: 'reseller_subaccount',
password: 'SecureP4ss!',
contacts: {
registrant: {
firstName: 'Jane',
lastName: 'Doe',
address1: '123 Main St.',
city: 'Denver',
state: 'CO',
zip: '12345',
country: 'US',
phone: '+13035551212',
email: 'admin@example.net'
}
}
},
apiTos: true,
tos: true
})
};
fetch('https://api.dev.name.com/core/v1/accounts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.dev.name.com/core/v1/accounts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'account' => [
'accountName' => 'reseller_subaccount',
'password' => 'SecureP4ss!',
'contacts' => [
'registrant' => [
'firstName' => 'Jane',
'lastName' => 'Doe',
'address1' => '123 Main St.',
'city' => 'Denver',
'state' => 'CO',
'zip' => '12345',
'country' => 'US',
'phone' => '+13035551212',
'email' => 'admin@example.net'
]
]
],
'apiTos' => true,
'tos' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.dev.name.com/core/v1/accounts"
payload := strings.NewReader("{\n \"account\": {\n \"accountName\": \"reseller_subaccount\",\n \"password\": \"SecureP4ss!\",\n \"contacts\": {\n \"registrant\": {\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"address1\": \"123 Main St.\",\n \"city\": \"Denver\",\n \"state\": \"CO\",\n \"zip\": \"12345\",\n \"country\": \"US\",\n \"phone\": \"+13035551212\",\n \"email\": \"admin@example.net\"\n }\n }\n },\n \"apiTos\": true,\n \"tos\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.dev.name.com/core/v1/accounts")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"account\": {\n \"accountName\": \"reseller_subaccount\",\n \"password\": \"SecureP4ss!\",\n \"contacts\": {\n \"registrant\": {\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"address1\": \"123 Main St.\",\n \"city\": \"Denver\",\n \"state\": \"CO\",\n \"zip\": \"12345\",\n \"country\": \"US\",\n \"phone\": \"+13035551212\",\n \"email\": \"admin@example.net\"\n }\n }\n },\n \"apiTos\": true,\n \"tos\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dev.name.com/core/v1/accounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"account\": {\n \"accountName\": \"reseller_subaccount\",\n \"password\": \"SecureP4ss!\",\n \"contacts\": {\n \"registrant\": {\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"address1\": \"123 Main St.\",\n \"city\": \"Denver\",\n \"state\": \"CO\",\n \"zip\": \"12345\",\n \"country\": \"US\",\n \"phone\": \"+13035551212\",\n \"email\": \"admin@example.net\"\n }\n }\n },\n \"apiTos\": true,\n \"tos\": true\n}"
response = http.request(request)
puts response.read_body{
"accountName": "new_reseller_account",
"apiToken": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"apiTokenName": "my_reseller_token"
}{
"message": "Bad Request",
"details": "'domainName' cannot be null"
}{
"message": "Unauthorized"
}{
"message": "Permission denied",
"details": "Failed authentication"
}{
"message": "Method Not Allowed"
}{
"message": "The 'Content-Type' header must be 'application/json' for this request."
}{
"message": "Rate Limit Exceeded"
}{
"message": "Internal Server Error",
"details": "Something went wrong."
}{
"message": "The server received an invalid response from the upstream server."
}{
"message": "Service Unavailable",
"details": "The API is offline for scheduled maintenance. See https://status.name.com for updates."
}{
"message": "The upstream server is taking too long to respond."
}Authorizations
Authenticate via HTTP Basic with your account username and API token. Examples use an explicit 'Authorization: Basic <base64(username:token)>' header; 'curl -u username:token' is equivalent. For sandbox, append "-test" to your username and use your sandbox token on api.dev.name.com.
Body
CreateAccountRequest has the information that is needed to create an account with the CreateAccount function.
CreateAccountRequest has the information that is needed to create an account with the CreateAccount function.
The account details for the new account being created.
Show child attributes
Show child attributes
Must be set to true to indicate acceptance of the API Terms of Service.
true
Must be set to true to indicate acceptance of the general Terms of Service.
true
Response
A successful response containing the newly created account details and credentials.
CreateAccountResponse contains information about the newly created account and the API credentials generated for it.
AccountName is the unique user-assigned name of newly created account.
"new_reseller_account"
The authentication token that should be used to access the API. This value is only returned once upon account creation.
"a1b2c3d4-e5f6-7890-abcd-ef1234567890"
ApiTokenName user assigned name of api token.
"my_reseller_token"
Was this page helpful?