grafana/docs/sources/developers/http_api/team_sync.md

146 lines
3.0 KiB
Markdown
Raw Normal View History

---
aliases:
- ../../http_api/external_group_sync/
- ./external_group_sync/
canonical: /docs/grafana/latest/developers/http_api/team_sync/
description: Grafana Team Sync HTTP API
keywords:
- grafana
- http
- documentation
- api
- team
- teams
- group
- member
- enterprise
title: Team Sync HTTP API
---
2018-11-01 01:01:30 +08:00
# Team Sync API
2018-11-01 01:01:30 +08:00
> Team Sync is only available in Grafana Enterprise. Read more about [Grafana Enterprise]({{< relref "/docs/grafana/latest/introduction/grafana-enterprise" >}}).
2018-11-01 01:01:30 +08:00
Fix website build errors both for Grafana and content mounted in Grafana Cloud (#64794) * Fix reference to Grafana CLI - Make relref for relative permalink - Use relative path for unambiguous resolution Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Fix alerting relref anchor format Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Avoid ambiguous relref lookups by forcing relative resolution Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Remove reference to non-existent shared page Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Fix links broken in Grafana Cloud using absolute relrefs By resolving the relref absolutely, it refers to the same location regardless of mounted directory. Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Remove trailing slash for bundle independent resolution Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Fix typo Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * For now, avoid Hugo checking cross repository /docs/grafana-cloud link The path is unlikely to change in the short term and this makes CI completely green for now. Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * No need to specify path for in page anchors Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Fix prose Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> --------- Signed-off-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
2023-03-16 01:06:31 +08:00
> If you are running Grafana Enterprise, for some endpoints you'll need to have specific permissions. Refer to [Role-based access control permissions]({{< relref "/docs/grafana/latest/administration/roles-and-permissions/access-control/custom-role-actions-scopes" >}}) for more information.
2018-11-01 01:01:30 +08:00
## Get External Groups
`GET /api/teams/:teamId/groups`
2022-05-21 03:48:52 +08:00
**Required permissions**
2022-05-21 03:48:52 +08:00
See note in the [introduction]({{< ref "#external-group-synchronization-api" >}}) for an explanation.
| Action | Scope |
| ---------------------- | -------- |
| teams.permissions:read | teams:\* |
2018-11-01 01:01:30 +08:00
**Example Request**:
```http
GET /api/teams/1/groups HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Basic YWRtaW46YWRtaW4=
```
**Example Response**:
```http
HTTP/1.1 200
Content-Type: application/json
[
{
"orgId": 1,
"teamId": 1,
"groupId": "cn=editors,ou=groups,dc=grafana,dc=org"
}
]
```
Status Codes:
- **200** - Ok
- **401** - Unauthorized
- **403** - Permission denied
## Add External Group
`POST /api/teams/:teamId/groups`
2022-05-21 03:48:52 +08:00
**Required permissions**
2022-05-21 03:48:52 +08:00
See note in the [introduction]({{< ref "#external-group-synchronization-api" >}}) for an explanation.
| Action | Scope |
| ----------------------- | -------- |
| teams.permissions:write | teams:\* |
2018-11-01 01:01:30 +08:00
**Example Request**:
```http
POST /api/teams/1/members HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Basic YWRtaW46YWRtaW4=
{
"groupId": "cn=editors,ou=groups,dc=grafana,dc=org"
}
```
**Example Response**:
```http
HTTP/1.1 200
Content-Type: application/json
{"message":"Group added to Team"}
```
Status Codes:
- **200** - Ok
- **400** - Group is already added to this team
- **401** - Unauthorized
- **403** - Permission denied
- **404** - Team not found
## Remove External Group
`DELETE /api/teams/:teamId/groups/:groupId`
2022-05-21 03:48:52 +08:00
**Required permissions**
2022-05-21 03:48:52 +08:00
See note in the [introduction]({{< ref "#external-group-synchronization-api" >}}) for an explanation.
| Action | Scope |
| ----------------------- | -------- |
| teams.permissions:write | teams:\* |
2018-11-01 01:01:30 +08:00
**Example Request**:
```http
DELETE /api/teams/1/groups/cn=editors,ou=groups,dc=grafana,dc=org HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Basic YWRtaW46YWRtaW4=
```
**Example Response**:
```http
HTTP/1.1 200
Content-Type: application/json
{"message":"Team Group removed"}
```
Status Codes:
- **200** - Ok
- **401** - Unauthorized
- **403** - Permission denied
- **404** - Team not found/Group not found