Create object type
curl --request POST \
--url https://api.sapt.ai/projects/{projectId}/object-types \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"slug": "<string>",
"name": "<string>",
"schema": {},
"description": "<string>",
"statuses": [
{
"key": "<string>",
"label": "<string>",
"color": "<string>",
"isInitial": true,
"isTerminal": true
}
],
"icon": "<string>",
"color": "<string>",
"isPublicIngestable": true,
"linksToPerson": true,
"rejectUnknownFields": true
}
'import requests
url = "https://api.sapt.ai/projects/{projectId}/object-types"
payload = {
"slug": "<string>",
"name": "<string>",
"schema": {},
"description": "<string>",
"statuses": [
{
"key": "<string>",
"label": "<string>",
"color": "<string>",
"isInitial": True,
"isTerminal": True
}
],
"icon": "<string>",
"color": "<string>",
"isPublicIngestable": True,
"linksToPerson": True,
"rejectUnknownFields": True
}
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({
slug: '<string>',
name: '<string>',
schema: {},
description: '<string>',
statuses: [
{
key: '<string>',
label: '<string>',
color: '<string>',
isInitial: true,
isTerminal: true
}
],
icon: '<string>',
color: '<string>',
isPublicIngestable: true,
linksToPerson: true,
rejectUnknownFields: true
})
};
fetch('https://api.sapt.ai/projects/{projectId}/object-types', 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.sapt.ai/projects/{projectId}/object-types",
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([
'slug' => '<string>',
'name' => '<string>',
'schema' => [
],
'description' => '<string>',
'statuses' => [
[
'key' => '<string>',
'label' => '<string>',
'color' => '<string>',
'isInitial' => true,
'isTerminal' => true
]
],
'icon' => '<string>',
'color' => '<string>',
'isPublicIngestable' => true,
'linksToPerson' => true,
'rejectUnknownFields' => true
]),
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.sapt.ai/projects/{projectId}/object-types"
payload := strings.NewReader("{\n \"slug\": \"<string>\",\n \"name\": \"<string>\",\n \"schema\": {},\n \"description\": \"<string>\",\n \"statuses\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"color\": \"<string>\",\n \"isInitial\": true,\n \"isTerminal\": true\n }\n ],\n \"icon\": \"<string>\",\n \"color\": \"<string>\",\n \"isPublicIngestable\": true,\n \"linksToPerson\": true,\n \"rejectUnknownFields\": true\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.sapt.ai/projects/{projectId}/object-types")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"slug\": \"<string>\",\n \"name\": \"<string>\",\n \"schema\": {},\n \"description\": \"<string>\",\n \"statuses\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"color\": \"<string>\",\n \"isInitial\": true,\n \"isTerminal\": true\n }\n ],\n \"icon\": \"<string>\",\n \"color\": \"<string>\",\n \"isPublicIngestable\": true,\n \"linksToPerson\": true,\n \"rejectUnknownFields\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sapt.ai/projects/{projectId}/object-types")
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 \"slug\": \"<string>\",\n \"name\": \"<string>\",\n \"schema\": {},\n \"description\": \"<string>\",\n \"statuses\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"color\": \"<string>\",\n \"isInitial\": true,\n \"isTerminal\": true\n }\n ],\n \"icon\": \"<string>\",\n \"color\": \"<string>\",\n \"isPublicIngestable\": true,\n \"linksToPerson\": true,\n \"rejectUnknownFields\": true\n}"
response = http.request(request)
puts response.read_body{
"objectType": {
"slug": "<string>",
"name": "<string>",
"description": "<string>",
"kind": "system",
"icon": "<string>",
"color": "<string>",
"schema": {},
"statuses": [
{
"key": "<string>",
"label": "<string>",
"color": "<string>",
"isInitial": true,
"isTerminal": true,
"capiStage": "lead"
}
],
"isPublicIngestable": true,
"isHiddenFromUi": true,
"linksToPerson": true,
"linksToCompany": true,
"identityFields": [
"<string>"
],
"rejectUnknownFields": true,
"relations": {},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}CRM
Create object type
Create a new CRM object type in this project. Set linksToPerson for types that capture human identity or engagement so records attach to the Person spine.
POST
/
projects
/
{projectId}
/
object-types
Create object type
curl --request POST \
--url https://api.sapt.ai/projects/{projectId}/object-types \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"slug": "<string>",
"name": "<string>",
"schema": {},
"description": "<string>",
"statuses": [
{
"key": "<string>",
"label": "<string>",
"color": "<string>",
"isInitial": true,
"isTerminal": true
}
],
"icon": "<string>",
"color": "<string>",
"isPublicIngestable": true,
"linksToPerson": true,
"rejectUnknownFields": true
}
'import requests
url = "https://api.sapt.ai/projects/{projectId}/object-types"
payload = {
"slug": "<string>",
"name": "<string>",
"schema": {},
"description": "<string>",
"statuses": [
{
"key": "<string>",
"label": "<string>",
"color": "<string>",
"isInitial": True,
"isTerminal": True
}
],
"icon": "<string>",
"color": "<string>",
"isPublicIngestable": True,
"linksToPerson": True,
"rejectUnknownFields": True
}
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({
slug: '<string>',
name: '<string>',
schema: {},
description: '<string>',
statuses: [
{
key: '<string>',
label: '<string>',
color: '<string>',
isInitial: true,
isTerminal: true
}
],
icon: '<string>',
color: '<string>',
isPublicIngestable: true,
linksToPerson: true,
rejectUnknownFields: true
})
};
fetch('https://api.sapt.ai/projects/{projectId}/object-types', 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.sapt.ai/projects/{projectId}/object-types",
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([
'slug' => '<string>',
'name' => '<string>',
'schema' => [
],
'description' => '<string>',
'statuses' => [
[
'key' => '<string>',
'label' => '<string>',
'color' => '<string>',
'isInitial' => true,
'isTerminal' => true
]
],
'icon' => '<string>',
'color' => '<string>',
'isPublicIngestable' => true,
'linksToPerson' => true,
'rejectUnknownFields' => true
]),
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.sapt.ai/projects/{projectId}/object-types"
payload := strings.NewReader("{\n \"slug\": \"<string>\",\n \"name\": \"<string>\",\n \"schema\": {},\n \"description\": \"<string>\",\n \"statuses\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"color\": \"<string>\",\n \"isInitial\": true,\n \"isTerminal\": true\n }\n ],\n \"icon\": \"<string>\",\n \"color\": \"<string>\",\n \"isPublicIngestable\": true,\n \"linksToPerson\": true,\n \"rejectUnknownFields\": true\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.sapt.ai/projects/{projectId}/object-types")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"slug\": \"<string>\",\n \"name\": \"<string>\",\n \"schema\": {},\n \"description\": \"<string>\",\n \"statuses\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"color\": \"<string>\",\n \"isInitial\": true,\n \"isTerminal\": true\n }\n ],\n \"icon\": \"<string>\",\n \"color\": \"<string>\",\n \"isPublicIngestable\": true,\n \"linksToPerson\": true,\n \"rejectUnknownFields\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sapt.ai/projects/{projectId}/object-types")
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 \"slug\": \"<string>\",\n \"name\": \"<string>\",\n \"schema\": {},\n \"description\": \"<string>\",\n \"statuses\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"color\": \"<string>\",\n \"isInitial\": true,\n \"isTerminal\": true\n }\n ],\n \"icon\": \"<string>\",\n \"color\": \"<string>\",\n \"isPublicIngestable\": true,\n \"linksToPerson\": true,\n \"rejectUnknownFields\": true\n}"
response = http.request(request)
puts response.read_body{
"objectType": {
"slug": "<string>",
"name": "<string>",
"description": "<string>",
"kind": "system",
"icon": "<string>",
"color": "<string>",
"schema": {},
"statuses": [
{
"key": "<string>",
"label": "<string>",
"color": "<string>",
"isInitial": true,
"isTerminal": true,
"capiStage": "lead"
}
],
"isPublicIngestable": true,
"isHiddenFromUi": true,
"linksToPerson": true,
"linksToCompany": true,
"identityFields": [
"<string>"
],
"rejectUnknownFields": true,
"relations": {},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}Authorizations
JWT token obtained from /api/auth/token endpoint. Token is verified using JWKS and must include a valid user identifier.
Path Parameters
Body
application/json
Required string length:
2 - 48Pattern:
^[a-z][a-z0-9_]*$Required string length:
1 - 80Show child attributes
Show child attributes
Maximum string length:
500Show child attributes
Show child attributes
Maximum string length:
60Pattern:
^#[0-9a-fA-F]{3,8}$Show child attributes
Show child attributes
Response
Object type created
Show child attributes
Show child attributes