Grafana OnCall teams HTTP API
Get a team
Required permission: grafana-irm-app.user-settings:read
This endpoint retrieves the team object.
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:
{
"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>/
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.
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:
{
"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>/
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.