grafana/docs/sources/http_api/external_group_sync.md
Ieva 9ac4843df1
Documentation for teams with FGAC (#45321)
* docs for teams with FGAC

* Update docs/sources/enterprise/access-control/fine-grained-access-control-references.md

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
2022-02-11 18:00:13 +01:00

2.9 KiB

+++ title = "External Group Sync HTTP API " description = "Grafana External Group Sync HTTP API" keywords = ["grafana", "http", "documentation", "api", "team", "teams", "group", "member", "enterprise"] aliases = ["/docs/grafana/latest/http_api/external_group_sync/"] +++

External Group Synchronization API

External Group Synchronization is only available in Grafana Enterprise. Read more about [Grafana Enterprise]({{< relref "../enterprise" >}}).

If you have [Fine-grained access control]({{< relref "../enterprise/access-control/_index.md" >}}) enabled, access to endpoints will be controlled by Fine-grained access control permissions. Refer to specific endpoints to understand what permissions are required.

Get External Groups

GET /api/teams/:teamId/groups

Required permissions

See note in the [introduction]({{< ref "#team-api" >}}) 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: Basic YWRtaW46YWRtaW4=

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:

  • 200 - Ok
  • 401 - Unauthorized
  • 403 - Permission denied

Add External Group

POST /api/teams/:teamId/groups

Required permissions

See note in the [introduction]({{< ref "#team-api" >}}) for an explanation.

Action Scope
teams.permissions:write teams:*

Example Request:

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/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

Required permissions

See note in the [introduction]({{< ref "#team-api" >}}) for an explanation.

Action Scope
teams.permissions:write teams:*

Example Request:

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/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