Service Level Agreements API
General notes
Enumerators
ServiceLevelAgreementTimeTypeEnum:
This enumerator value is used in fields reaction_time_type and resolution_time_type.
| Name | Type | Value |
|---|---|---|
ONLY_WEEKDAYS | int | 1 |
CLASSIC_HOURS | int | 2 |
Embeddable fields
| Name | Type | Description |
|---|---|---|
sla_category | ServiceLevelAgreementCategory | ServiceLevelAgreementCategory. |
Content
SLA collection:
Single SLA:
Clients collection
SLA Index
GET /api/v0/service-level-agreements
This method needs permission
accessonservice-level-agreements.
Request
| Index behaviour | Definition |
|---|---|
| Paginated by default | No |
| Sorting | id, project_id, reaction_time, reaction_time_type, resolution_time, resolution_time_type, sla_category_id, created_at, updated_at |
| Filters | id:enum, project_id:string, reaction_time:int, reaction_time_type:enum, resolution_time: int, resolution_time_type: enum, sla_category_id: enum, created_at: date, updated_at: date |
| Embedded | - |
GET /api/v0/service-level-agreements HTTP/1.1
Content-Type: application/json
Response
200 OK
GET /api/v0/clients HTTP/1.1
Content-Type: application/json
{
"items": [
{
"id": 10,
"project_id": 1,
"reaction_time": 2,
"reaction_time_type": "2",
"resolution_time": 2,
"resolution_time_type": "2",
"sla_category_id": 5,
"created_at": "2024-01-03T12:39:16+0100",
"updated_at": "2024-01-03T12:39:16+0100",
"_links": [
{
"href": "/api/v0/service-level-agreements/10",
"rel": "self",
"type": "GET"
}
]
}
]
}
Create SLA
CREATE /api/v0/service-level-agreements
This method needs permission
createonservice-level-agreements.
Method for creating SLA data.
Request
| Param | Type | Description | Requirements |
|---|---|---|---|
project_id | int | Project ID | Required. Has to be int. Must be unique pair with sla_category_id. |
sla_category_id | int | Service Level Agreement Category ID | Required. Has to be int. Must be unique pair with project_id. |
reaction_time | int | Reaction time in hours | Nullable. Has to be int. |
reaction_time_type | int | Time type (work hours, classic hours) | Nullable. Max length is 1. Must be a value from ServiceLevelAgreementTimeTypeEnum. |
resolution_time | int | Resolution time in hours | Nullable. Has to be int. |
resolution_time_type | int | Time type (work hours, classic hours) | Nullable. Max length is 1. Must be a value from ServiceLevelAgreementTimeTypeEnum. |
POST /api/v0/service-level-agreements HTTP/1.1
Content-Type: application/json
{
"id": 10,
"project_id": 1,
"reaction_time": 2,
"reaction_time_type": 2,
"resolution_time": 2,
"resolution_time_type": 2,
"sla_category_id": 6
}
Response
200 OK
Created.
422 UNPROCESSABLE ENTITY
Validation error occurred.
Single SLA
SLA detail
GET /api/v0/service-level-agreements/{sla_id}
This method needs permission
readonservice-level-agreements.
Request
| Index behaviour | Definition |
|---|---|
| Embedded | - |
Request
GET /api/v0/service-level-agreements/10 HTTP/1.1
Content-Type: application/json
Response
200 OK
GET /api/v0/service-level-agreements/10 HTTP/1.1
Content-Type: application/json
{
"id": 10,
"project_id": 1,
"reaction_time": 2,
"reaction_time_type": "2",
"resolution_time": 2,
"resolution_time_type": "2",
"sla_category_id": 5,
"created_at": "2024-01-03T12:39:16+0100",
"updated_at": "2024-01-03T12:39:16+0100",
"_links": [
{
"href": "/api/v0/service-level-agreements/10",
"rel": "self",
"type": "GET"
}
]
}
404 NOT FOUND
SLA was not found.
GET /api/v0/service-level-agreements/2 HTTP/1.1
Content-Type: application/json
Status-Code: 404
{
"type": "NotFound",
"message": "Required model was not found.",
"id": "0cd85449-05fe-4866-9802-8192e6785fc7"
}
Update SLA
PUT/PATCH /api/v0/service-level-agreements/{sla_id}
This method needs permission
updateonservice-level-agreements.
Method for updating SLA data.
Request
| Param | Type | Description | Requirements |
|---|---|---|---|
project_id | int | Project ID | Sometimes. Has to be int. Must be unique pair with sla_category_id. |
sla_category_id | int | Service Level Agreement Category ID | Sometimes. Has to be int. Must be unique pair with project_id. |
reaction_time | int | Reaction time in hours | Nullable. Has to be int. |
reaction_time_type | int | Time type (work hours, classic hours) | Nullable. Max length is 1. Must be a value from ServiceLevelAgreementTimeTypeEnum. |
resolution_time | int | Resolution time in hours | Nullable. Has to be int. |
resolution_time_type | int | Time type (work hours, classic hours) | Nullable. Max length is 1. Must be a value from ServiceLevelAgreementTimeTypeEnum. |
For PATCH method any field can be omitted.
PATCH /api/v0/service-level-agreements/1 HTTP/1.1
Content-Type: application/json
{
"reaction_time_type": 1,
"reaction_time": 2
}
Response
200 OK
Successfully updated.
404 NOT FOUND
SLA with this ID not found.
422 UNPROCESSABLE ENTITY
Validation error occurred.
Delete SLA
DELETE /api/v0/service-level-agreements/{sla_id}
This method needs permission
deleteonservice-level-agreements.
Method for deleting SLA.
DELETE /api/v0/service-level-agreements/1 HTTP/1.1
Content-Type: application/json
Response
204 NO CONTENT
Successfully deleted.
404 NOT FOUND
SLA with this ID not found.