Schedule Override API (Deprecated)

πŸ“˜

Create an API Integration and obtain your apiKey to make requests listed below. Please make sure that the integration is not restricted to access configurations.

Add Schedule Override

Creates a schedule override for the specified user and schedule. It takes the following parameters:

Mandatory Parameters

Parameter
apiKeyAPI key is used for authenticating API requests
aliasA user defined identifier for the override. There can be only one override with the same alias for that schedule. Provides ability to assign a known id and later use this id to perform additional actions such as update, get, etc.
scheduleId or name of the schedule.
userThe username of user who will take on call responsibility, or the reserved word none.
startDateThe date and time for override will start
endDateThe date and time override will end

Optional Parameters

Parameter
rotationIdsId list of the rotations that override will apply. When it's set, only specified schedule rotations will be overridden.
timezoneThe timezone of the start and end date and time is specified. If not provided, the schedule's timezone is used. Please look here for available timezones.

Sample Request

curl -XPOST 'https://api.opsgenie.com/v1/json/schedule/override' -d '
{
     "apiKey": "eb243592-faa2-4ba2-a551q-1afdf565c889",
     "alias": "override1",
     "rotationIds": ["29c15643-7351-4337-ad6f-0fd8af8ea6e2", "1a9b4404-331a-4492-8da0-43ec20b7c0cf"]
     "user" : "[email protected]",
     "schedule" : "team1_schedule",
     "startDate" : "2013-01-27 22:00",
     "endDate" : "2013-01-28 08:00",
     "timezone" : "GMT+2"
}'

Response:

{
     "alias" : "override1",
     "status" : "successful",
     "code" : 200
}

Update Schedule Override

Updates a schedule override. It takes the following parameters:

Mandatory Parameters

Parameter
apiKeyAPI key is used for authenticating API requests
aliasA user defined identifier for the override. There can be only one override with the same alias for that schedule. Provides ability to assign a known id and later use this id to perform additional actions such as update, get etc.
scheduleId or name of the schedule.
userThe username of user who will take on call responsibility, or the reserved word none.
startDateThe date and time for override will start.
endDateThe date and time override will end.

Optional Parameters

Parameter
rotationIdsId list of the rotations that override will apply. When it's set, only specified schedule rotations will be overridden.
timezoneThe timezone of the start and end date and time is specified. If not provided, the schedule's timezone is used. Please look here for available timezones.

Sample Request

curl -XPOST 'https://api.opsgenie.com/v1/json/schedule/override' -d '
{
     "apiKey": "eb243592-faa2-4ba2-a551q-1afdf565c889",
     "alias": "override1",
     "rotationIds": ["29c15643-7351-4337-ad6f-0fd8af8ea6e2"]
     "user" : "none",
     "schedule" : "team1_schedule",
     "startDate" : "2013-01-27 22:00",
     "endDate" : "2013-01-28 08:00",
     "timezone" : "GMT+2"
}'

Response:

{
     "alias" : "override1",
     "status" : "successful",
     "code" : 200
}

Delete Schedule Override

Deletes a schedule override. It takes the following parameters:

Mandatory Parameters

Parameter
apiKeyAPI key is used for authenticating API requests
aliasAlias of the schedule override.
scheduleId or name of the schedule that the override belongs to.

Sample Request

curl -XDELETE 'https://api.opsgenie.com/v1/json/schedule/override?apiKey=eb243592-faa2-4ba2-a551q-1afdf565c889&alias=override1&schedule=team1_schedule'

Response:

{
    "status" : "successful",
    "code" : 200
}

Get Schedule Override

πŸ“˜

This is a read request. Therefore, even if the integration of the API key is configured as read-only, the request will be accepted.

Gets schedule override details. It takes the following parameters:

Mandatory Parameters

Parameter
apiKeyAPI key is used for authenticating API requests
aliasAlias of the schedule override/td>
scheduleId or name of the schedule that the override belongs.

Sample Request

curl -XGET 'https://api.opsgenie.com/v1/json/schedule/override?apiKey=eb243592-faa2-4ba2-a551q-1afdf565c889&alias=override1&schedule=team1_schedule'

Response:

{
    "alias": "override1",
    "user" : "[email protected]",
    "rotationIds": ["29c15643-7351-4337-ad6f-0fd8af8ea6e2", "1a9b4404-331a-4492-8da0-43ec20b7c0cf"]
    "startDate" : "2013-01-27 22:00",
    "endDate" : "2013-01-28 08:00",
    "timezone" : "GMT+2"
}

List Schedule Overrides

πŸ“˜

This is a read request. Therefore, even if the integration of the API key is configured as read-only, the request will be accepted.

Gets the list of existing overrides for the specified schedule. It takes the following parameters:

Mandatory Parameters

Parameter
apiKeyAPI key is used for authenticating API requests
scheduleId or name of the schedule.

Sample Request

curl -XGET 'https://api.opsgenie.com/v1/json/schedule/override?apiKey=eb243592-faa2-4ba2-a551q-1afdf565c889&schedule=team1_schedule'

Response:

{
    "overrides" : [
          {
             "alias": "override1",
             "rotationIds": ["29c15643-7351-4337-ad6f-0fd8af8ea6e2", "1a9b4404-331a-4492-8da0-43ec20b7c0cf"]
             "user" : "[email protected]",
             "startDate" : "2013-01-27 22:00",
             "endDate" : "2013-01-28 08:00",
             "timezone" : "GMT+2"
           },
          {
             "alias": "override2",
             "rotationIds": [],
             "user" : "none",
             "startDate" : "2013-01-29 22:00",
             "endDate" : "2013-01-30 08:00",
             "timezone" : "GMT+2"
           }
     ]
}