curl --request POST \
--url https://app.codealive.ai/api/tools/get_artifact_relationships \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"identifier": "<string>",
"max_count_per_type": 123,
"data_source": "<string>"
}
'import requests
url = "https://app.codealive.ai/api/tools/get_artifact_relationships"
payload = {
"identifier": "<string>",
"max_count_per_type": 123,
"data_source": "<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({identifier: '<string>', max_count_per_type: 123, data_source: '<string>'})
};
fetch('https://app.codealive.ai/api/tools/get_artifact_relationships', 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://app.codealive.ai/api/tools/get_artifact_relationships",
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([
'identifier' => '<string>',
'max_count_per_type' => 123,
'data_source' => '<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://app.codealive.ai/api/tools/get_artifact_relationships"
payload := strings.NewReader("{\n \"identifier\": \"<string>\",\n \"max_count_per_type\": 123,\n \"data_source\": \"<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://app.codealive.ai/api/tools/get_artifact_relationships")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"identifier\": \"<string>\",\n \"max_count_per_type\": 123,\n \"data_source\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.codealive.ai/api/tools/get_artifact_relationships")
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 \"identifier\": \"<string>\",\n \"max_count_per_type\": 123,\n \"data_source\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"obj": {
"sourceIdentifier": "<string>",
"profile": "CallsOnly",
"found": true,
"relationships": [
{
"relationType": "OutgoingCalls",
"totalCount": 123,
"returnedCount": 123,
"truncated": true,
"items": [
{
"identifier": "<string>",
"filePath": "<string>",
"startLine": 123,
"shortSummary": "<string>"
}
]
}
],
"availableRelationshipCounts": {
"outgoingCalls": 123,
"incomingCalls": 123,
"ancestors": 123,
"descendants": 123,
"references": 123
},
"warnings": [
{
"code": "<string>",
"message": "<string>",
"alias": "<string>",
"canonical": "<string>"
}
]
},
"rendered": "<string>"
}Get artifact relationships
Traverses the code graph around one known artifact: callers, callees, inheritance, and references. Choose profile by the question: calls_only (default) for call edges of functions and methods, inheritance_only for base types and implementations, references_only for where-used checks on types, fields, events, and other non-call usage, all_relevant for calls plus inheritance. Use it to find upstream entry points and downstream consumers before reading more files.
curl --request POST \
--url https://app.codealive.ai/api/tools/get_artifact_relationships \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"identifier": "<string>",
"max_count_per_type": 123,
"data_source": "<string>"
}
'import requests
url = "https://app.codealive.ai/api/tools/get_artifact_relationships"
payload = {
"identifier": "<string>",
"max_count_per_type": 123,
"data_source": "<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({identifier: '<string>', max_count_per_type: 123, data_source: '<string>'})
};
fetch('https://app.codealive.ai/api/tools/get_artifact_relationships', 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://app.codealive.ai/api/tools/get_artifact_relationships",
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([
'identifier' => '<string>',
'max_count_per_type' => 123,
'data_source' => '<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://app.codealive.ai/api/tools/get_artifact_relationships"
payload := strings.NewReader("{\n \"identifier\": \"<string>\",\n \"max_count_per_type\": 123,\n \"data_source\": \"<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://app.codealive.ai/api/tools/get_artifact_relationships")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"identifier\": \"<string>\",\n \"max_count_per_type\": 123,\n \"data_source\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.codealive.ai/api/tools/get_artifact_relationships")
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 \"identifier\": \"<string>\",\n \"max_count_per_type\": 123,\n \"data_source\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"obj": {
"sourceIdentifier": "<string>",
"profile": "CallsOnly",
"found": true,
"relationships": [
{
"relationType": "OutgoingCalls",
"totalCount": 123,
"returnedCount": 123,
"truncated": true,
"items": [
{
"identifier": "<string>",
"filePath": "<string>",
"startLine": 123,
"shortSummary": "<string>"
}
]
}
],
"availableRelationshipCounts": {
"outgoingCalls": 123,
"incomingCalls": 123,
"ancestors": 123,
"descendants": 123,
"references": 123
},
"warnings": [
{
"code": "<string>",
"message": "<string>",
"alias": "<string>",
"canonical": "<string>"
}
]
},
"rendered": "<string>"
}Authorizations
API Key authentication using Bearer token. Example: "Authorization: Bearer {apiKey}"
Body
Full artifact identifier from a previous search, fetch, or relationship result.
Optional success projection. Omit to return both obj and rendered; use json for obj only; use agentic for rendered text only. Repairable errors always return both obj.error and rendered.
json, agentic Relationship profile. Default is calls_only.
calls_only, inheritance_only, all_relevant, references_only Maximum relationships to return per relationship type. Default is 50.
Optional repository or workspace name/id used to disambiguate the identifier.
Response
Success envelope. obj describes the traversal: sourceIdentifier, profile, found, relationships[] grouped by relationType with items[] (identifier, filePath, startLine, shortSummary) and truncation flags, plus availableRelationshipCounts; rendered is the JSON-serialized form of obj. Repairable failures (missing or invalid arguments, ambiguous or unknown data sources) also return HTTP 200 with obj.error = { code, message, retry, try } and a rendered <tool_error> block; repair the arguments and retry.
Was this page helpful?