curl --request GET \
--url https://api.example.com/api/v1/repositories/{repo_id}/context \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.example.com/api/v1/repositories/{repo_id}/context"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.example.com/api/v1/repositories/{repo_id}/context', 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/api/v1/repositories/{repo_id}/context",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$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://api.example.com/api/v1/repositories/{repo_id}/context"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/v1/repositories/{repo_id}/context")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/repositories/{repo_id}/context")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"artifacts": [
{
"artifact_type": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"version": "<string>",
"is_first_party": true
}
],
"dependencies": [
{
"confidence": 123,
"dependency_type": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"raw_reference": "<string>",
"resolved": true,
"source_file": "<string>",
"source_line": 123,
"version_constraint": "<string>",
"dependency_relationship": "<string>",
"target_artifact_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"target_repository_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"target_repository_name": "<string>",
"version_constraint_state": "absent"
}
],
"dependencies_total": 123,
"dependents": [
{
"confidence": 123,
"dependency_type": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"raw_reference": "<string>",
"resolved": true,
"source_file": "<string>",
"source_line": 123,
"version_constraint": "<string>",
"dependency_relationship": "<string>",
"target_artifact_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"target_repository_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"target_repository_name": "<string>",
"version_constraint_state": "absent"
}
],
"dependents_total": 123,
"repository": {
"archived": true,
"clone_url": "<string>",
"connected_org_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"default_branch": "<string>",
"full_path": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_fork": true,
"last_activity_at": "2023-11-07T05:31:56Z",
"last_commit_sha": "<string>",
"last_scanned_at": "2023-11-07T05:31:56Z",
"name": "<string>",
"platform_id": "<string>"
},
"dependent_repositories_total": 0,
"ownership": {
"bus_factor": 123,
"human_author_count": 123,
"top_author_name": "<string>"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}Recommended first hydration call after `/lookup`: repo + capped deps + capped dependents + artifacts in one round-trip.
Return the repo, capped direct dependents/dependencies, and artifacts in one call.
This is the recommended second call for AI coding agents auditing a
repo (after /repositories/lookup resolves the ID). One request
collapses what would otherwise be three or four. The freshness fields on
repository (last_scanned_at, last_activity_at,
last_commit_sha, archived) let the agent decide whether to trust
the data or trigger a rescan.
Direct dependents and dependencies are capped at 100 rows each; the
dependencies_total and dependents_total fields carry the post-dedup
count so the agent knows when to paginate via the dedicated
/dependencies and /dependents endpoints. Both lists are declaration
rows, so a repository used through several actions or packages takes several
dependent rows: dependent_repositories_total is the number of distinct
repositories behind dependents_total. For transitive blast
radius (multi-hop downstream), call /repositories/{id}/impact after
this — it is deliberately not bundled here because not every agent flow
needs it.
curl --request GET \
--url https://api.example.com/api/v1/repositories/{repo_id}/context \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.example.com/api/v1/repositories/{repo_id}/context"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.example.com/api/v1/repositories/{repo_id}/context', 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/api/v1/repositories/{repo_id}/context",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$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://api.example.com/api/v1/repositories/{repo_id}/context"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/v1/repositories/{repo_id}/context")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/repositories/{repo_id}/context")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"artifacts": [
{
"artifact_type": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"version": "<string>",
"is_first_party": true
}
],
"dependencies": [
{
"confidence": 123,
"dependency_type": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"raw_reference": "<string>",
"resolved": true,
"source_file": "<string>",
"source_line": 123,
"version_constraint": "<string>",
"dependency_relationship": "<string>",
"target_artifact_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"target_repository_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"target_repository_name": "<string>",
"version_constraint_state": "absent"
}
],
"dependencies_total": 123,
"dependents": [
{
"confidence": 123,
"dependency_type": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"raw_reference": "<string>",
"resolved": true,
"source_file": "<string>",
"source_line": 123,
"version_constraint": "<string>",
"dependency_relationship": "<string>",
"target_artifact_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"target_repository_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"target_repository_name": "<string>",
"version_constraint_state": "absent"
}
],
"dependents_total": 123,
"repository": {
"archived": true,
"clone_url": "<string>",
"connected_org_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"default_branch": "<string>",
"full_path": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_fork": true,
"last_activity_at": "2023-11-07T05:31:56Z",
"last_commit_sha": "<string>",
"last_scanned_at": "2023-11-07T05:31:56Z",
"name": "<string>",
"platform_id": "<string>"
},
"dependent_repositories_total": 0,
"ownership": {
"bus_factor": 123,
"human_author_count": 123,
"top_author_name": "<string>"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}Authorizations
Headers
Path Parameters
Cookies
Response
Successful Response
Single-call context bundle for AI coding agents.
Combines the repo row (with freshness fields), capped lists of direct
dependents + dependencies, and the artifacts this repo produces. Both lists
hold declaration rows: on dependents the consuming repository is
target_repository_id. For full pagination of dependents/dependencies use
the dedicated endpoints; for transitive blast radius use
/repositories/{id}/impact.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Basic repository record.
Show child attributes
Show child attributes
Slim ownership summary embedded in /repositories/{id}/context.
Tiny by design (spec §8) — the context bundle is capped. Agents call
/repositories/{id}/ownership for the full contributor list.
Show child attributes
Show child attributes
