curl --request POST \
--url https://{your-subdomain}.neetodesk.com/api/external/v2/customers \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <x-api-key>' \
--data '
{
"customer": {
"emails": [
"john@example.com",
"jane@example.com"
],
"first_name": "John",
"last_name": "Doe",
"phones": [
"+1234567890"
],
"links": [
"https://github.com/john"
],
"language": "English",
"time_zone": "Eastern Time (US & Canada)",
"description": "VIP customer",
"company_id": "aaaabbbb-cccc-dddd-eeee-ffff00001111"
}
}
'import requests
url = "https://{your-subdomain}.neetodesk.com/api/external/v2/customers"
payload = { "customer": {
"emails": ["john@example.com", "jane@example.com"],
"first_name": "John",
"last_name": "Doe",
"phones": ["+1234567890"],
"links": ["https://github.com/john"],
"language": "English",
"time_zone": "Eastern Time (US & Canada)",
"description": "VIP customer",
"company_id": "aaaabbbb-cccc-dddd-eeee-ffff00001111"
} }
headers = {
"X-Api-Key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customer: {
emails: ['john@example.com', 'jane@example.com'],
first_name: 'John',
last_name: 'Doe',
phones: ['+1234567890'],
links: ['https://github.com/john'],
language: 'English',
time_zone: 'Eastern Time (US & Canada)',
description: 'VIP customer',
company_id: 'aaaabbbb-cccc-dddd-eeee-ffff00001111'
}
})
};
fetch('https://{your-subdomain}.neetodesk.com/api/external/v2/customers', 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://{your-subdomain}.neetodesk.com/api/external/v2/customers",
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([
'customer' => [
'emails' => [
'john@example.com',
'jane@example.com'
],
'first_name' => 'John',
'last_name' => 'Doe',
'phones' => [
'+1234567890'
],
'links' => [
'https://github.com/john'
],
'language' => 'English',
'time_zone' => 'Eastern Time (US & Canada)',
'description' => 'VIP customer',
'company_id' => 'aaaabbbb-cccc-dddd-eeee-ffff00001111'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <x-api-key>"
],
]);
$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://{your-subdomain}.neetodesk.com/api/external/v2/customers"
payload := strings.NewReader("{\n \"customer\": {\n \"emails\": [\n \"john@example.com\",\n \"jane@example.com\"\n ],\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"phones\": [\n \"+1234567890\"\n ],\n \"links\": [\n \"https://github.com/john\"\n ],\n \"language\": \"English\",\n \"time_zone\": \"Eastern Time (US & Canada)\",\n \"description\": \"VIP customer\",\n \"company_id\": \"aaaabbbb-cccc-dddd-eeee-ffff00001111\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<x-api-key>")
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://{your-subdomain}.neetodesk.com/api/external/v2/customers")
.header("X-Api-Key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"customer\": {\n \"emails\": [\n \"john@example.com\",\n \"jane@example.com\"\n ],\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"phones\": [\n \"+1234567890\"\n ],\n \"links\": [\n \"https://github.com/john\"\n ],\n \"language\": \"English\",\n \"time_zone\": \"Eastern Time (US & Canada)\",\n \"description\": \"VIP customer\",\n \"company_id\": \"aaaabbbb-cccc-dddd-eeee-ffff00001111\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{your-subdomain}.neetodesk.com/api/external/v2/customers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customer\": {\n \"emails\": [\n \"john@example.com\",\n \"jane@example.com\"\n ],\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"phones\": [\n \"+1234567890\"\n ],\n \"links\": [\n \"https://github.com/john\"\n ],\n \"language\": \"English\",\n \"time_zone\": \"Eastern Time (US & Canada)\",\n \"description\": \"VIP customer\",\n \"company_id\": \"aaaabbbb-cccc-dddd-eeee-ffff00001111\"\n }\n}"
response = http.request(request)
puts response.read_body{
"customer": {
"id": "aaaabbbb-cccc-dddd-eeee-ffff00002222",
"name": "John Luther",
"email": "john@example.com"
}
}Create customer
Creates a new customer.
curl --request POST \
--url https://{your-subdomain}.neetodesk.com/api/external/v2/customers \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <x-api-key>' \
--data '
{
"customer": {
"emails": [
"john@example.com",
"jane@example.com"
],
"first_name": "John",
"last_name": "Doe",
"phones": [
"+1234567890"
],
"links": [
"https://github.com/john"
],
"language": "English",
"time_zone": "Eastern Time (US & Canada)",
"description": "VIP customer",
"company_id": "aaaabbbb-cccc-dddd-eeee-ffff00001111"
}
}
'import requests
url = "https://{your-subdomain}.neetodesk.com/api/external/v2/customers"
payload = { "customer": {
"emails": ["john@example.com", "jane@example.com"],
"first_name": "John",
"last_name": "Doe",
"phones": ["+1234567890"],
"links": ["https://github.com/john"],
"language": "English",
"time_zone": "Eastern Time (US & Canada)",
"description": "VIP customer",
"company_id": "aaaabbbb-cccc-dddd-eeee-ffff00001111"
} }
headers = {
"X-Api-Key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customer: {
emails: ['john@example.com', 'jane@example.com'],
first_name: 'John',
last_name: 'Doe',
phones: ['+1234567890'],
links: ['https://github.com/john'],
language: 'English',
time_zone: 'Eastern Time (US & Canada)',
description: 'VIP customer',
company_id: 'aaaabbbb-cccc-dddd-eeee-ffff00001111'
}
})
};
fetch('https://{your-subdomain}.neetodesk.com/api/external/v2/customers', 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://{your-subdomain}.neetodesk.com/api/external/v2/customers",
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([
'customer' => [
'emails' => [
'john@example.com',
'jane@example.com'
],
'first_name' => 'John',
'last_name' => 'Doe',
'phones' => [
'+1234567890'
],
'links' => [
'https://github.com/john'
],
'language' => 'English',
'time_zone' => 'Eastern Time (US & Canada)',
'description' => 'VIP customer',
'company_id' => 'aaaabbbb-cccc-dddd-eeee-ffff00001111'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <x-api-key>"
],
]);
$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://{your-subdomain}.neetodesk.com/api/external/v2/customers"
payload := strings.NewReader("{\n \"customer\": {\n \"emails\": [\n \"john@example.com\",\n \"jane@example.com\"\n ],\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"phones\": [\n \"+1234567890\"\n ],\n \"links\": [\n \"https://github.com/john\"\n ],\n \"language\": \"English\",\n \"time_zone\": \"Eastern Time (US & Canada)\",\n \"description\": \"VIP customer\",\n \"company_id\": \"aaaabbbb-cccc-dddd-eeee-ffff00001111\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<x-api-key>")
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://{your-subdomain}.neetodesk.com/api/external/v2/customers")
.header("X-Api-Key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"customer\": {\n \"emails\": [\n \"john@example.com\",\n \"jane@example.com\"\n ],\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"phones\": [\n \"+1234567890\"\n ],\n \"links\": [\n \"https://github.com/john\"\n ],\n \"language\": \"English\",\n \"time_zone\": \"Eastern Time (US & Canada)\",\n \"description\": \"VIP customer\",\n \"company_id\": \"aaaabbbb-cccc-dddd-eeee-ffff00001111\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{your-subdomain}.neetodesk.com/api/external/v2/customers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customer\": {\n \"emails\": [\n \"john@example.com\",\n \"jane@example.com\"\n ],\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"phones\": [\n \"+1234567890\"\n ],\n \"links\": [\n \"https://github.com/john\"\n ],\n \"language\": \"English\",\n \"time_zone\": \"Eastern Time (US & Canada)\",\n \"description\": \"VIP customer\",\n \"company_id\": \"aaaabbbb-cccc-dddd-eeee-ffff00001111\"\n }\n}"
response = http.request(request)
puts response.read_body{
"customer": {
"id": "aaaabbbb-cccc-dddd-eeee-ffff00002222",
"name": "John Luther",
"email": "john@example.com"
}
}{your-subdomain} with your workspace’s subdomain. Learn how to find your subdomain in Workspace subdomain.
Headers
Use the X-Api-Key header to provide your workspace API key. Refer to Authentication for more information.
Body
Hide child attributes
Hide child attributes
Array of email addresses. Can be provided as an array of strings or an array of objects with email and primary fields. The first email in the array is treated as primary if not specified.
1"john@example.com"
["john@example.com", "jane@example.com"]First name of the customer.
"John"
Last name of the customer.
"Doe"
Array of phone numbers. Can be provided as an array of strings or an array of objects with phone and label fields.
"+1234567890"
Array of links/URLs. Can be provided as an array of strings or an array of objects with url and label fields.
"https://github.com/john"
Language preference for the customer.
"English"
Time zone for the customer.
"Eastern Time (US & Canada)"
Description or notes about the customer.
"VIP customer"
ID of the company to associate the customer with.
"aaaabbbb-cccc-dddd-eeee-ffff00001111"