orgfiles.teamHierarchy.get
Get your team hierarchy from DX.
Facts
| Method | GET https://api.getdx.com/orgfiles.teamHierarchy.get |
| Required scope | snapshots:admin |
Arguments
| Name | Type | Description |
|---|---|---|
format |
Text |
Set to import to return the teams envelope and field names used by orgfiles.teamHierarchy.preview and orgfiles.teamHierarchy.process. |
Usage info
This API method retrieves your organization’s current team hierarchies from DX. If your teams do not have reference IDs, the response includes null for those reference_id values.
Use format=import to export a hierarchy as the starting point for an API update. This response wraps teams in a teams object and uses contributors for member email addresses. It can include teams without reference IDs so you can assign them as part of the update.
Before sending the payload to preview or process, provide a nonblank, stable reference_id for every team. For each child team, set parent_team_reference_id to its parent’s final reference ID. The preview and process endpoints reject payloads with missing reference IDs.
Requests without format=import retain the legacy response: a bare array that uses members for member email addresses.
Example request
curl -X GET 'https://api.getdx.com/orgfiles.teamHierarchy.get?format=import' \
-H "Content-Type: application/json" \
-H "Authorization: Bearer xxxx-xxxxxxxxx-xxxx"
Example response
{
"teams": [
{
"name": "Team A",
"reference_id": "unique-identifier-a",
"team_lead_email": "team.lead.a@company.com",
"parent_team_reference_id": null,
"parent_team_name": null,
"contributors": []
},
{
"name": "Team B",
"reference_id": "unique-identifier-b",
"team_lead_email": "team.lead.b@company.com",
"parent_team_reference_id": "unique-identifier-a",
"parent_team_name": "Team A",
"contributors": [
"team.member.a@company.com",
"team.member.b@company.com",
"team.member.c@company.com"
]
}
]
}
Errors
This table lists the expected errors that this method could return. However, other errors can be returned in the case where the service is down or other unexpected factors affect processing. Callers should always check the value of the ok param in the response.
| Error | Description |
|---|---|
not_authed |
This error occurs if the API request does not include a valid bearer token for authentication. |
invalid_auth |
The provided bearer token is invalid. This can happen if the token is expired or does not exist. |