curl --request POST \
--url https://api.chatsailer.com/v1/organizations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"custom_fields": {},
"external_id": "crm-48213",
"owner_id": "usr_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4",
"visibility": "company",
"website": "<string>"
}
'import requests
url = "https://api.chatsailer.com/v1/organizations"
payload = {
"name": "<string>",
"custom_fields": {},
"external_id": "crm-48213",
"owner_id": "usr_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4",
"visibility": "company",
"website": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
custom_fields: {},
external_id: 'crm-48213',
owner_id: 'usr_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4',
visibility: 'company',
website: '<string>'
})
};
fetch('https://api.chatsailer.com/v1/organizations', 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.chatsailer.com/v1/organizations",
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>',
'custom_fields' => [
],
'external_id' => 'crm-48213',
'owner_id' => 'usr_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4',
'visibility' => 'company',
'website' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.chatsailer.com/v1/organizations"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"custom_fields\": {},\n \"external_id\": \"crm-48213\",\n \"owner_id\": \"usr_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4\",\n \"visibility\": \"company\",\n \"website\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.chatsailer.com/v1/organizations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"custom_fields\": {},\n \"external_id\": \"crm-48213\",\n \"owner_id\": \"usr_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4\",\n \"visibility\": \"company\",\n \"website\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.chatsailer.com/v1/organizations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"custom_fields\": {},\n \"external_id\": \"crm-48213\",\n \"owner_id\": \"usr_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4\",\n \"visibility\": \"company\",\n \"website\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2023-11-07T05:31:56Z",
"id": "org_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4",
"name": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"visibility": "private",
"custom_fields": {},
"external_id": "<string>",
"object": "organization",
"owner": {
"id": "<string>",
"kind": "user",
"name": "<string>",
"object": "owner"
},
"owner_id": "usr_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4",
"tags": [
{
"id": "tag_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4",
"name": "<string>",
"color": "<string>",
"object": "tag"
}
],
"website": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "invalid_request_error",
"detail": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"documentation_url": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "invalid_request_error",
"detail": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"documentation_url": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "invalid_request_error",
"detail": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"documentation_url": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "invalid_request_error",
"detail": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"documentation_url": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "invalid_request_error",
"detail": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"documentation_url": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "invalid_request_error",
"detail": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"documentation_url": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "invalid_request_error",
"detail": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"documentation_url": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}Create an organization
Creates an organization. Names are not unique, so this always creates a new record — search first if you mean to reuse an existing one.
curl --request POST \
--url https://api.chatsailer.com/v1/organizations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"custom_fields": {},
"external_id": "crm-48213",
"owner_id": "usr_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4",
"visibility": "company",
"website": "<string>"
}
'import requests
url = "https://api.chatsailer.com/v1/organizations"
payload = {
"name": "<string>",
"custom_fields": {},
"external_id": "crm-48213",
"owner_id": "usr_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4",
"visibility": "company",
"website": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
custom_fields: {},
external_id: 'crm-48213',
owner_id: 'usr_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4',
visibility: 'company',
website: '<string>'
})
};
fetch('https://api.chatsailer.com/v1/organizations', 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.chatsailer.com/v1/organizations",
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>',
'custom_fields' => [
],
'external_id' => 'crm-48213',
'owner_id' => 'usr_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4',
'visibility' => 'company',
'website' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.chatsailer.com/v1/organizations"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"custom_fields\": {},\n \"external_id\": \"crm-48213\",\n \"owner_id\": \"usr_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4\",\n \"visibility\": \"company\",\n \"website\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.chatsailer.com/v1/organizations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"custom_fields\": {},\n \"external_id\": \"crm-48213\",\n \"owner_id\": \"usr_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4\",\n \"visibility\": \"company\",\n \"website\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.chatsailer.com/v1/organizations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"custom_fields\": {},\n \"external_id\": \"crm-48213\",\n \"owner_id\": \"usr_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4\",\n \"visibility\": \"company\",\n \"website\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2023-11-07T05:31:56Z",
"id": "org_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4",
"name": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"visibility": "private",
"custom_fields": {},
"external_id": "<string>",
"object": "organization",
"owner": {
"id": "<string>",
"kind": "user",
"name": "<string>",
"object": "owner"
},
"owner_id": "usr_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4",
"tags": [
{
"id": "tag_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4",
"name": "<string>",
"color": "<string>",
"object": "tag"
}
],
"website": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "invalid_request_error",
"detail": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"documentation_url": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "invalid_request_error",
"detail": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"documentation_url": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "invalid_request_error",
"detail": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"documentation_url": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "invalid_request_error",
"detail": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"documentation_url": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "invalid_request_error",
"detail": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"documentation_url": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "invalid_request_error",
"detail": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"documentation_url": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "invalid_request_error",
"detail": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"documentation_url": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}Authorizations
A workspace API token (sk_live_...) or an OAuth access token (oat_live_...). Create workspace tokens in Settings > API. Send either as Authorization: Bearer <token>.
Headers
A unique value (a UUID works) that makes retrying this request safe. A repeat with the same key and body within 24 hours returns the original response instead of acting twice; the same key with a different body is a 409 idempotency_key_reused.
255Query Parameters
Comma-separated relationships to inline in the response, e.g. organization. Unexpanded relations are still identified by their *_id field.
"organization"
Body
Body for POST /v1/organizations.
Required; a nameless organization is not useful.
1Your own id for this record, e.g. its id in your system. Unique per workspace and resource; send null to clear it.
1 - 255"crm-48213"
Unique identifier for an user.
^usr_[0-9a-f]{32}$"usr_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4"
Who in the workspace can see a record: only its owner, the owner's team, the team and its sub-teams, or everyone.
private, team, team_and_subteams, company Response
Successful Response
A company a contact belongs to.
Unique identifier for an organization.
^org_[0-9a-f]{32}$"org_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4"
Who in the workspace can see this record. A workspace token sees every record regardless; an OAuth token sees what the person who authorized it can see.
private, team, team_and_subteams, company Every custom field defined on organizations in this workspace, keyed by field key and typed from its definition. Unset fields are null, so reading any organization shows the full set of keys in use.
Your own id for this record, when you set one.
"organization"Whoever is responsible for this record. Always populated when the record has an owner — this is not an expand target.
Show child attributes
Show child attributes
Unique identifier for an user.
^usr_[0-9a-f]{32}$"usr_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4"
Show child attributes
Show child attributes