Caution
As of 2025-03-11, Grafana OnCall OSS has entered maintenance mode, and will be archived on 2026-03-24. No further feature development will occur; however, we will still provide fixes for critical bugs and for valid CVEs with a CVSS score of 7.0 or higher. For more information, refer to our blog post.
OnCall shifts HTTP API
Create an OnCall shift
Required permission: grafana-oncall-app.schedules:write
curl "{{API_URL}}/api/v1/on_call_shifts/" \
--request POST \
--header "Authorization: meowmeowmeow" \
--header "Content-Type: application/json" \
--data '{
"name": "Demo single event",
"type": "single_event",
"team_id": null,
"time_zone": null,
"level": 0,
"start": "2020-09-10T08:00:00",
"duration": 10800,
"users": [
"U4DNY931HHJS5"
]
}'The above command returns JSON structured in the following way:
{
"id": "OH3V5FYQEYJ6M",
"name": "Demo single event",
"type": "single_event",
"team_id": null,
"time_zone": null,
"level": 0,
"start": "2020-09-10T08:00:00",
"duration": 10800,
"users": ["U4DNY931HHJS5"]
}For more information about recurrence rules, refer to RFC 5545.
HTTP request
POST {{API_URL}}/api/v1/on_call_shifts/
Get OnCall shifts
Required permission: grafana-oncall-app.schedules:read
curl "{{API_URL}}/api/v1/on_call_shifts/OH3V5FYQEYJ6M/" \
--request GET \
--header "Authorization: meowmeowmeow" \
--header "Content-Type: application/json" \The above command returns JSON structured in the following way:
{
"id": "OH3V5FYQEYJ6M",
"name": "Demo single event",
"type": "single_event",
"team_id": null,
"time_zone": null,
"level": 0,
"start": "2020-09-10T08:00:00",
"duration": 10800,
"users": ["U4DNY931HHJS5"]
}HTTP request
GET {{API_URL}}/api/v1/on_call_shifts/<ON_CALL_SHIFT_ID>/
List OnCall shifts
Required permission: grafana-oncall-app.schedules:read
curl "{{API_URL}}/api/v1/on_call_shifts/" \
--request GET \
--header "Authorization: meowmeowmeow" \
--header "Content-Type: application/json"The above command returns JSON structured in the following way:
{
"count": 2,
"next": null,
"previous": null,
"results": [
{
"id": "OH3V5FYQEYJ6M",
"name": "Demo single event",
"type": "single_event",
"team_id": null,
"time_zone": null,
"level": 0,
"start": "2020-09-10T08:00:00",
"duration": 10800,
"users": ["U4DNY931HHJS5"]
},
{
"id": "O9WTH7CKM3KZW",
"name": "Demo recurrent event",
"type": "recurrent_event",
"team_id": null,
"time_zone": null,
"level": 0,
"start": "2020-09-10T16:00:00",
"duration": 10800,
"frequency": "weekly",
"interval": 2,
"week_start": "SU",
"by_day": ["MO", "WE", "FR"],
"by_month": null,
"by_monthday": null,
"users": ["U4DNY931HHJS5"]
}
],
"current_page_number": 1,
"page_size": 50,
"total_pages": 1
}Note: The response is paginated. You may need to make multiple requests to get all records.
The following available filter parameters should be provided as GET arguments:
name(Exact match)schedule_id(Exact match)
HTTP request
GET {{API_URL}}/api/v1/on_call_shifts/
Update OnCall shift
Required permission: grafana-oncall-app.schedules:write
curl "{{API_URL}}/api/v1/on_call_shifts/OH3V5FYQEYJ6M/" \
--request PUT \
--header "Authorization: meowmeowmeow" \
--header "Content-Type: application/json" \
--data '{
"name": "Demo single event",
"type": "single_event",
"level": 0,
"start": "2020-09-10T08:00:00",
"duration": 10800,
"users": [
"U4DNY931HHJS5"
]
}'The above command returns JSON structured in the following way:
{
"id": "OH3V5FYQEYJ6M",
"name": "Demo single event",
"type": "single_event",
"team_id": null,
"time_zone": null,
"level": 0,
"start": "2020-09-10T08:00:00",
"duration": 10800,
"users": ["U4DNY931HHJS5"]
}HTTP request
PUT {{API_URL}}/api/v1/on_call_shifts/<ON_CALL_SHIFT_ID>/
Delete OnCall shift
Required permission: grafana-oncall-app.schedules:write
curl "{{API_URL}}/api/v1/on_call_shifts/OH3V5FYQEYJ6M/" \
--request DELETE \
--header "Authorization: meowmeowmeow" \
--header "Content-Type: application/json"HTTP request
DELETE {{API_URL}}/api/v1/on_call_shifts/<ON_CALL_SHIFT_ID>/



