docs/sources/developer-resources/api-reference/http-api/api-legacy/team_sync.md
{{< docs/shared lookup="developers/deprecated-apis.md" source="grafana" version="<GRAFANA_VERSION>" >}}
Team Sync is only available in Grafana Enterprise. Read more about Grafana Enterprise.
If you are running Grafana Enterprise, for some endpoints you'll need to have specific permissions. Refer to Role-based access control permissions for more information.
GET /api/teams/:teamId/groups
Required permissions
See note in the introduction for an explanation.
| Action | Scope |
|---|---|
| teams.permissions:read | teams:* |
Example Request:
GET /api/teams/1/groups HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer glsa_iNValIdinValiDinvalidinvalidinva_5b582697
Example Response:
HTTP/1.1 200
Content-Type: application/json
[
{
"orgId": 1,
"teamId": 1,
"groupId": "cn=editors,ou=groups,dc=grafana,dc=org"
}
]
Status Codes:
POST /api/teams/:teamId/groups
Required permissions
See note in the introduction for an explanation.
| Action | Scope |
|---|---|
| teams.permissions:write | teams:* |
Example Request:
POST /api/teams/1/groups HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer YWRtaW46YWRtaW4=
{
"groupId": "cn=editors,ou=groups,dc=grafana,dc=org"
}
Example Response:
HTTP/1.1 200
Content-Type: application/json
{"message":"Group added to Team"}
Status Codes:
DELETE /api/teams/:teamId/groups?groupId=external-group-id
Required permissions
See note in the introduction for an explanation.
| Action | Scope |
|---|---|
| teams.permissions:write | teams:* |
Example Request:
DELETE /api/teams/1/groups?groupId=cn%3Deditors%2Cou%3Dgroups%2Cdc%3Dgrafana%2Cdc%3Dorg HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer glsa_iNValIdinValiDinvalidinvalidinva_5b582697
Example Response:
HTTP/1.1 200
Content-Type: application/json
{"message":"Team Group removed"}
Status Codes:
GET /api/teams/:teamId/groups/search
Search for team groups with pagination support.
Required permissions
| Action | Scope |
|---|---|
| teams.permissions:read | teams:* |
Example Request:
GET /api/teams/1/groups/search?name=editors&query=group&page=1&perpage=10 HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer glsa_iNValIdinValiDinvalidinvalidinva_5b582697
Example Response:
HTTP/1.1 200
Content-Type: application/json
[
{
"totalCount": 1,
"teamGroups": [
{
"orgId": 1,
"teamId": 1,
"groupId": "cn=editors,ou=groups,dc=grafana,dc=org"
}
],
"page": 1,
"perPage": 10
}
]
Status Codes: