Grafana Cloud

Grafana OnCall teams HTTP API

Get a team

Required permission: grafana-irm-app.user-settings:read

This endpoint retrieves the team object.

shell
curl "{{API_URL}}/api/v1/teams/TI73TDU19W48J/" \
  --request GET \
  --header "Authorization: Bearer meowmeowmeow" \
  --header "Content-Type: application/json" \
  --header "X-Grafana-URL: https://your-stack.grafana.net"

The above command returns JSON structured in the following way:

JSON
{
  "id": "TI73TDU19W48J",
  "grafana_id": 123,
  "name": "my test team",
  "email": "",
  "avatar_url": "/avatar/3f49c15916554246daa714b9bd0ee398",
  "is_sharing_resources_to_all": true
}

HTTP request

GET {{API_URL}}/api/v1/teams/<TEAM_ID>/

ParameterUniqueDescription
idYes/orgOnCall team ID
grafana_idYes/orgGrafana team ID
nameYes/orgTeam name
emailYes/orgTeam e-mail
avatar_urlYesAvatar URL of the Grafana team
is_sharing_resources_to_allNoWhether this team’s resources are visible to all users (true), or only to team members and admins (false)

Update a team

Required permission: grafana-irm-app.other-settings:write

This endpoint updates a team’s visibility. is_sharing_resources_to_all is the only field that can be updated; it corresponds to the Team Access Management setting in the OnCall UI. All other fields are read-only and are ignored if included in the request.

shell
curl "{{API_URL}}/api/v1/teams/TI73TDU19W48J/" \
  --request PUT \
  --header "Authorization: Bearer meowmeowmeow" \
  --header "Content-Type: application/json" \
  --header "X-Grafana-URL: https://your-stack.grafana.net" \
  --data '{
    "is_sharing_resources_to_all": false
  }'

The above command returns JSON structured in the following way:

JSON
{
  "id": "TI73TDU19W48J",
  "grafana_id": 123,
  "name": "my test team",
  "email": "",
  "avatar_url": "/avatar/3f49c15916554246daa714b9bd0ee398",
  "is_sharing_resources_to_all": false
}

HTTP request

PUT {{API_URL}}/api/v1/teams/<TEAM_ID>/

ParameterRequiredDescription
is_sharing_resources_to_allNoSet to true to make the team’s resources visible to all users, or false to restrict them to team members and admins.

Get current on-call users for a team

Required permission: grafana-irm-app.user-settings:read

Returns the users currently on-call for a team by resolving the team’s direct paging integration. By default, the default route is used. Pass a route query parameter to resolve a specific route instead.