Skip to main content
GET
/
v2
/
repos
/
{id}
Get repository
curl --request GET \
  --url https://api.ghostsecurity.ai/v2/repos/{id} \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.ghostsecurity.ai/v2/repos/{id}"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.ghostsecurity.ai/v2/repos/{id}', 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.ghostsecurity.ai/v2/repos/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

$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.ghostsecurity.ai/v2/repos/{id}"

req, _ := http.NewRequest("GET", url, nil)

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.get("https://api.ghostsecurity.ai/v2/repos/{id}")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.ghostsecurity.ai/v2/repos/{id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "archived": true,
  "cast_scan_enabled": true,
  "clone_url": "<string>",
  "created_at": "<string>",
  "default_branch_name": "<string>",
  "description": "<string>",
  "full_name": "<string>",
  "id": "<string>",
  "installation_id": "<string>",
  "languages": {},
  "last_commit_hash": "<string>",
  "last_commit_hash_link": "<string>",
  "last_committed_at": "<string>",
  "last_scanned_at": "<string>",
  "name": "<string>",
  "organization_id": "<string>",
  "package_findings": 123,
  "private": true,
  "projects": [
    {
      "business_criticality": "<string>",
      "cast_scan_enabled": true,
      "components": [
        {
          "criticality": 123,
          "description": "<string>",
          "folder_name": "<string>",
          "type": "<string>"
        }
      ],
      "created_at": "<string>",
      "dependencies_file": "<string>",
      "deployment_usage": "<string>",
      "deployments": {},
      "enabled": true,
      "evidence": "<string>",
      "exposure": "<string>",
      "file_extensions": [
        "<string>"
      ],
      "findings_count": 123,
      "frameworks": [
        "<string>"
      ],
      "has_custom_metadata": true,
      "id": "<string>",
      "languages": [
        "<string>"
      ],
      "last_committed_at": "<string>",
      "last_scan_id": "<string>",
      "last_scan_status": "<string>",
      "last_scanned_at": "<string>",
      "organization_id": "<string>",
      "owner": "<string>",
      "primary_framework": "<string>",
      "primary_language": "<string>",
      "provider": "<string>",
      "purpose": "<string>",
      "relative_path": "<string>",
      "repo": {
        "id": "<string>",
        "name": "<string>",
        "url": "<string>"
      },
      "scanner_business_criticality": "<string>",
      "scanner_exposure": "<string>",
      "scanner_summary": "<string>",
      "sensitive_data_types": [
        "<string>"
      ],
      "size": 123,
      "summary": "<string>",
      "updated_at": "<string>",
      "user_business_criticality": "<string>",
      "user_exposure": "<string>",
      "user_summary": "<string>"
    }
  ],
  "provider": "<string>",
  "provider_id": "<string>",
  "scan_branch": "<string>",
  "secret_findings": 123,
  "size": 123,
  "summary": "<string>",
  "updated_at": "<string>",
  "url": "<string>"
}
{
"error": "Request error"
}
{
"error": "Request error"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string
required

Repository ID

Response

OK

archived
boolean
cast_scan_enabled
boolean
clone_url
string
created_at
string
default_branch_name
string
description
string
full_name
string
id
string
installation_id
string
languages
object
last_commit_hash
string
last_committed_at
string
last_scanned_at
string
name
string
organization_id
string
package_findings
integer
private
boolean
projects
object[]
provider
string
provider_id
string
scan_branch
string
secret_findings
integer
size
integer
summary
string
updated_at
string
url
string