Skip to content

Commit edf6156

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add documentation for /api/v2/team/sync (#3045)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent a879674 commit edf6156

File tree

16 files changed

+1134
-47
lines changed

16 files changed

+1134
-47
lines changed

.generated-info

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"spec_repo_commit": "b434599",
3-
"generated": "2025-08-13 22:17:12.090"
2+
"spec_repo_commit": "c38287b",
3+
"generated": "2025-08-15 18:54:57.072"
44
}

.generator/schemas/v2/openapi.yaml

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42824,6 +42824,68 @@ components:
4282442824
urgency:
4282542825
$ref: '#/components/schemas/Urgency'
4282642826
type: object
42827+
TeamSyncAttributes:
42828+
description: Team sync attributes.
42829+
properties:
42830+
source:
42831+
$ref: '#/components/schemas/TeamSyncAttributesSource'
42832+
type:
42833+
$ref: '#/components/schemas/TeamSyncAttributesType'
42834+
required:
42835+
- source
42836+
- type
42837+
type: object
42838+
TeamSyncAttributesSource:
42839+
description: The external source platform for team synchronization. Only "github"
42840+
is supported.
42841+
enum:
42842+
- github
42843+
example: github
42844+
type: string
42845+
x-enum-varnames:
42846+
- GITHUB
42847+
TeamSyncAttributesType:
42848+
description: The type of synchronization operation. Only "link" is supported,
42849+
which links existing teams by matching names.
42850+
enum:
42851+
- link
42852+
example: link
42853+
type: string
42854+
x-enum-varnames:
42855+
- LINK
42856+
TeamSyncBulkType:
42857+
description: Team sync bulk type.
42858+
enum:
42859+
- team_sync_bulk
42860+
example: team_sync_bulk
42861+
type: string
42862+
x-enum-varnames:
42863+
- TEAM_SYNC_BULK
42864+
TeamSyncData:
42865+
description: Team sync data.
42866+
properties:
42867+
attributes:
42868+
$ref: '#/components/schemas/TeamSyncAttributes'
42869+
type:
42870+
$ref: '#/components/schemas/TeamSyncBulkType'
42871+
required:
42872+
- attributes
42873+
- type
42874+
type: object
42875+
TeamSyncRequest:
42876+
description: Team sync request.
42877+
example:
42878+
data:
42879+
attributes:
42880+
source: github
42881+
type: link
42882+
type: team_sync_bulk
42883+
properties:
42884+
data:
42885+
$ref: '#/components/schemas/TeamSyncData'
42886+
required:
42887+
- data
42888+
type: object
4282742889
TeamTarget:
4282842890
description: Represents a team target for an escalation policy step, including
4282942891
the team's ID and resource type.
@@ -65913,6 +65975,71 @@ paths:
6591365975
permissions:
6591465976
- teams_read
6591565977
- teams_manage
65978+
/api/v2/team/sync:
65979+
post:
65980+
description: 'This endpoint attempts to link your existing Datadog teams with
65981+
GitHub teams by matching their names.
65982+
65983+
It evaluates all current Datadog teams and compares them against teams in
65984+
the GitHub organization
65985+
65986+
connected to your Datadog account, based on Datadog Team handle and GitHub
65987+
Team slug
65988+
65989+
(lowercased and kebab-cased).
65990+
65991+
65992+
This operation is read-only on the GitHub side, no teams will be modified
65993+
or created.
65994+
65995+
65996+
[A GitHub organization must be connected to your Datadog account](https://docs.datadoghq.com/integrations/github/),
65997+
65998+
and the GitHub App integrated with Datadog must have the `Members Read` permission.
65999+
Matching is performed by comparing the Datadog team handle to the GitHub team
66000+
slug
66001+
66002+
using a normalized exact match; case is ignored and spaces are removed. No
66003+
modifications are made
66004+
66005+
to teams in GitHub. This will not create new Teams in Datadog.'
66006+
operationId: SyncTeams
66007+
requestBody:
66008+
content:
66009+
application/json:
66010+
schema:
66011+
$ref: '#/components/schemas/TeamSyncRequest'
66012+
required: true
66013+
responses:
66014+
'200':
66015+
description: OK
66016+
'403':
66017+
$ref: '#/components/responses/ForbiddenResponse'
66018+
'429':
66019+
$ref: '#/components/responses/TooManyRequestsResponse'
66020+
'500':
66021+
content:
66022+
application/json:
66023+
schema:
66024+
$ref: '#/components/schemas/APIErrorResponse'
66025+
description: Internal Server Error - Unexpected error during linking.
66026+
security:
66027+
- apiKeyAuth: []
66028+
appKeyAuth: []
66029+
- AuthZ:
66030+
- teams_manage
66031+
summary: Link Teams with GitHub Teams
66032+
tags:
66033+
- Teams
66034+
x-codegen-request-body-name: body
66035+
x-permission:
66036+
operator: AND
66037+
permissions:
66038+
- teams_manage
66039+
x-unstable: '**Note**: This endpoint is in Preview. To request access, fill
66040+
out this [form](https://www.datadoghq.com/product-preview/github-integration-for-teams/).
66041+
66042+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
6591666043
/api/v2/team/{super_team_id}/member_teams:
6591766044
get:
6591866045
description: Get all member teams.

examples/v2/teams/SyncTeams.java

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// Link Teams with GitHub Teams returns "OK" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.TeamsApi;
6+
import com.datadog.api.client.v2.model.TeamSyncAttributes;
7+
import com.datadog.api.client.v2.model.TeamSyncAttributesSource;
8+
import com.datadog.api.client.v2.model.TeamSyncAttributesType;
9+
import com.datadog.api.client.v2.model.TeamSyncBulkType;
10+
import com.datadog.api.client.v2.model.TeamSyncData;
11+
import com.datadog.api.client.v2.model.TeamSyncRequest;
12+
13+
public class Example {
14+
public static void main(String[] args) {
15+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
16+
defaultClient.setUnstableOperationEnabled("v2.syncTeams", true);
17+
TeamsApi apiInstance = new TeamsApi(defaultClient);
18+
19+
TeamSyncRequest body =
20+
new TeamSyncRequest()
21+
.data(
22+
new TeamSyncData()
23+
.attributes(
24+
new TeamSyncAttributes()
25+
.source(TeamSyncAttributesSource.GITHUB)
26+
.type(TeamSyncAttributesType.LINK))
27+
.type(TeamSyncBulkType.TEAM_SYNC_BULK));
28+
29+
try {
30+
apiInstance.syncTeams(body);
31+
} catch (ApiException e) {
32+
System.err.println("Exception when calling TeamsApi#syncTeams");
33+
System.err.println("Status code: " + e.getCode());
34+
System.err.println("Reason: " + e.getResponseBody());
35+
System.err.println("Response headers: " + e.getResponseHeaders());
36+
e.printStackTrace();
37+
}
38+
}
39+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// Sync teams returns "OK" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.TeamsApi;
6+
import com.datadog.api.client.v2.model.TeamSyncAttributes;
7+
import com.datadog.api.client.v2.model.TeamSyncAttributesSource;
8+
import com.datadog.api.client.v2.model.TeamSyncAttributesType;
9+
import com.datadog.api.client.v2.model.TeamSyncBulkType;
10+
import com.datadog.api.client.v2.model.TeamSyncData;
11+
import com.datadog.api.client.v2.model.TeamSyncRequest;
12+
13+
public class Example {
14+
public static void main(String[] args) {
15+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
16+
defaultClient.setUnstableOperationEnabled("v2.syncTeams", true);
17+
TeamsApi apiInstance = new TeamsApi(defaultClient);
18+
19+
TeamSyncRequest body =
20+
new TeamSyncRequest()
21+
.data(
22+
new TeamSyncData()
23+
.attributes(
24+
new TeamSyncAttributes()
25+
.source(TeamSyncAttributesSource.GITHUB)
26+
.type(TeamSyncAttributesType.LINK))
27+
.type(TeamSyncBulkType.TEAM_SYNC_BULK));
28+
29+
try {
30+
apiInstance.syncTeams(body);
31+
} catch (ApiException e) {
32+
System.err.println("Exception when calling TeamsApi#syncTeams");
33+
System.err.println("Status code: " + e.getCode());
34+
System.err.println("Reason: " + e.getResponseBody());
35+
System.err.println("Response headers: " + e.getResponseHeaders());
36+
e.printStackTrace();
37+
}
38+
}
39+
}

src/main/java/com/datadog/api/client/ApiClient.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -775,6 +775,7 @@ public class ApiClient {
775775
put("v2.addMemberTeam", false);
776776
put("v2.listMemberTeams", false);
777777
put("v2.removeMemberTeam", false);
778+
put("v2.syncTeams", false);
778779
put("v2.createIncidentTeam", false);
779780
put("v2.deleteIncidentTeam", false);
780781
put("v2.getIncidentTeam", false);

0 commit comments

Comments
 (0)