Delete SLA

Last modified on May 22, 2024

To delete an existing service-level agreement (SLA), send a DELETE request to /slas/{id}, where {id} is the SLA ID.

Request URL



The request must include the Authorization header containing a user’s access token:

Authorization: Bearer ACCESS_TOKEN

See Authentication for more information.

Response body

On success, the operation returns HTTP status 204 without a request body.

Error responses have a non-204 status code and include the errors list:

  "errors": [
      "code": 404,
      "message": "Record not found"

Try it out

Click here to test this operation in AlertSite’s interactive API console.

Code examples

Delete an SLA with ID 1234:


curl -X DELETE -H "Authorization: Bearer ACCESS_TOKEN"


# Python 3.5+
import requests  # Requests library
import json

baseUrl = ''
username = '[email protected]'  # Replace with your AlertSite login email
password = 'pa55w0rd'          # Replace with your AlertSite password
sla_id = 1234

# Log in
payload = {'username': username, 'password': password}
r = + '/access-tokens', data=json.dumps(payload), headers={'Content-Type': 'application/json'})
token = r.json()['access_token']

# Delete SLA
r = requests.delete(baseUrl + '/slas/{}'.format(sla_id), headers={'Authorization': 'Bearer ' + token})
if r.ok:
  print('SLA {} has been deleted.'.format(sla_id))
  print('Could not delete SLA {}. The following error(s) occurred:'.format(sla_id), *r.json()['errors'], sep='\n')

See Also

SLA Operations

Highlight search results