Compare two dependency snapshots
Submit a selected-input dependency comparison as one asynchronous job. Send a string request JSON control and raw base_files[]/head_files[] parts. All v1 controls are required; unknown fields, query controls and repeated controls are rejected. Each side explicitly declares supplied (one or more files) or empty (no files); empty/empty is valid. Duplicate paths within one side are invalid; the same path across sides is valid. Preserve project-relative paths. The aggregate pair is limited to 256 files; each file to 5,242,880 bytes and each UTF-8 path to 1,024 bytes. The entire wire body including MIME headers and framing must fit 8,000,000 bytes. Two snapshots that fit individually may exceed the paired bound; no evidence is trimmed or chunked. Native group availability and file interpretation remain producer-owned. A module-marker-only package.json is currently unusable and returns a side/path-qualified 422. Accepted paths/digests prove only selected inputs, never repository completeness. No URLs/refs, kind/format, excluded path counts or enforcement policy controls are accepted. The gateway reports one provisional operation. Two monthly analysis units are reserved at admission, charged on success, and released if the analysis fails. Follow the shared status/events/result links; reads and execution retries do not repeat admission. Optional analysis failures retain the core diff as HTTP 200 with explicit partial coverage. Recorded/effective ownership, source-local advisory deltas and recorded repository union remain distinct. Backend direct reviews retain all eligible deduplicated tuples in batches of at most 30, with no total first-30 cap. Changelog links are entry-scoped; truncation and missing coverage do not imply safety or a full-history URL. Scan owns policy and exit enforcement.
curl --request POST \
--url https://api.githits.dev/v1/experimental/dependency-diffs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form 'request={
"schema_version": 1,
"base": {
"state": "supplied"
},
"head": {
"state": "supplied"
},
"selection": {
"groups": [
"all"
],
"unlocked_manifests": "recorded_only"
},
"analysis": {
"advisories": true,
"direct_reviews": true
}
}
;type=text/plain' \
--form 'base_files[]=@example-file;type=application/octet-stream' \
--form 'head_files[]=@example-file;type=application/octet-stream'import requests
url = "https://api.githits.dev/v1/experimental/dependency-diffs"
files = {
"base_files[]": ("example-file", open("example-file", "rb"), "application/octet-stream"),
"head_files[]": ("example-file", open("example-file", "rb"), "application/octet-stream")
}
files["request"] = (None, "{\n \"schema_version\": 1,\n \"base\": {\n \"state\": \"supplied\"\n },\n \"head\": {\n \"state\": \"supplied\"\n },\n \"selection\": {\n \"groups\": [\n \"all\"\n ],\n \"unlocked_manifests\": \"recorded_only\"\n },\n \"analysis\": {\n \"advisories\": true,\n \"direct_reviews\": true\n }\n}\n", "text/plain")
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('request', '{
"schema_version": 1,
"base": {
"state": "supplied"
},
"head": {
"state": "supplied"
},
"selection": {
"groups": [
"all"
],
"unlocked_manifests": "recorded_only"
},
"analysis": {
"advisories": true,
"direct_reviews": true
}
}
');
form.append('base_files[]', '<string>');
form.append('head_files[]', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.githits.dev/v1/experimental/dependency-diffs', 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.githits.dev/v1/experimental/dependency-diffs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"request\"\r\nContent-Type: text/plain\r\n\r\n{\r\n \"schema_version\": 1,\r\n \"base\": {\r\n \"state\": \"supplied\"\r\n },\r\n \"head\": {\r\n \"state\": \"supplied\"\r\n },\r\n \"selection\": {\r\n \"groups\": [\r\n \"all\"\r\n ],\r\n \"unlocked_manifests\": \"recorded_only\"\r\n },\r\n \"analysis\": {\r\n \"advisories\": true,\r\n \"direct_reviews\": true\r\n }\r\n}\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"base_files[]\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"head_files[]\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);
$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.githits.dev/v1/experimental/dependency-diffs"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"request\"\r\nContent-Type: text/plain\r\n\r\n{\r\n \"schema_version\": 1,\r\n \"base\": {\r\n \"state\": \"supplied\"\r\n },\r\n \"head\": {\r\n \"state\": \"supplied\"\r\n },\r\n \"selection\": {\r\n \"groups\": [\r\n \"all\"\r\n ],\r\n \"unlocked_manifests\": \"recorded_only\"\r\n },\r\n \"analysis\": {\r\n \"advisories\": true,\r\n \"direct_reviews\": true\r\n }\r\n}\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"base_files[]\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"head_files[]\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
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://api.githits.dev/v1/experimental/dependency-diffs")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"request\"\r\nContent-Type: text/plain\r\n\r\n{\r\n \"schema_version\": 1,\r\n \"base\": {\r\n \"state\": \"supplied\"\r\n },\r\n \"head\": {\r\n \"state\": \"supplied\"\r\n },\r\n \"selection\": {\r\n \"groups\": [\r\n \"all\"\r\n ],\r\n \"unlocked_manifests\": \"recorded_only\"\r\n },\r\n \"analysis\": {\r\n \"advisories\": true,\r\n \"direct_reviews\": true\r\n }\r\n}\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"base_files[]\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"head_files[]\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.githits.dev/v1/experimental/dependency-diffs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"request\"\r\nContent-Type: text/plain\r\n\r\n{\r\n \"schema_version\": 1,\r\n \"base\": {\r\n \"state\": \"supplied\"\r\n },\r\n \"head\": {\r\n \"state\": \"supplied\"\r\n },\r\n \"selection\": {\r\n \"groups\": [\r\n \"all\"\r\n ],\r\n \"unlocked_manifests\": \"recorded_only\"\r\n },\r\n \"analysis\": {\r\n \"advisories\": true,\r\n \"direct_reviews\": true\r\n }\r\n}\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"base_files[]\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"head_files[]\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"events_url": "/v1/experimental/lockfile-jobs/01900000-0000-7000-8000-000000000001/events",
"expires_at": "2026-10-10T12:00:00Z",
"id": "01900000-0000-7000-8000-000000000001",
"result_url": "/v1/experimental/lockfile-jobs/01900000-0000-7000-8000-000000000001/result",
"state": "queued",
"status_url": "/v1/experimental/lockfile-jobs/01900000-0000-7000-8000-000000000001"
}Authorizations
Headers
Optional caller-defined session ID: one to 64 ASCII letters, digits, underscores or hyphens, preserved exactly. Supply the header at most once. Invalid supplied IDs return 400 INVALID_SESSION_ID; no session is created.
1 - 64^[A-Za-z0-9_-]{1,64}$Body
JSON string conforming to DependencyDiffRequest. All controls required. groups accepts all alone or native group selectors; unlocked_manifests is resolve or recorded_only. No gateway dependency parser or resolver is run.
"{\n \"schema_version\": 1,\n \"base\": {\n \"state\": \"supplied\"\n },\n \"head\": {\n \"state\": \"supplied\"\n },\n \"selection\": {\n \"groups\": [\n \"all\"\n ],\n \"unlocked_manifests\": \"recorded_only\"\n },\n \"analysis\": {\n \"advisories\": true,\n \"direct_reviews\": true\n }\n}\n"
Response
The upload was admitted and queued for asynchronous analysis.
Canonical relative URL for the job's server-sent event stream.
^/v1/experimental/lockfile-jobs/[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}/events$"/v1/experimental/lockfile-jobs/01900000-0000-7000-8000-000000000001/events"
Canonical relative URL for retrieving the completed analysis document.
^/v1/experimental/lockfile-jobs/[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}/result$"/v1/experimental/lockfile-jobs/01900000-0000-7000-8000-000000000001/result"
curl --request POST \
--url https://api.githits.dev/v1/experimental/dependency-diffs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form 'request={
"schema_version": 1,
"base": {
"state": "supplied"
},
"head": {
"state": "supplied"
},
"selection": {
"groups": [
"all"
],
"unlocked_manifests": "recorded_only"
},
"analysis": {
"advisories": true,
"direct_reviews": true
}
}
;type=text/plain' \
--form 'base_files[]=@example-file;type=application/octet-stream' \
--form 'head_files[]=@example-file;type=application/octet-stream'import requests
url = "https://api.githits.dev/v1/experimental/dependency-diffs"
files = {
"base_files[]": ("example-file", open("example-file", "rb"), "application/octet-stream"),
"head_files[]": ("example-file", open("example-file", "rb"), "application/octet-stream")
}
files["request"] = (None, "{\n \"schema_version\": 1,\n \"base\": {\n \"state\": \"supplied\"\n },\n \"head\": {\n \"state\": \"supplied\"\n },\n \"selection\": {\n \"groups\": [\n \"all\"\n ],\n \"unlocked_manifests\": \"recorded_only\"\n },\n \"analysis\": {\n \"advisories\": true,\n \"direct_reviews\": true\n }\n}\n", "text/plain")
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('request', '{
"schema_version": 1,
"base": {
"state": "supplied"
},
"head": {
"state": "supplied"
},
"selection": {
"groups": [
"all"
],
"unlocked_manifests": "recorded_only"
},
"analysis": {
"advisories": true,
"direct_reviews": true
}
}
');
form.append('base_files[]', '<string>');
form.append('head_files[]', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.githits.dev/v1/experimental/dependency-diffs', 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.githits.dev/v1/experimental/dependency-diffs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"request\"\r\nContent-Type: text/plain\r\n\r\n{\r\n \"schema_version\": 1,\r\n \"base\": {\r\n \"state\": \"supplied\"\r\n },\r\n \"head\": {\r\n \"state\": \"supplied\"\r\n },\r\n \"selection\": {\r\n \"groups\": [\r\n \"all\"\r\n ],\r\n \"unlocked_manifests\": \"recorded_only\"\r\n },\r\n \"analysis\": {\r\n \"advisories\": true,\r\n \"direct_reviews\": true\r\n }\r\n}\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"base_files[]\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"head_files[]\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);
$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.githits.dev/v1/experimental/dependency-diffs"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"request\"\r\nContent-Type: text/plain\r\n\r\n{\r\n \"schema_version\": 1,\r\n \"base\": {\r\n \"state\": \"supplied\"\r\n },\r\n \"head\": {\r\n \"state\": \"supplied\"\r\n },\r\n \"selection\": {\r\n \"groups\": [\r\n \"all\"\r\n ],\r\n \"unlocked_manifests\": \"recorded_only\"\r\n },\r\n \"analysis\": {\r\n \"advisories\": true,\r\n \"direct_reviews\": true\r\n }\r\n}\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"base_files[]\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"head_files[]\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
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://api.githits.dev/v1/experimental/dependency-diffs")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"request\"\r\nContent-Type: text/plain\r\n\r\n{\r\n \"schema_version\": 1,\r\n \"base\": {\r\n \"state\": \"supplied\"\r\n },\r\n \"head\": {\r\n \"state\": \"supplied\"\r\n },\r\n \"selection\": {\r\n \"groups\": [\r\n \"all\"\r\n ],\r\n \"unlocked_manifests\": \"recorded_only\"\r\n },\r\n \"analysis\": {\r\n \"advisories\": true,\r\n \"direct_reviews\": true\r\n }\r\n}\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"base_files[]\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"head_files[]\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.githits.dev/v1/experimental/dependency-diffs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"request\"\r\nContent-Type: text/plain\r\n\r\n{\r\n \"schema_version\": 1,\r\n \"base\": {\r\n \"state\": \"supplied\"\r\n },\r\n \"head\": {\r\n \"state\": \"supplied\"\r\n },\r\n \"selection\": {\r\n \"groups\": [\r\n \"all\"\r\n ],\r\n \"unlocked_manifests\": \"recorded_only\"\r\n },\r\n \"analysis\": {\r\n \"advisories\": true,\r\n \"direct_reviews\": true\r\n }\r\n}\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"base_files[]\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"head_files[]\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"events_url": "/v1/experimental/lockfile-jobs/01900000-0000-7000-8000-000000000001/events",
"expires_at": "2026-10-10T12:00:00Z",
"id": "01900000-0000-7000-8000-000000000001",
"result_url": "/v1/experimental/lockfile-jobs/01900000-0000-7000-8000-000000000001/result",
"state": "queued",
"status_url": "/v1/experimental/lockfile-jobs/01900000-0000-7000-8000-000000000001"
}