curl
curl -X PATCH "https://sandbox-api.sannos.ai/v2/organization-units/01ABCORGANI?type=value" \
-H "X-API-Key: $EVE_COMPANY_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"string","type":"string"}'const res = await fetch("https://sandbox-api.sannos.ai/v2/organization-units/01ABCORGANI?type=value", {
method: "PATCH",
headers: { "X-API-Key": process.env.EVE_COMPANY_KEY, "Content-Type": "application/json" },
body: JSON.stringify({
"name": "string",
"type": "string"
}),
});
const data = await res.json();import os, requests
res = requests.patch(
"https://sandbox-api.sannos.ai/v2/organization-units/01ABCORGANI?type=value",
headers={"X-API-Key": os.environ["EVE_COMPANY_KEY"]},
json={
"name": "string",
"type": "string"
},
)
data = res.json()<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox-api.sannos.ai/v2/organization-units/{organizationUnitId}",
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>',
'type' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <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://sandbox-api.sannos.ai/v2/organization-units/{organizationUnitId}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"type\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-API-Key", "<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://sandbox-api.sannos.ai/v2/organization-units/{organizationUnitId}")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"type\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-api.sannos.ai/v2/organization-units/{organizationUnitId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"type\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"companyId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"id": "<string>",
"isApproved": true,
"isArchived": true,
"name": "<string>",
"parentId": "<string>",
"type": "<string>",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}{
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}{
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}Organization Units
Rename an organization unit or move it to another type.
Rename an organization unit of your company or move it to another type.
Updatable Fields (send at least one):
name- Display name, at most 255 characters, unique within the target type (case-insensitive)type- Organization unit type code; the target type must not be archived
Query Parameters:
type- Optional organization unit type code the unit must have now; a unit of another type is not found
Moving a business_entity unit to another type removes it from the list filtered by type=business_entity.
Archived units cannot be updated.
Errors:
400-organizationUnitIdis not a ULID404- No active unit with this ID in your company (or it has anothertypethan the one asked for)422- Nothing to update, blank or too longname, unknown or archivedtype, archived unit, or a duplicate name in the target type
Response:
- The updated unit:
id,name,type,companyId,parentId,isArchived,isApproved,createdAt,updatedAt
PATCH
/
v2
/
organization-units
/
{organizationUnitId}
curl
curl -X PATCH "https://sandbox-api.sannos.ai/v2/organization-units/01ABCORGANI?type=value" \
-H "X-API-Key: $EVE_COMPANY_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"string","type":"string"}'const res = await fetch("https://sandbox-api.sannos.ai/v2/organization-units/01ABCORGANI?type=value", {
method: "PATCH",
headers: { "X-API-Key": process.env.EVE_COMPANY_KEY, "Content-Type": "application/json" },
body: JSON.stringify({
"name": "string",
"type": "string"
}),
});
const data = await res.json();import os, requests
res = requests.patch(
"https://sandbox-api.sannos.ai/v2/organization-units/01ABCORGANI?type=value",
headers={"X-API-Key": os.environ["EVE_COMPANY_KEY"]},
json={
"name": "string",
"type": "string"
},
)
data = res.json()<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox-api.sannos.ai/v2/organization-units/{organizationUnitId}",
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>',
'type' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <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://sandbox-api.sannos.ai/v2/organization-units/{organizationUnitId}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"type\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-API-Key", "<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://sandbox-api.sannos.ai/v2/organization-units/{organizationUnitId}")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"type\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-api.sannos.ai/v2/organization-units/{organizationUnitId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"type\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"companyId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"id": "<string>",
"isApproved": true,
"isArchived": true,
"name": "<string>",
"parentId": "<string>",
"type": "<string>",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}{
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}{
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}