merge analysis versions
curl --request POST \
--url https://api.example.com/security/analyses/merge \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from_version_id": "<string>",
"to_version_id": "<string>"
}
'import requests
url = "https://api.example.com/security/analyses/merge"
payload = {
"from_version_id": "<string>",
"to_version_id": "<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({from_version_id: '<string>', to_version_id: '<string>'})
};
fetch('https://api.example.com/security/analyses/merge', 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.example.com/security/analyses/merge",
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([
'from_version_id' => '<string>',
'to_version_id' => '<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://api.example.com/security/analyses/merge"
payload := strings.NewReader("{\n \"from_version_id\": \"<string>\",\n \"to_version_id\": \"<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://api.example.com/security/analyses/merge")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"from_version_id\": \"<string>\",\n \"to_version_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/security/analyses/merge")
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 \"from_version_id\": \"<string>\",\n \"to_version_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"user": {
"id": "<string>",
"is_self": true,
"created_at": "2023-11-07T05:31:56Z",
"username": "<string>"
},
"project_id": "<string>",
"project_name": "<string>",
"project_slug": "<string>",
"is_owner": true,
"head": {
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"trigger": "create",
"n_findings": 123,
"n_remediations": 123,
"is_head": true,
"is_leaf": true,
"is_root": true,
"has_pipeline_processing": true,
"has_pipeline_failed": true,
"analysis_meta": {
"id": "<string>",
"name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"user": {
"id": "<string>",
"is_self": true,
"created_at": "2023-11-07T05:31:56Z",
"username": "<string>"
},
"project_id": "<string>",
"project_name": "<string>",
"project_slug": "<string>",
"is_owner": true
},
"code_version": {
"id": "<string>",
"version_method": "tag",
"version_fingerprint": "<string>",
"status": "waiting",
"network": "eth",
"name": "<string>",
"branch": "<string>",
"commit": {
"sha": "<string>",
"author": "<string>",
"message": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
},
"repository": {
"id": 123,
"name": "<string>",
"is_private": true,
"account": {
"id": 123,
"login": "<string>",
"type": "<string>",
"avatar_url": "<string>"
}
}
},
"actions": {
"can_fork": true,
"can_create_child": true,
"can_commit_changes": true,
"can_delete": true,
"can_run_pipeline": true,
"can_retry_pipeline": true,
"can_merge_to": true,
"can_merge_from": true,
"can_stage_changes": true,
"can_set_as_head": true
},
"merged_from_version": {
"id": "<string>",
"analysis_id": "<string>"
},
"forked_from_version": {
"id": "<string>",
"analysis_id": "<string>"
},
"parent_version": {
"id": "<string>",
"analysis_id": "<string>"
},
"child_versions": [
{
"id": "<string>",
"analysis_id": "<string>"
}
],
"merged_versions": [
{
"id": "<string>",
"analysis_id": "<string>"
}
],
"forked_versions": [
{
"id": "<string>",
"analysis_id": "<string>"
}
]
}
}{
"code": "auth.session_expired",
"message": "<string>"
}analysis version
merge analysis versions
merge a version into an existing lineage, resolving a create-time collision
POST
/
security
/
analyses
/
merge
merge analysis versions
curl --request POST \
--url https://api.example.com/security/analyses/merge \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from_version_id": "<string>",
"to_version_id": "<string>"
}
'import requests
url = "https://api.example.com/security/analyses/merge"
payload = {
"from_version_id": "<string>",
"to_version_id": "<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({from_version_id: '<string>', to_version_id: '<string>'})
};
fetch('https://api.example.com/security/analyses/merge', 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.example.com/security/analyses/merge",
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([
'from_version_id' => '<string>',
'to_version_id' => '<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://api.example.com/security/analyses/merge"
payload := strings.NewReader("{\n \"from_version_id\": \"<string>\",\n \"to_version_id\": \"<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://api.example.com/security/analyses/merge")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"from_version_id\": \"<string>\",\n \"to_version_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/security/analyses/merge")
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 \"from_version_id\": \"<string>\",\n \"to_version_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"user": {
"id": "<string>",
"is_self": true,
"created_at": "2023-11-07T05:31:56Z",
"username": "<string>"
},
"project_id": "<string>",
"project_name": "<string>",
"project_slug": "<string>",
"is_owner": true,
"head": {
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"trigger": "create",
"n_findings": 123,
"n_remediations": 123,
"is_head": true,
"is_leaf": true,
"is_root": true,
"has_pipeline_processing": true,
"has_pipeline_failed": true,
"analysis_meta": {
"id": "<string>",
"name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"user": {
"id": "<string>",
"is_self": true,
"created_at": "2023-11-07T05:31:56Z",
"username": "<string>"
},
"project_id": "<string>",
"project_name": "<string>",
"project_slug": "<string>",
"is_owner": true
},
"code_version": {
"id": "<string>",
"version_method": "tag",
"version_fingerprint": "<string>",
"status": "waiting",
"network": "eth",
"name": "<string>",
"branch": "<string>",
"commit": {
"sha": "<string>",
"author": "<string>",
"message": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
},
"repository": {
"id": 123,
"name": "<string>",
"is_private": true,
"account": {
"id": 123,
"login": "<string>",
"type": "<string>",
"avatar_url": "<string>"
}
}
},
"actions": {
"can_fork": true,
"can_create_child": true,
"can_commit_changes": true,
"can_delete": true,
"can_run_pipeline": true,
"can_retry_pipeline": true,
"can_merge_to": true,
"can_merge_from": true,
"can_stage_changes": true,
"can_set_as_head": true
},
"merged_from_version": {
"id": "<string>",
"analysis_id": "<string>"
},
"forked_from_version": {
"id": "<string>",
"analysis_id": "<string>"
},
"parent_version": {
"id": "<string>",
"analysis_id": "<string>"
},
"child_versions": [
{
"id": "<string>",
"analysis_id": "<string>"
}
],
"merged_versions": [
{
"id": "<string>",
"analysis_id": "<string>"
}
],
"forked_versions": [
{
"id": "<string>",
"analysis_id": "<string>"
}
]
}
}{
"code": "auth.session_expired",
"message": "<string>"
}Authorizations
API key in Bearer token format
Response
Successful Response
⌘I
