Entity Type API
Get Entity Type
Get an entity type by ID.
GET
/
v2
/
entity-types
/
{id}
Get Entity Type
curl --request GET \
--url https://public.api.serval.com/v2/entity-types/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://public.api.serval.com/v2/entity-types/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://public.api.serval.com/v2/entity-types/{id}', 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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://public.api.serval.com/v2/entity-types/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://public.api.serval.com/v2/entity-types/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://public.api.serval.com/v2/entity-types/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
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>"
}
}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 |
- Read an entity type in a team’s database, or in a database shared with one of your teams: The permission is checked on the definition’s owning team, or on a team its database is shared with. A definition the caller cannot reach reads as not found.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The ID of the entity type. Readable in its owning team or through a team its database is shared with; a type the caller cannot reach reads as not found.
Response
200 - application/json
Success
The entity type.
Show child attributes
Show child attributes
Was this page helpful?
⌘I
Get Entity Type
curl --request GET \
--url https://public.api.serval.com/v2/entity-types/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://public.api.serval.com/v2/entity-types/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://public.api.serval.com/v2/entity-types/{id}', 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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://public.api.serval.com/v2/entity-types/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://public.api.serval.com/v2/entity-types/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://public.api.serval.com/v2/entity-types/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
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>"
}
}
