Overview
The SLA API provides a set of endpoints to manage your Service Level Agreement (SLA) definitions and retrieve SLA metrics to ensure your web services' compliance, availability, and performance against business requirements.
Use cases
Use the SLA API to:
- Manage SLAs and their configuration — create, update, and delete SLAs, and access SLA metrics (SLA targets, uptime commitments, and others).
- Track your website or web services status and performance — monitor real-time SLA status to identify errors, slow load times, and other performance issues.
Prerequisites
Before using the SLA API, make sure you have:
- Uptrends API credentials
- Understanding of your SLA requirements and monitor configuration.
SLA API fields
When working with the SLA API endpoints, the SLA object contains various API fields:
Field name | Description |
---|---|
SlaGuid |
The unique identifier of the SLA. |
Hash |
The hash value corresponding to the SLA. |
Description |
The name of the SLA. |
UptimeErrorThreshold |
The minimum uptime percentage required to avoid errors. If the SLA uptime falls below this set value and fails to meet the SLA target, an error shows in the | .
UptimeWarningThreshold |
The minimum uptime percentage required to avoid warnings. If the SLA uptime falls below this value, but stays above the error threshold, warnings show in the | .
LoadTimeErrorThreshold |
The maximum page load time to not show errors. |
OperatorReponseTimeThreshold |
The time interval between the operator receiving an Uptrends alert notification and confirming the aler.
|
For planned downtime or maintenance, use the following SLA exclusion period API fields:
| ExclusionPeriodId
| The unique identifier of the exclusion period. |
| Hash
| The hash value corresponding to the exclusion period. |
| Description
| The name of the exclusion period. |
| From
| The date and time stamp of when the exclusion period starts. |
| Until
| The date and time stamp of when the exclusion period ends. |
SLA API endpoints
The SLA API provides the following endpoints for managing SLA definitions:
Manage SLAs
Method | Endpoint | Description |
---|---|---|
GET |
/Sla |
Retrieve a list of all SLA definitions and their configuration. |
POST |
/Sla |
Create a new SLA using the given configuration. |
GET |
/Sla/{slaGuid} |
Retrieve an SLA and its configuration by SLA GUID. |
PUT |
/Sla/{slaGuid} |
Update all fields of the SLA definition. |
PATCH |
/Sla/{slaGuid} |
Update selected fields of an SLA definition. |
DELETE |
/Sla/{slaGuid} |
Remove the specified SLA from your account. |
Manage SLA exclusion periods
Method | Endpoint | Description |
---|---|---|
GET |
/Sla/{slaGuid}/ExclusionPeriod |
Retrieve a list of all exclusion periods for the specified SLA. |
POST |
/Sla/{slaGuid}/ExclusionPeriod |
Create an exclusion period for the specified SLA using the given configuration. |
GET |
/Sla/{slaGuid}/ExclusionPeriod/{exclusionPeriodId} |
Retrieve the exclusion period for the specified SLA. |
PUT |
/Sla/{slaGuid}/ExclusionPeriod/{exclusionPeriodId} |
Update an exclusion period for the specified SLA. |
PATCH |
/Sla/{slaGuid}/ExclusionPeriod/{exclusionPeriodId} |
Update selected fields of an exclusion period for the specified SLA. |
DELETE |
/Sla/{slaGuid}/ExclusionPeriod/{exclusionPeriodId} |
Remove the specified exclusion period from the specified SLA. |
For detailed request and response formats and interactive API testing, refer to the Uptrends SLA API documentation.
Troubleshooting
This section covers common HTTP errors and troubleshooting steps for the SLA API.
Common errors
Common HTTP status codes and their descriptions:
Status Code | Description |
---|---|
200 | OK — request successful. |
204 | No content — the request completed successfully and no response was returned. This is for DELETE , PUT , PATCH , and POST requests. |
400 | Bad request — invalid request parameters or missing required fields. |
401 | Unauthorized — invalid or missing authentication credentials. |
403 | Forbidden — one or more validation errors occurred. This may be related to account permissions. |
404 | Not Found — the specified SLA or exclusion period does not exist. |
409 | Conflict — the SLA name already exists or other conflict. |
500 | Internal Server Error — a server-side error occurred. |
General troubleshooting guide
Ensure that you:
- Always validate your request data before sending API calls.
- Use appropriate HTTP methods for each operation.
For further assistance, please reach out to our Support team.
Related articles
For more details, refer to the following articles:
- Uptrends SLA API documentation — an interactive API documentation with detailed endpoint specifications.
- API changelog - for latest API updates and deprecation notices.