Ancestors
Return the chain of ancestors for one org, ordered root department first down to the immediate parent. Use it to render breadcrumbs ("DEPT OF DEFENSE > DEPT OF THE NAVY > ...") for any organization.
Response
{
"data": [
{ "organization_id": 100000000, "canonical_name": "DEPT OF DEFENSE",
"short_name": "DOD", "type": "DEPARTMENT", "hierarchy_level": 1,
"parent_id": null, "is_active": true, "cgac": "097", "fh_key": "100000000" }
],
"count": 1
}
Example
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://govconapi.com/api/v1/federal-hierarchy/300000188/ancestors"
Errors: 401, 404 (unknown org), 422 (non-integer path), 429.
Note: Order is root → immediate parent. Root organizations return { "data": [], "count": 0 }. Unknown IDs return 404 (this endpoint checks existence first, unlike children which returns an empty list).