Review API
Preview Deployment Changes
List changes available for promotion between linked workspaces. Use filters and pagination to select resource metadata, or supply 1–20 resource_keys to read selected before and after documents. Both workspace IDs are required on every call. Each call reads current configuration, so changes between pages can change the results. Unchanged context and unsupported deletions cannot be selected for promotion.
POST
/
v2
/
deployments
/
preview-changes
Preview Deployment Changes
curl --request POST \
--url https://public.api.serval.com/v2/deployments/preview-changes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sourceTeamId": "<string>",
"targetTeamId": "<string>",
"filters": {
"resourceTypes": [
"<string>"
],
"operations": [
"<string>"
],
"itemStatuses": [
"<string>"
],
"search": "<string>"
},
"pageSize": 123,
"pageToken": "<string>",
"resourceKeys": [
{
"resourceKind": "<string>",
"scopedId": "<string>"
}
]
}
'import requests
url = "https://public.api.serval.com/v2/deployments/preview-changes"
payload = {
"sourceTeamId": "<string>",
"targetTeamId": "<string>",
"filters": {
"resourceTypes": ["<string>"],
"operations": ["<string>"],
"itemStatuses": ["<string>"],
"search": "<string>"
},
"pageSize": 123,
"pageToken": "<string>",
"resourceKeys": [
{
"resourceKind": "<string>",
"scopedId": "<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({
sourceTeamId: '<string>',
targetTeamId: '<string>',
filters: {
resourceTypes: ['<string>'],
operations: ['<string>'],
itemStatuses: ['<string>'],
search: '<string>'
},
pageSize: 123,
pageToken: '<string>',
resourceKeys: [{resourceKind: '<string>', scopedId: '<string>'}]
})
};
fetch('https://public.api.serval.com/v2/deployments/preview-changes', 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/deployments/preview-changes",
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([
'sourceTeamId' => '<string>',
'targetTeamId' => '<string>',
'filters' => [
'resourceTypes' => [
'<string>'
],
'operations' => [
'<string>'
],
'itemStatuses' => [
'<string>'
],
'search' => '<string>'
],
'pageSize' => 123,
'pageToken' => '<string>',
'resourceKeys' => [
[
'resourceKind' => '<string>',
'scopedId' => '<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/deployments/preview-changes"
payload := strings.NewReader("{\n \"sourceTeamId\": \"<string>\",\n \"targetTeamId\": \"<string>\",\n \"filters\": {\n \"resourceTypes\": [\n \"<string>\"\n ],\n \"operations\": [\n \"<string>\"\n ],\n \"itemStatuses\": [\n \"<string>\"\n ],\n \"search\": \"<string>\"\n },\n \"pageSize\": 123,\n \"pageToken\": \"<string>\",\n \"resourceKeys\": [\n {\n \"resourceKind\": \"<string>\",\n \"scopedId\": \"<string>\"\n }\n ]\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/deployments/preview-changes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sourceTeamId\": \"<string>\",\n \"targetTeamId\": \"<string>\",\n \"filters\": {\n \"resourceTypes\": [\n \"<string>\"\n ],\n \"operations\": [\n \"<string>\"\n ],\n \"itemStatuses\": [\n \"<string>\"\n ],\n \"search\": \"<string>\"\n },\n \"pageSize\": 123,\n \"pageToken\": \"<string>\",\n \"resourceKeys\": [\n {\n \"resourceKind\": \"<string>\",\n \"scopedId\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://public.api.serval.com/v2/deployments/preview-changes")
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 \"sourceTeamId\": \"<string>\",\n \"targetTeamId\": \"<string>\",\n \"filters\": {\n \"resourceTypes\": [\n \"<string>\"\n ],\n \"operations\": [\n \"<string>\"\n ],\n \"itemStatuses\": [\n \"<string>\"\n ],\n \"search\": \"<string>\"\n },\n \"pageSize\": 123,\n \"pageToken\": \"<string>\",\n \"resourceKeys\": [\n {\n \"resourceKind\": \"<string>\",\n \"scopedId\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"key": {
"resourceKind": "<string>",
"scopedId": "<string>"
},
"resourceType": "<string>",
"name": "<string>",
"description": "<string>",
"operation": "<string>",
"itemStatus": "<string>",
"selectable": true,
"unavailableReason": "<string>",
"validationErrorMessage": "<string>",
"configDiagnostics": {
"diagnostics": [
{
"reason": "<string>",
"message": "<string>",
"phase": "PHASE_UNSPECIFIED",
"resource": {
"kind": "<string>",
"resourceId": "<string>",
"scopedId": "<string>",
"name": "<string>",
"fieldPath": "<string>"
},
"guidance": {
"summary": "<string>",
"recovery": "<string>"
}
}
],
"validationCompleteness": "VALIDATION_COMPLETENESS_UNSPECIFIED",
"supportReference": "<string>"
},
"content": {
"contentStatus": "REVIEW_ITEM_CONTENT_STATUS_UNSPECIFIED",
"before": {},
"after": {}
}
}
],
"nextPageToken": "<string>",
"matchingCount": 123
}Authentication and permissions
Token requirements: User-based token (OAuth). 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 | Unsupported |
| Workspace-scoped API key | Unsupported |
| User-based token (OAuth) | Supported, subject to permissions |
- User: workspace comparison: Requires permission to author promotions from the source workspace and stage promotions into the target workspace, with an active link between them. Every comparison and document read checks both permissions.
Authorizations
Body
application/json
Was this page helpful?
⌘I
Preview Deployment Changes
curl --request POST \
--url https://public.api.serval.com/v2/deployments/preview-changes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sourceTeamId": "<string>",
"targetTeamId": "<string>",
"filters": {
"resourceTypes": [
"<string>"
],
"operations": [
"<string>"
],
"itemStatuses": [
"<string>"
],
"search": "<string>"
},
"pageSize": 123,
"pageToken": "<string>",
"resourceKeys": [
{
"resourceKind": "<string>",
"scopedId": "<string>"
}
]
}
'import requests
url = "https://public.api.serval.com/v2/deployments/preview-changes"
payload = {
"sourceTeamId": "<string>",
"targetTeamId": "<string>",
"filters": {
"resourceTypes": ["<string>"],
"operations": ["<string>"],
"itemStatuses": ["<string>"],
"search": "<string>"
},
"pageSize": 123,
"pageToken": "<string>",
"resourceKeys": [
{
"resourceKind": "<string>",
"scopedId": "<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({
sourceTeamId: '<string>',
targetTeamId: '<string>',
filters: {
resourceTypes: ['<string>'],
operations: ['<string>'],
itemStatuses: ['<string>'],
search: '<string>'
},
pageSize: 123,
pageToken: '<string>',
resourceKeys: [{resourceKind: '<string>', scopedId: '<string>'}]
})
};
fetch('https://public.api.serval.com/v2/deployments/preview-changes', 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/deployments/preview-changes",
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([
'sourceTeamId' => '<string>',
'targetTeamId' => '<string>',
'filters' => [
'resourceTypes' => [
'<string>'
],
'operations' => [
'<string>'
],
'itemStatuses' => [
'<string>'
],
'search' => '<string>'
],
'pageSize' => 123,
'pageToken' => '<string>',
'resourceKeys' => [
[
'resourceKind' => '<string>',
'scopedId' => '<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/deployments/preview-changes"
payload := strings.NewReader("{\n \"sourceTeamId\": \"<string>\",\n \"targetTeamId\": \"<string>\",\n \"filters\": {\n \"resourceTypes\": [\n \"<string>\"\n ],\n \"operations\": [\n \"<string>\"\n ],\n \"itemStatuses\": [\n \"<string>\"\n ],\n \"search\": \"<string>\"\n },\n \"pageSize\": 123,\n \"pageToken\": \"<string>\",\n \"resourceKeys\": [\n {\n \"resourceKind\": \"<string>\",\n \"scopedId\": \"<string>\"\n }\n ]\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/deployments/preview-changes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sourceTeamId\": \"<string>\",\n \"targetTeamId\": \"<string>\",\n \"filters\": {\n \"resourceTypes\": [\n \"<string>\"\n ],\n \"operations\": [\n \"<string>\"\n ],\n \"itemStatuses\": [\n \"<string>\"\n ],\n \"search\": \"<string>\"\n },\n \"pageSize\": 123,\n \"pageToken\": \"<string>\",\n \"resourceKeys\": [\n {\n \"resourceKind\": \"<string>\",\n \"scopedId\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://public.api.serval.com/v2/deployments/preview-changes")
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 \"sourceTeamId\": \"<string>\",\n \"targetTeamId\": \"<string>\",\n \"filters\": {\n \"resourceTypes\": [\n \"<string>\"\n ],\n \"operations\": [\n \"<string>\"\n ],\n \"itemStatuses\": [\n \"<string>\"\n ],\n \"search\": \"<string>\"\n },\n \"pageSize\": 123,\n \"pageToken\": \"<string>\",\n \"resourceKeys\": [\n {\n \"resourceKind\": \"<string>\",\n \"scopedId\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"key": {
"resourceKind": "<string>",
"scopedId": "<string>"
},
"resourceType": "<string>",
"name": "<string>",
"description": "<string>",
"operation": "<string>",
"itemStatus": "<string>",
"selectable": true,
"unavailableReason": "<string>",
"validationErrorMessage": "<string>",
"configDiagnostics": {
"diagnostics": [
{
"reason": "<string>",
"message": "<string>",
"phase": "PHASE_UNSPECIFIED",
"resource": {
"kind": "<string>",
"resourceId": "<string>",
"scopedId": "<string>",
"name": "<string>",
"fieldPath": "<string>"
},
"guidance": {
"summary": "<string>",
"recovery": "<string>"
}
}
],
"validationCompleteness": "VALIDATION_COMPLETENESS_UNSPECIFIED",
"supportReference": "<string>"
},
"content": {
"contentStatus": "REVIEW_ITEM_CONTENT_STATUS_UNSPECIFIED",
"before": {},
"after": {}
}
}
],
"nextPageToken": "<string>",
"matchingCount": 123
}
