Skip to content

Commit 21b05a6

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add documentation for /api/v2/team/sync (#2611)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 7ef8cc5 commit 21b05a6

File tree

19 files changed

+713
-47
lines changed

19 files changed

+713
-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:16:45.303"
2+
"spec_repo_commit": "c38287b",
3+
"generated": "2025-08-15 18:55:02.903"
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.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"2025-08-15T17:48:19.712Z"
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
{
2+
"log": {
3+
"_recordingName": "Teams/Sync teams returns \"OK\" response",
4+
"creator": {
5+
"comment": "persister:fs",
6+
"name": "Polly.JS",
7+
"version": "6.0.5"
8+
},
9+
"entries": [
10+
{
11+
"_id": "394163072f49be157e109223981e6839",
12+
"_order": 0,
13+
"cache": {},
14+
"request": {
15+
"bodySize": 81,
16+
"cookies": [],
17+
"headers": [
18+
{
19+
"_fromType": "array",
20+
"name": "accept",
21+
"value": "*/*"
22+
},
23+
{
24+
"_fromType": "array",
25+
"name": "content-type",
26+
"value": "application/json"
27+
}
28+
],
29+
"headersSize": 535,
30+
"httpVersion": "HTTP/1.1",
31+
"method": "POST",
32+
"postData": {
33+
"mimeType": "application/json",
34+
"params": [],
35+
"text": "{\"data\":{\"attributes\":{\"source\":\"github\",\"type\":\"link\"},\"type\":\"team_sync_bulk\"}}"
36+
},
37+
"queryString": [],
38+
"url": "https://api.datadoghq.com/api/v2/team/sync"
39+
},
40+
"response": {
41+
"bodySize": 0,
42+
"content": {
43+
"mimeType": "text/plain",
44+
"size": 0
45+
},
46+
"cookies": [],
47+
"headers": [
48+
{
49+
"name": "content-type",
50+
"value": "text/plain"
51+
}
52+
],
53+
"headersSize": 653,
54+
"httpVersion": "HTTP/1.1",
55+
"redirectURL": "",
56+
"status": 200,
57+
"statusText": "OK"
58+
},
59+
"startedDateTime": "2025-08-15T17:48:19.717Z",
60+
"time": 203
61+
}
62+
],
63+
"pages": [],
64+
"version": "1.2"
65+
}
66+
}

examples/v2/teams/SyncTeams.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/**
2+
* Link Teams with GitHub Teams returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.syncTeams"] = true;
9+
const apiInstance = new v2.TeamsApi(configuration);
10+
11+
const params: v2.TeamsApiSyncTeamsRequest = {
12+
body: {
13+
data: {
14+
attributes: {
15+
source: "github",
16+
type: "link",
17+
},
18+
type: "team_sync_bulk",
19+
},
20+
},
21+
};
22+
23+
apiInstance
24+
.syncTeams(params)
25+
.then((data: any) => {
26+
console.log(
27+
"API called successfully. Returned data: " + JSON.stringify(data)
28+
);
29+
})
30+
.catch((error: any) => console.error(error));
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/**
2+
* Sync teams returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.syncTeams"] = true;
9+
const apiInstance = new v2.TeamsApi(configuration);
10+
11+
const params: v2.TeamsApiSyncTeamsRequest = {
12+
body: {
13+
data: {
14+
attributes: {
15+
source: "github",
16+
type: "link",
17+
},
18+
type: "team_sync_bulk",
19+
},
20+
},
21+
};
22+
23+
apiInstance
24+
.syncTeams(params)
25+
.then((data: any) => {
26+
console.log(
27+
"API called successfully. Returned data: " + JSON.stringify(data)
28+
);
29+
})
30+
.catch((error: any) => console.error(error));

features/support/scenarios_model_mapping.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7555,6 +7555,13 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
75557555
},
75567556
"operationResponseType": "TeamResponse",
75577557
},
7558+
"v2.SyncTeams": {
7559+
"body": {
7560+
"type": "TeamSyncRequest",
7561+
"format": "",
7562+
},
7563+
"operationResponseType": "void",
7564+
},
75587565
"v2.ListMemberTeams": {
75597566
"superTeamId": {
75607567
"type": "string",

0 commit comments

Comments
 (0)