Teams API methods allow you to programmatically retrieve information about certain teams within DX. This data can also be used in conjunction with the Snapshots API to enrich your results.
API Methods
teams.list
Display a list of all the teams that have been conducted along with some basic data about each one.
Response
Name | Description |
teams.ancestors | Array - List of team ids, refers to all the teams that are above the current team in the hierarchy |
teams.id | ID - The ID of the team itself |
teams.parent_id | ID - The ID of the team's parent team |
teams.manager_id | ID - The user ID of the assigned manager |
teams.name | String - The name of the team |
teams.parent | Boolean - Indicates whether or not the team is a parent team |
teams.last_changed_at | Date - The date and time of the last update to the team |
teams.contributors | Number - The count of contributors on the team |
teams.deleted_at | Date - Indicates if and when the team was deleted |
teams.reference_id | String - An ID that's internal to your organization. We can store this ID during your team importing process (see 'Team tree with ID's). |
Example
curl -X GET 'https://api.getdx.com/teams.list' -H 'Authorization: Bearer <your-token>'
{
"ok": true,
"teams": [
{
"ancestors": [
"LTE",
"MTUxODcx",
"NTA2MTg",
"NTA2MTk",
"NTA4Nzc"
],
"id": "NTA4Nzc",
"parent_id": "NTA2MTk",
"manager_id": "NTEyMDUw",
"name": "Core Data",
"parent": true,
"last_changed_at": "2024-03-19T22:36:47.448Z",
"contributors": 0,
"reference_id": "06BEC4E0-5A61-354E-08A6-C39D756058AB"
},
]
}
teams.get
This endpoint returns the user objects for the lead and contributors of a given team.
Required Arguments
Name | Description |
team_id | String - The ID of the team. Can be retrieved from the teams.list function. Required |
Response
Name | Description |
team.lead | Object - The user object of the person who is assigned as the leader of the team |
team.contributors | Array - The list of user objects of the people assigned as contributors to the team |
Example
curl -X GET 'https://api.getdx.com/teams.get?team_id=<TEAM_ID>' -H 'Authorization: Bearer <your-token>'
{
ok: true,
team: {
lead: {
id: "1234",
name: "Jane Doe",
email: "[email protected]",
avatar: "",
github_username: "",
developer: true,
tz: "",
...
},
contributors: [{...user}, {...user}, {...user}]
}
}
teams.auditTrail
Display the audit trail that can also be found in the app here.
Optional Arguments
Name | Description |
cursor | String - The value necessary for fetching the next page of data. Extracted from any payload on the |
Response
Name | Description |
events | Array - List of all the event objects |
events.id | ID - Id of the change event |
events.actor | String - Email of the user responsible for the change |
events.team | String - Name of team |
events.action | Enum - One of: |
events.metadata | JSON - describes the before and after states of change |
events.created | Unix Timestamp - Date that the change event occurred |
Example
curl --X GET 'https://api.getdx.com/teams.auditTrail?cursor=<CURSOR_VALUE>' -H 'Authorization: Bearer <your-token>'
{
"events": [
{
"id": "MTQxMDb1",
"actor": "[email protected]",
"team": "AI",
"action": "change_name",
"metadata": {
"to": "Artificial Intelligence",
"from": "AI"
},
"created": 1737557847
},
{
"id": "MTM1OTEf",
"actor": "[email protected]",
"team": "Core Data",
"action": "change_manager",
"metadata": {
"to": {
"id": "MTA1MjA2OA",
"name": "Jane Doe",
"email": "[email protected]"
},
"from": {
"id": "NTYzNTgz",
"name": "Martin Lopez",
"email": "[email protected]"
}
},
"created": 1736515821
},
]
}