Partial update customer
curl --request PATCH \
--url https://api.initdesk.com/organizations/{organization_id}/customers/{pk}/ \
--header 'Content-Type: application/json' \
--header 'X-Initdesk-Token: <api-key>' \
--data '
{
"name": "<string>",
"email": "jsmith@example.com",
"is_spam": true,
"company_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://api.initdesk.com/organizations/{organization_id}/customers/{pk}/"
payload = {
"name": "<string>",
"email": "jsmith@example.com",
"is_spam": True,
"company_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"X-Initdesk-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-Initdesk-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
email: 'jsmith@example.com',
is_spam: true,
company_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://api.initdesk.com/organizations/{organization_id}/customers/{pk}/', 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.initdesk.com/organizations/{organization_id}/customers/{pk}/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'email' => 'jsmith@example.com',
'is_spam' => true,
'company_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Initdesk-Token: <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://api.initdesk.com/organizations/{organization_id}/customers/{pk}/"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"is_spam\": true,\n \"company_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-Initdesk-Token", "<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.patch("https://api.initdesk.com/organizations/{organization_id}/customers/{pk}/")
.header("X-Initdesk-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"is_spam\": true,\n \"company_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.initdesk.com/organizations/{organization_id}/customers/{pk}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Initdesk-Token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"is_spam\": true,\n \"company_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"name": "<string>",
"company": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"email": "jsmith@example.com",
"is_spam": true
}Partial update customer
Update selected requester fields. Set company_id to group the person, or null to ungroup. This write allows moving someone who already has a company.
PATCH
/
organizations
/
{organization_id}
/
customers
/
{pk}
/
Partial update customer
curl --request PATCH \
--url https://api.initdesk.com/organizations/{organization_id}/customers/{pk}/ \
--header 'Content-Type: application/json' \
--header 'X-Initdesk-Token: <api-key>' \
--data '
{
"name": "<string>",
"email": "jsmith@example.com",
"is_spam": true,
"company_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://api.initdesk.com/organizations/{organization_id}/customers/{pk}/"
payload = {
"name": "<string>",
"email": "jsmith@example.com",
"is_spam": True,
"company_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"X-Initdesk-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-Initdesk-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
email: 'jsmith@example.com',
is_spam: true,
company_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://api.initdesk.com/organizations/{organization_id}/customers/{pk}/', 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.initdesk.com/organizations/{organization_id}/customers/{pk}/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'email' => 'jsmith@example.com',
'is_spam' => true,
'company_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Initdesk-Token: <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://api.initdesk.com/organizations/{organization_id}/customers/{pk}/"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"is_spam\": true,\n \"company_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-Initdesk-Token", "<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.patch("https://api.initdesk.com/organizations/{organization_id}/customers/{pk}/")
.header("X-Initdesk-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"is_spam\": true,\n \"company_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.initdesk.com/organizations/{organization_id}/customers/{pk}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Initdesk-Token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"is_spam\": true,\n \"company_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"name": "<string>",
"company": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"email": "jsmith@example.com",
"is_spam": true
}Authorizations
Path Parameters
A unique integer value identifying this customer.
Pattern:
^[-a-zA-Z0-9_]+$Body
application/jsonapplication/x-www-form-urlencodedmultipart/form-data
Response
200 - application/json
Was this page helpful?

