Entity API
Archive Entity
Archive an entity, hiding it from active browse while keeping its key reserved so the key cannot be reused. Reversible via Unarchive. Distinct from Delete, which is permanent and frees the key. Archived entities are excluded from Search Entities unless include_archived is set.
POST
/
v2
/
entities
/
{id}
/
archive
Archive Entity
curl --request POST \
--url https://public.api.serval.com/v2/entities/{id}/archive \
--header 'Authorization: Bearer <token>'import requests
url = "https://public.api.serval.com/v2/entities/{id}/archive"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://public.api.serval.com/v2/entities/{id}/archive', 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/entities/{id}/archive",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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/entities/{id}/archive"
req, _ := http.NewRequest("POST", 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.post("https://public.api.serval.com/v2/entities/{id}/archive")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://public.api.serval.com/v2/entities/{id}/archive")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"key": "<string>",
"name": "<string>",
"teamId": "<string>",
"entityTypeId": "<string>",
"entityTypeKey": "<string>",
"createdByUserId": "<string>",
"updatedByUserId": "<string>",
"createdAt": "2025-01-15T01:30:15.000Z",
"updatedAt": "2025-01-15T01:30:15.000Z",
"deletedAt": "2025-01-15T01:30:15.000Z",
"archivedAt": "2025-01-15T01:30:15.000Z",
"fieldValues": [
{
"id": "<string>",
"entityId": "<string>",
"fieldId": "<string>",
"fieldKey": "<string>",
"fieldName": "<string>",
"dataType": "DATA_TYPE_UNSPECIFIED",
"value": 123,
"setByUserId": "<string>",
"setByAppInstanceId": "<string>",
"createdAt": "2025-01-15T01:30:15.000Z",
"deletedAt": "2025-01-15T01:30:15.000Z",
"pinned": true,
"redacted": true,
"sensitive": true
}
],
"sourceAppInstanceIds": [
"<string>"
],
"sharedMetadata": {
"sourceTeamId": "<string>",
"sourceTeamName": "<string>"
},
"accessRestricted": true,
"masked": true
},
"pendingChange": {
"id": "<string>",
"entityId": "<string>",
"entityTypeId": "<string>",
"operation": "ENTITY_CHANGE_OPERATION_UNSPECIFIED",
"state": "ENTITY_PENDING_CHANGE_STATE_UNSPECIFIED",
"entityWorkflowRuleIds": [
"<string>"
],
"submittedByUserId": "<string>",
"createdAt": "2025-01-15T01:30:15.000Z",
"fieldChanges": [
{
"fieldId": "<string>",
"beforeJson": "<string>",
"afterJson": "<string>",
"redacted": true,
"pinned": true
}
],
"runs": [
{
"entityWorkflowRuleId": "<string>",
"workflowId": "<string>",
"workflowRunId": "<string>",
"state": "ENTITY_PENDING_CHANGE_RUN_STATE_UNSPECIFIED"
}
],
"reason": "<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:write |
| Team-scoped API key | entities:write |
| User-based token (OAuth) | Supported, subject to permissions |
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The ID of the entity to archive.
Was this page helpful?
⌘I
Archive Entity
curl --request POST \
--url https://public.api.serval.com/v2/entities/{id}/archive \
--header 'Authorization: Bearer <token>'import requests
url = "https://public.api.serval.com/v2/entities/{id}/archive"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://public.api.serval.com/v2/entities/{id}/archive', 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/entities/{id}/archive",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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/entities/{id}/archive"
req, _ := http.NewRequest("POST", 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.post("https://public.api.serval.com/v2/entities/{id}/archive")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://public.api.serval.com/v2/entities/{id}/archive")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"key": "<string>",
"name": "<string>",
"teamId": "<string>",
"entityTypeId": "<string>",
"entityTypeKey": "<string>",
"createdByUserId": "<string>",
"updatedByUserId": "<string>",
"createdAt": "2025-01-15T01:30:15.000Z",
"updatedAt": "2025-01-15T01:30:15.000Z",
"deletedAt": "2025-01-15T01:30:15.000Z",
"archivedAt": "2025-01-15T01:30:15.000Z",
"fieldValues": [
{
"id": "<string>",
"entityId": "<string>",
"fieldId": "<string>",
"fieldKey": "<string>",
"fieldName": "<string>",
"dataType": "DATA_TYPE_UNSPECIFIED",
"value": 123,
"setByUserId": "<string>",
"setByAppInstanceId": "<string>",
"createdAt": "2025-01-15T01:30:15.000Z",
"deletedAt": "2025-01-15T01:30:15.000Z",
"pinned": true,
"redacted": true,
"sensitive": true
}
],
"sourceAppInstanceIds": [
"<string>"
],
"sharedMetadata": {
"sourceTeamId": "<string>",
"sourceTeamName": "<string>"
},
"accessRestricted": true,
"masked": true
},
"pendingChange": {
"id": "<string>",
"entityId": "<string>",
"entityTypeId": "<string>",
"operation": "ENTITY_CHANGE_OPERATION_UNSPECIFIED",
"state": "ENTITY_PENDING_CHANGE_STATE_UNSPECIFIED",
"entityWorkflowRuleIds": [
"<string>"
],
"submittedByUserId": "<string>",
"createdAt": "2025-01-15T01:30:15.000Z",
"fieldChanges": [
{
"fieldId": "<string>",
"beforeJson": "<string>",
"afterJson": "<string>",
"redacted": true,
"pinned": true
}
],
"runs": [
{
"entityWorkflowRuleId": "<string>",
"workflowId": "<string>",
"workflowRunId": "<string>",
"state": "ENTITY_PENDING_CHANGE_RUN_STATE_UNSPECIFIED"
}
],
"reason": "<string>"
}
}
