curl
curl -X POST "https://sandbox-api.sannos.ai/v2/organization-units" \
-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", {
method: "POST",
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.post(
"https://sandbox-api.sannos.ai/v2/organization-units",
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",
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([
'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"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"type\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://sandbox-api.sannos.ai/v2/organization-units")
.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")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.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>",
"id": "<string>",
"name": "<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
Create an organization unit of any type.
Create an organization unit of any type of your company.
Required Fields:
type- Organization unit type code (seeGET /v2/organization-unit-types)name- Display name, at most 255 characters, unique within the type (case-insensitive)
The unit is created at the top of the organization tree: this route takes no parentId.
Units of the business_entity type are listed by GET /v2/organization-units with type=business_entity.
Errors:
422- Blank or too longname, unknown or archivedtype, or a duplicate name in that type
Response:
id- New organization unit IDname,type,companyId
POST
/
v2
/
organization-units
curl
curl -X POST "https://sandbox-api.sannos.ai/v2/organization-units" \
-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", {
method: "POST",
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.post(
"https://sandbox-api.sannos.ai/v2/organization-units",
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",
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([
'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"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"type\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://sandbox-api.sannos.ai/v2/organization-units")
.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")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.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>",
"id": "<string>",
"name": "<string>",
"type": "<string>"
}{
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}{
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}