---
title: <POST> Supply Chain Lineage Check API
slug: lesspostgreater-supply-chain-lineage-check-api
docTags: 
createdAt: 2024-07-22T04:33:55.390Z
---

The **Supply Chain Lineage Check API&#x20;**&#x20;helps users determine whether a given **GitHub, Hugging Face, or S3 bucket repository&#x20;**&#x20;has already been scanned. By providing the repository type and URL, users can verify its scan history, avoiding redundant security assessments and optimizing workflow efficiency.&#x20;

**The following parameters are used for supply chain Lineage Check API.&#x20;**&#x20;To learn more about different input parameters and how to use the API, refer to [AI/ML Supply Chain](docId\:Xso05kOq-um_Byw47J0UB)  documentation.&#x20;



:::ApiMethodV2
```json
{
  "tab": "examples",
  "url": "https://api.aws.boschaishield.com/prod/api/ais/v1.5/developer/lineage_check",
  "name": "Supply Chain Lineage Check API",
  "method": "POST",
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [
      {
        "kind": "required",
        "name": "x-api-key",
        "type": "string",
        "children": [],
        "description": "Enter your API key"
      },
      {
        "kind": "required",
        "name": "Org-Id",
        "type": "string",
        "description": "Enter your organization id",
        "": "Org-Id"
      }
    ],
    "bodyDataParameters": [
      {
        "name": "repo_type",
        "kind": "required",
        "type": "string",
        "description": "The repository that needs to be scanned, such as github, huggingface and s3_bucket. ",
        "": "The repository that needs to be scanned, such as github, huggingface and s3_bucket. "
      },
      {
        "name": "repo_url",
        "kind": "optional",
        "type": "string",
        "description": "The URL of the repository  that needs to be scanned. \n",
        "": "The URL of the repository  that needs to be scanned. \n"
      },
      {
        "name": "branch_name",
        "kind": "optional",
        "type": "string",
        "description": "The branch of the repository to be scanned. Default is 'main' branch.",
        "": "The branch of the repository to be scanned. Default is 'main' branch."
      },
      {
        "name": "depth",
        "kind": "optional",
        "type": "integer",
        "description": "The depth of commits to scan from the repository. Default is 1, which clones only the latest commit.",
        "": "integer"
      },
      {
        "name": "aws_access_key_id",
        "kind": "optional",
        "type": "string",
        "description": "When repo_type is set to \"s3_bucket\", this parameter is mandatory.",
        "": "When repo_type is set to \"s3_bucket\", this parameter is mandatory."
      },
      {
        "name": "aws_secret_access_key",
        "kind": "optional",
        "type": "string",
        "description": "When repo_type is set to \"s3_bucket\", this parameter is mandatory.",
        "": "When repo_type is set to \"s3_bucket\", this parameter is mandatory."
      },
      {
        "name": "region",
        "kind": "optional",
        "type": "string",
        "description": "When repo_type is set to \"s3_bucket\", this parameter is mandatory.  Povide region where s3_bucket is present. ",
        "": "When repo_type is set to \"s3_bucket\", this parameter is mandatory.  Povide region where s3_bucket is present. "
      },
      {
        "name": "bucket_name",
        "kind": "optional",
        "type": "string",
        "description": "When repo_type is set to \"s3_bucket\", this parameter is mandatory.  Provid the bucket name which need to be scanned. ",
        "": "When repo_type is set to \"s3_bucket\", this parameter is mandatory.  Provid the bucket name which need to be scanned. "
      }
    ],
    "formDataParameters": []
  },
  "results": {
    "languages": [
      {
        "id": "DL4HDcclTH6dUtOu-opbD",
        "code": "// 200 OK: retuns dictionar which will contains the details of lineage details if found else empty.\n\n{\n  \"BranchName\": \"xxxxx\",\n  \"CommitID\": \"xxxxx\",\n  \"CreatedTimestamp\": \"xxxxx\",\n  \"Depth\": \"xxxxx\",\n  \"HashedJobID\": \"xxxxx\",\n  \"ModelID\": \"xxxxx\",\n  \"OrgID\": \"xxxxx\",\n  \"RepoType\": \"huggingface\",\n  \"RepoURL\": \"https://huggingface.co/achilles1313/test_gguf\",\n  \"SupplyChain_VulDetected\": 1\n} ",
        "language": "200",
        "customLabel": ""
      },
      {
        "id": "z5dS_OPIMHsxFEwrtKnkw",
        "language": "401",
        "code": "// 401 Unauthorized: Returns an error message if the provided API key or Org-ID is invalid or expired.",
        "customLabel": ""
      },
      {
        "id": "xJHL9zR5wAZ30f4gu2BUz",
        "language": "400",
        "code": "// 400 Bad request Error: Returns an error message if the application cannot or will not process the request due to something that is perceived to be a client error (for example, malformed request syntax, invalid request message framing, etc.)",
        "customLabel": ""
      },
      {
        "id": "eXy7xHvpQ-HT16gZp2CNA",
        "language": "412",
        "code": "// 412 precondition failed: Returns an error message if access to the target resource has been denied. (For example- if any of the parameter value is incorrect or license has expired)",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "DL4HDcclTH6dUtOu-opbD"
  },
  "examples": {
    "languages": [
      {
        "id": "t7-_cakecu--8GrYZbp4x",
        "language": "python",
        "code": "import requests\n\nurl = \"https://api.aws.boschaishield.com/prod/api/ais/v1.5/developer/lineage_check\"\n\npayload = \"{\\\"repo_type\\\":\\\"String\\\",\\\"repo_url\\\":\\\"String\\\",\\\"branch_name\\\":\\\"String\\\",\\\"depth\\\":\\\"Number\\\",\\\"aws_access_key_id\\\":\\\"String\\\",\\\"aws_secret_access_key\\\":\\\"String\\\",\\\"region\\\":\\\"String\\\",\\\"bucket_name\\\":\\\"String\\\"}\"\nheaders = {\n   'x-api-key': 'string',\n   'Org-Id': 'string'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n",
        "customLabel": ""
      },
      {
        "id": "1lTWvexG3MCRC17xAxNYM",
        "language": "curl",
        "code": "curl --location 'https://api.aws.boschaishield.com/prod/api/ais/v1.5/developer/lineage_check' \\\n--header 'x-api-key: string' \\\n--header 'Org-Id: string' \\\n--data '{\"repo_type\":\"String\",\"repo_url\":\"String\",\"branch_name\":\"String\",\"depth\":\"Number\",\"aws_access_key_id\":\"String\",\"aws_secret_access_key\":\"String\",\"region\":\"String\",\"bucket_name\":\"String\"}'",
        "customLabel": ""
      },
      {
        "id": "UtN4X5XIV3PSAEnOdxY4X",
        "language": "nodejs",
        "code": "var request = require('request');\nvar options = {\n   'method': 'POST',\n   'url': 'https://api.aws.boschaishield.com/prod/api/ais/v1.5/developer/lineage_check',\n   'headers': {\n      'x-api-key': 'string',\n      'Org-Id': 'string'\n   },\n   body: '{\"repo_type\":\"String\",\"repo_url\":\"String\",\"branch_name\":\"String\",\"depth\":\"Number\",\"aws_access_key_id\":\"String\",\"aws_secret_access_key\":\"String\",\"region\":\"String\",\"bucket_name\":\"String\"}'\n\n};\nrequest(options, function (error, response) {\n   if (error) throw new Error(error);\n   console.log(response.body);\n});\n",
        "customLabel": ""
      },
      {
        "id": "PxD52o8vC6LwamA5VrWfZ",
        "language": "javascript",
        "code": "var myHeaders = new Headers();\nmyHeaders.append(\"x-api-key\", \"string\");\nmyHeaders.append(\"Org-Id\", \"string\");\n\nvar raw = \"{\\\"repo_type\\\":\\\"String\\\",\\\"repo_url\\\":\\\"String\\\",\\\"branch_name\\\":\\\"String\\\",\\\"depth\\\":\\\"Number\\\",\\\"aws_access_key_id\\\":\\\"String\\\",\\\"aws_secret_access_key\\\":\\\"String\\\",\\\"region\\\":\\\"String\\\",\\\"bucket_name\\\":\\\"String\\\"}\";\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.aws.boschaishield.com/prod/api/ais/v1.5/developer/lineage_check\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));",
        "customLabel": ""
      },
      {
        "id": "OgFEtuMs8cg-eKHf3iqRa",
        "language": "ruby",
        "code": "require \"uri\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.aws.boschaishield.com/prod/api/ais/v1.5/developer/lineage_check\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"x-api-key\"] = \"string\"\nrequest[\"Org-Id\"] = \"string\"\nrequest.body = \"{\\\"repo_type\\\":\\\"String\\\",\\\"repo_url\\\":\\\"String\\\",\\\"branch_name\\\":\\\"String\\\",\\\"depth\\\":\\\"Number\\\",\\\"aws_access_key_id\\\":\\\"String\\\",\\\"aws_secret_access_key\\\":\\\"String\\\",\\\"region\\\":\\\"String\\\",\\\"bucket_name\\\":\\\"String\\\"}\"\n\nresponse = https.request(request)\nputs response.read_body\n",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "t7-_cakecu--8GrYZbp4x"
  },
  "description": "The Supply Chain Lineage Check API verifies if a given GitHub, Hugging Face, or S3 repository has already been scanned for security assessment.",
  "currentNewParameter": {
    "label": "Body Parameter",
    "value": "bodyDataParameters"
  },
  "hasTryItOut": true
}
```
:::

