error "500 internal server" in Request "Preview a Schedule" from calls "Schedules"

I am testing the APIs of Schedules, but in the request call “Preview a Schedule” I am getting the response error 500:Internal Server Error. I have also checked the steps mentioned in the documentation but still not getting any solutions to run the call properly.
Kindly guide me in this matter.
The curl of call

curl --location --request POST ‘
–header 'Authorization: Token token=*********************
–header ‘Accept: application/vnd.pagerduty+json;version=2’
–header ‘Content-Type: application/json’
–header ‘Content-Type: application/json’
–data-raw ‘{
“schedule”: {
“name”: “<name.>?”,
“type”: “schedule”,
“time_zone”: “******",
“description”: null,
“schedule_layers”: [
“name”: “Night Shift”,
“start”: “2015-11-06T20:00:00-05:00”,
“end”: “2016-11-06T20:00:00-05:00”,
“rotation_virtual_start”: “2015-11-06T20:00:00-05:00”,
“rotation_turn_length_seconds”: 86400,
“users”: [
“user”: {
“id”: "
“type”: “user_reference”
“restrictions”: [
“type”: “daily_restriction”,
“start_time_of_day”: “08:00:00”,
“duration_seconds”: 32400


It appears you are looking to preview a schedule that is not on your account. The example provided in the API Explorer is for guidance. You would need to replace the details with those from your PagerDuty account.

I hope that helps.


1 Like