---
title: "The ancestors of a specified weakness, sampling by the view"
method: GET
path: "/cwe/{id}/ancestors"
tags: ["CWE"]
---

# The ancestors of a specified weakness, sampling by the view

`GET /cwe/{id}/ancestors`

## Path parameters

- `id` string, required

## Query parameters

- `view` string
- `primary` boolean

## Response `200`

success

- Ancestors
  - `Data` Node
    - `Type` string, required
    - `ID` string, integer, required
    - `ViewID` string, integer, required
    - `Primary_Parent` boolean
  - `Parents` Ancestors[]

## Other responses

- `404` — CWE relationship data not found
- `500` — An Internal Server Error occurred

## Changes

- **2024-08-25** `655593db0510` — 1 breaking, 2 info
  - the response's body type changed from `array` to `object` for status `200`
  - added the optional property `Data` to the response with the `200` status
  - added the optional property `Parents` to the response with the `200` status
- **2024-07-24** `6060dc2f2558` — 2 warning
  - removed the optional property `items/items/Data` from the response with the `200` status
  - removed the optional property `items/items/Parents` from the response with the `200` status
- **2024-07-22** `dd1a325c0302` — 1 breaking, 2 warning
  - the response's body type changed from `object` to `array` for status `200`
  - removed the optional property `Data` from the response with the `200` status
  - removed the optional property `Parents` from the response with the `200` status

[Change history](https://skmtc.dev/cwe-capec/apis/cwe-capec-api-1-0/changes/cwe/:id/ancestors/get.md)

---

[API](https://skmtc.dev/cwe-capec/apis/cwe-capec-api-1-0.md) · [All operations](https://skmtc.dev/cwe-capec/apis/cwe-capec-api-1-0/llms.txt) · [OpenAPI document](https://skmtc.dev/cwe-capec/apis/cwe-capec-api-1-0/revisions/f34b6370e957?raw)
