Departments¶
Deprecated endpoint
This endpoint is deprecated. Use Organizations for the unified federal hierarchy. This endpoint will be removed in a future version.
Departments are top-level organizations exposed at /api/departments/.
If you need the full organization tree + richer search, see Organizations. For field definitions, see the Organizations Data Dictionary.
Endpoints¶
GET /api/departments/(list)GET /api/departments/{code}/(detail)
Filtering¶
None.
Ordering¶
/api/departments/ does not support ordering=....
Pagination¶
Departments use standard page-number pagination:
page(default 1)limit(max 100)
Response shaping¶
This endpoint supports response shaping via the shape query parameter.
- Leaves:
code,name,abbreviation,description,cgac,website,congressional_justification - No expansions.
Default shape (no ?shape= param): code,name,abbreviation
# Select specific fields
/api/departments/?shape=code,name
# Extended department info
/api/departments/1400/?shape=code,name,description,website,congressional_justification
SDK examples¶
See also: Full SDK method reference — tango-python methods · tango-node methods.
The SDKs don’t yet expose a first-class list_departments() / listDepartments() method. You can still call the endpoint via the SDK’s internal HTTP helper.
import os
from tango import TangoClient
client = TangoClient(api_key=os.environ["TANGO_API_KEY"])
data = client._get("/api/departments/", params={"page": 1, "limit": 25})
print("count:", data.get("count"))
import { TangoClient } from "@makegov/tango-node";
const client = new TangoClient({ apiKey: process.env.TANGO_API_KEY });
const http = (client as any).http;
const data = await http.get("/api/departments/", { page: 1, limit: 25 });
console.log("count:", data.count);