Entity Type API
Search Entity Types
Search for entity types by key or other filters.
POST
/
v2
/
entity-types
/
search
Search Entity Types
curl --request POST \
--url https://public.api.serval.com/v2/entity-types/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"teamId": "<string>",
"key": "<string>",
"pageSize": 123,
"pageToken": "<string>"
}
'import requests
url = "https://public.api.serval.com/v2/entity-types/search"
payload = {
"teamId": "<string>",
"key": "<string>",
"pageSize": 123,
"pageToken": "<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({teamId: '<string>', key: '<string>', pageSize: 123, pageToken: '<string>'})
};
fetch('https://public.api.serval.com/v2/entity-types/search', 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://public.api.serval.com/v2/entity-types/search",
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([
'teamId' => '<string>',
'key' => '<string>',
'pageSize' => 123,
'pageToken' => '<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://public.api.serval.com/v2/entity-types/search"
payload := strings.NewReader("{\n \"teamId\": \"<string>\",\n \"key\": \"<string>\",\n \"pageSize\": 123,\n \"pageToken\": \"<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://public.api.serval.com/v2/entity-types/search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"teamId\": \"<string>\",\n \"key\": \"<string>\",\n \"pageSize\": 123,\n \"pageToken\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://public.api.serval.com/v2/entity-types/search")
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 \"teamId\": \"<string>\",\n \"key\": \"<string>\",\n \"pageSize\": 123,\n \"pageToken\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "<string>",
"teamId": "<string>",
"key": "<string>",
"name": "<string>",
"parentEntityTypeId": "<string>",
"createdAt": "2025-01-15T01:30:15.000Z",
"updatedAt": "2025-01-15T01:30:15.000Z",
"createdByUserId": "<string>",
"updatedByUserId": "<string>",
"fields": [
{
"id": "<string>",
"entityTypeId": "<string>",
"key": "<string>",
"name": "<string>",
"dataType": "DATA_TYPE_UNSPECIFIED",
"createdAt": "2025-01-15T01:30:15.000Z",
"updatedAt": "2025-01-15T01:30:15.000Z",
"createdByUserId": "<string>",
"updatedByUserId": "<string>",
"enumOptions": [
{
"id": "<string>",
"value": "<string>",
"displayName": "<string>",
"displayOrder": 123,
"description": "<string>"
}
],
"isKeyField": true,
"isNameField": true,
"fieldId": "<string>",
"refEntityTypeId": "<string>",
"refEntityTypeIds": [
"<string>"
],
"description": "<string>",
"sourceEntityTypeId": "<string>",
"viewerCanViewValues": true,
"viewerCanEdit": true,
"helpAgentVisible": true,
"sensitive": true,
"sectionId": "<string>",
"displayOptions": {
"boolean": {
"style": "STYLE_UNSPECIFIED"
}
},
"valueSource": "FIELD_VALUE_SOURCE_UNSPECIFIED",
"formula": "<string>",
"defaultFormula": "<string>",
"formulaDisabledAt": "2025-01-15T01:30:15.000Z",
"autoNumber": {
"prefix": "<string>",
"digits": 123,
"scope": "AUTO_NUMBER_SCOPE_UNSPECIFIED"
},
"timestampRange": {
"allowsOpenEnd": true
}
}
],
"color": "<string>",
"iconSlug": "<string>",
"entitySchemaId": "<string>",
"helpAgentVisibility": "HELP_AGENT_ENTITY_VISIBILITY_UNSPECIFIED",
"viewerCanViewValues": true,
"viewerCanEdit": true,
"sections": [
{
"id": "<string>",
"entityTypeId": "<string>",
"name": "<string>",
"sourceEntityTypeId": "<string>",
"createdAt": "2025-01-15T01:30:15.000Z",
"updatedAt": "2025-01-15T01:30:15.000Z",
"createdByUserId": "<string>",
"updatedByUserId": "<string>"
}
],
"isEdgeType": true,
"description": "<string>"
}
],
"nextPageToken": "<string>"
}Authentication and permissions
Token requirements: User-based token (OAuth) or Organization-scoped API key or Team-scoped API key. Send a bearer access token for one of these identities. The permissions and resource restrictions below also apply.
| Credential | Access requirements |
|---|---|
| Organization-scoped API key | entities:read |
| Team-scoped API key | entities:read |
| User-based token (OAuth) | Supported, subject to permissions |
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
The ID of the team the caller acts as.
Optional filter by entity type key. Matches across the team's own databases and the databases shared with it, the team's own type first when a shared type has the same key.
Maximum number of results to return. Default is 5000, maximum is 10000.
Token for pagination. Leave empty for the first request.
Was this page helpful?
⌘I
Search Entity Types
curl --request POST \
--url https://public.api.serval.com/v2/entity-types/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"teamId": "<string>",
"key": "<string>",
"pageSize": 123,
"pageToken": "<string>"
}
'import requests
url = "https://public.api.serval.com/v2/entity-types/search"
payload = {
"teamId": "<string>",
"key": "<string>",
"pageSize": 123,
"pageToken": "<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({teamId: '<string>', key: '<string>', pageSize: 123, pageToken: '<string>'})
};
fetch('https://public.api.serval.com/v2/entity-types/search', 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://public.api.serval.com/v2/entity-types/search",
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([
'teamId' => '<string>',
'key' => '<string>',
'pageSize' => 123,
'pageToken' => '<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://public.api.serval.com/v2/entity-types/search"
payload := strings.NewReader("{\n \"teamId\": \"<string>\",\n \"key\": \"<string>\",\n \"pageSize\": 123,\n \"pageToken\": \"<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://public.api.serval.com/v2/entity-types/search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"teamId\": \"<string>\",\n \"key\": \"<string>\",\n \"pageSize\": 123,\n \"pageToken\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://public.api.serval.com/v2/entity-types/search")
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 \"teamId\": \"<string>\",\n \"key\": \"<string>\",\n \"pageSize\": 123,\n \"pageToken\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "<string>",
"teamId": "<string>",
"key": "<string>",
"name": "<string>",
"parentEntityTypeId": "<string>",
"createdAt": "2025-01-15T01:30:15.000Z",
"updatedAt": "2025-01-15T01:30:15.000Z",
"createdByUserId": "<string>",
"updatedByUserId": "<string>",
"fields": [
{
"id": "<string>",
"entityTypeId": "<string>",
"key": "<string>",
"name": "<string>",
"dataType": "DATA_TYPE_UNSPECIFIED",
"createdAt": "2025-01-15T01:30:15.000Z",
"updatedAt": "2025-01-15T01:30:15.000Z",
"createdByUserId": "<string>",
"updatedByUserId": "<string>",
"enumOptions": [
{
"id": "<string>",
"value": "<string>",
"displayName": "<string>",
"displayOrder": 123,
"description": "<string>"
}
],
"isKeyField": true,
"isNameField": true,
"fieldId": "<string>",
"refEntityTypeId": "<string>",
"refEntityTypeIds": [
"<string>"
],
"description": "<string>",
"sourceEntityTypeId": "<string>",
"viewerCanViewValues": true,
"viewerCanEdit": true,
"helpAgentVisible": true,
"sensitive": true,
"sectionId": "<string>",
"displayOptions": {
"boolean": {
"style": "STYLE_UNSPECIFIED"
}
},
"valueSource": "FIELD_VALUE_SOURCE_UNSPECIFIED",
"formula": "<string>",
"defaultFormula": "<string>",
"formulaDisabledAt": "2025-01-15T01:30:15.000Z",
"autoNumber": {
"prefix": "<string>",
"digits": 123,
"scope": "AUTO_NUMBER_SCOPE_UNSPECIFIED"
},
"timestampRange": {
"allowsOpenEnd": true
}
}
],
"color": "<string>",
"iconSlug": "<string>",
"entitySchemaId": "<string>",
"helpAgentVisibility": "HELP_AGENT_ENTITY_VISIBILITY_UNSPECIFIED",
"viewerCanViewValues": true,
"viewerCanEdit": true,
"sections": [
{
"id": "<string>",
"entityTypeId": "<string>",
"name": "<string>",
"sourceEntityTypeId": "<string>",
"createdAt": "2025-01-15T01:30:15.000Z",
"updatedAt": "2025-01-15T01:30:15.000Z",
"createdByUserId": "<string>",
"updatedByUserId": "<string>"
}
],
"isEdgeType": true,
"description": "<string>"
}
],
"nextPageToken": "<string>"
}
