Service Level Agreements
Resource Fields
| Name | Type | Read-only | Description | 
|---|---|---|---|
| title | string | ||
| description | string | ||
| execution_order | integer | ||
| predicate_collections | Collections | ||
| targets | Target | ||
| is_enabled | boolean | ||
| is_deleted | boolean | ||
| created_at | timestamp | ISO-8601 Format | |
| updated_at | timestamp | ISO-8601 Format | 
Collections
RESOURCE FIELDS
| Name | Type | Mandatory | Description | 
|---|---|---|---|
| propositions | Propositions | 
Propositions
RESOURCE FIELDS
| Name | Type | Mandatory | Description | 
|---|---|---|---|
| field | string | The field should be out of fields given by Definitions resource | |
| operator | string | The operator should also belong to the defined one for a Definitions field | |
| value | mixed | 
Targets
RESOURCE FIELDS
| Name | Type | Mandatory | Description | 
|---|---|---|---|
| priority | Priority | ||
| type | string | FIRST_REPLY_TIME, NEXT_REPLY_TIME, RESOLUTION_TIME | 
|
| goal_in_seconds | integer | ||
| operational_hours | string | BUSINESS_HOURS, CALENDAR_HOURS | 
Metadata
| Version | 1.0 | 
| Last Updated | July 04, 2016 | 
Actions
Retrieve all SLAs
GET /api/v1/slas.jsonInformation
| Allowed for | Admins & Owners | 
| Scope | configuration | 
| Ordered by | updated_at (descending) | 
Response
    {
        "status": 200,
        "data": [
            {
    "id": 2,
    "title": "High priority sales and support tickets",
    "description": null,
    "execution_order": 2,
    "predicate_collections": [
        {
            "id": 4,
            "propositions": [
                {
    "id": 1,
    "resource_type": "sla_proposition"
}
            ],
            "resource_type": "predicate_collection"
        }
    ],
    "targets": [
        {
    "id": 10,
    "resource_type": "sla_target"
}
    ],
    "is_enabled": true,
    "is_deleted": false,
    "created_at": "2015-07-31T05:18:50+05:00",
    "updated_at": "2015-07-31T05:18:50+05:00",
    "resource_type": "sla"
    ,"resource_url": "https://brewfictus.kayako.com/api/v1/slas/2"
}
        ],
        "resource": "sla",
        "offset": 0,
        "limit": 10,
        "total_count": 1
    }
Retrieve an SLA
GET /api/v1/slas/:id.jsonInformation
| Allowed for | Admins & Owners | 
| Scope | configuration | 
Response
    {
        "status": 200,
        "data": {
    "id": 2,
    "title": "High priority sales and support tickets",
    "description": null,
    "execution_order": 2,
    "predicate_collections": [
        {
            "id": 4,
            "propositions": [
                {
    "id": 1,
    "resource_type": "sla_proposition"
}
            ],
            "resource_type": "predicate_collection"
        }
    ],
    "targets": [
        {
    "id": 10,
    "resource_type": "sla_target"
}
    ],
    "is_enabled": true,
    "is_deleted": false,
    "created_at": "2015-07-31T05:18:50+05:00",
    "updated_at": "2015-07-31T05:18:50+05:00",
    "resource_type": "sla"
    ,"resource_url": "https://brewfictus.kayako.com/api/v1/slas/2"
}
,
        "resource": "sla"
    }
Add an SLA
POST /api/v1/slas.jsonInformation
| Allowed for | Admins & Owners | 
| Scope | configuration | 
Parameters
| Name | Type | Mandatory | Description | 
|---|---|---|---|
| title | string | ||
| description | string | ||
| is_enabled | boolean | ||
| predicate_collections[] | array | Fetch the definition at first to get field, operator and available values.  There can be multiple collections and a collection can have multiple propositions. Collections are evaluated with AND operator and Propositions are evaluated with OR operator. Example: [{"propositions":[{"field":"cases.casestatusid", "operator":"comparison_equalto", "value":1}, {"field":"cases.channeltype", "operator":"comparison_equalto", "value":"MAIL"}]}] | 
|
| targets[] | array | Properties that are required to define a target are priority_id, type, goal_in_seconds, operational_hours described as below  priority_id: integer, can be null for No priority target  type: string, FIRST_REPLY_TIME, NEXT_REPLY_TIME, RESOLUTION_TIME  goal_in_seconds: integer operational_hours: string, BUSINESS_HOURS, CALENDAR_HOURS Example: targets[] = {"priority_id": null, "type": "FIRST_REPLY_TIME", "goal_in_seconds": 16200, "operational_hours": "BUSINESS_HOURS"} targets[] = {"priority_id": null, "type": "RESOLUTION_TIME", "goal_in_seconds": 16200, "operational_hours": "CALENDAR_HOURS"} | 
Response
    {
        "status": 201,
        "data": {
    "id": 2,
    "title": "High priority sales and support tickets",
    "description": null,
    "execution_order": 2,
    "predicate_collections": [
        {
            "id": 4,
            "propositions": [
                {
    "id": 1,
    "resource_type": "sla_proposition"
}
            ],
            "resource_type": "predicate_collection"
        }
    ],
    "targets": [
        {
    "id": 10,
    "resource_type": "sla_target"
}
    ],
    "is_enabled": true,
    "is_deleted": false,
    "created_at": "2015-07-31T05:18:50+05:00",
    "updated_at": "2015-07-31T05:18:50+05:00",
    "resource_type": "sla"
    ,"resource_url": "https://brewfictus.kayako.com/api/v1/slas/2"
}
,
        "resource": "sla"
    }
Update an SLA
PUT /api/v1/slas/:id.jsonInformation
| Allowed for | Admins & Owners | 
| Scope | configuration | 
Parameters
| Name | Type | Mandatory | Description | 
|---|---|---|---|
| title | string | ||
| description | string | ||
| predicate_collections[] | array | Example: [{"id":1, "propositions":[{"id":1, "field":"cases.casestatusid", "operator":"comparison_equalto", "value":1}, {"id":2, "field":"cases.channeltype", "operator":"comparison_equalto", "value":"MAIL"}, {"id":null, "field":"cases.casepriorityid", "operator":"comparison_equalto", "value":1}]}] | 
|
| targets[] | array | Existing targets are replaced by given filters. Make sure you send all targets during update same as add.  Example: targets[] = {"id": 1, "priority_id": null, "type": "FIRST_REPLY_TIME", "goal_in_seconds": 19800, "operational_hours": "BUSINESS_HOURS"} targets[] = {"id": null, "priority_id": 1, "type": "RESOLUTION_TIME", "goal_in_seconds": 14400, "operational_hours": "CALENDAR_HOURS"} | 
|
| is_enabled | boolean | 
Response
    {
        "status": 200,
        "data": {
    "id": 2,
    "title": "High priority sales and support tickets",
    "description": null,
    "execution_order": 2,
    "predicate_collections": [
        {
            "id": 4,
            "propositions": [
                {
    "id": 1,
    "resource_type": "sla_proposition"
}
            ],
            "resource_type": "predicate_collection"
        }
    ],
    "targets": [
        {
    "id": 10,
    "resource_type": "sla_target"
}
    ],
    "is_enabled": true,
    "is_deleted": false,
    "created_at": "2015-07-31T05:18:50+05:00",
    "updated_at": "2015-07-31T05:18:50+05:00",
    "resource_type": "sla"
    ,"resource_url": "https://brewfictus.kayako.com/api/v1/slas/2"
}
,
        "resource": "sla"
    }
Update SLAs
PUT /api/v1/slas.jsonInformation
| Allowed for | Admins & Owners | 
| Scope | configuration | 
Arguments
| Name | Type | Mandatory | Description | 
|---|---|---|---|
| ids | string | 
Parameters
| Name | Type | Mandatory | Description | 
|---|---|---|---|
| is_enabled | boolean | 
Response
{
    "status": 200,
    "total_count": 2
}
Reorder SLAs
PUT /api/v1/slas/reorder.jsonInformation
| Allowed for | Admins & Owners | 
| Scope | configuration | 
Parameters
| Name | Type | Mandatory | Description | 
|---|---|---|---|
| sla_ids | string | Comma separated SLA IDs in order you want.  Example: sla_ids = 2,3,1 will set the first order for SLA Id 2, second for 3 and third for ID 1  | 
Response
{
    "status": 200,
}
Delete an SLA
DELETE /api/v1/slas/:id.jsonDelete SLAs
DELETE /api/v1/slas.jsonInformation
| Allowed for | Admins & Owners | 
| Scope | configuration | 
Arguments
| Name | Type | Mandatory | Description | 
|---|---|---|---|
| ids | string | The comma separated ids | 
Response
{
    "status": 200,
    "total_count": 2
}
Definitions
RESOURCE FIELDS
| Name | Type | Read-only | Description | 
|---|---|---|---|
| label | string | ||
| field | string | Field name on which the rules will be applied | |
| type | string | NUMERIC, FLOAT, STRING, BOOLEAN, COLLECTION, DATE_ABSOLUTE, DATE_RELATIVE, TIME | 
|
| sub_type | string | Depends on type: NUMERIC: FLOAT, INTEGER DATE_RELATIVE: PAST, PAST_OR_PRESENT, PRESENT, PAST_OR_FUTURE, FUTURE | 
|
| group | string | CASES, REQUESTER, ORGANIZATION, SLA | 
|
| rarity | string | COMMON, LESS_COMMON | 
|
| description | string | Field description | |
| input_type | string | INTEGER, FLOAT, STRING, BOOLEAN, BOOLEAN_TRUE, BOOLEAN_FALSE, OPTIONS, MULTIPLE, TAGS, DATE_ABSOLUTE, DATE_RELATIVE, AUTOCOMPLETE, TIME | 
|
| operators | array | Depends on input_type: INTEGER, FLOAT: comparison_equalto, comparison_not_equalto, comparison_greaterthan, comparison_greaterthan_or_equalto, comparison_lessthan, comparison_lessthan_or_equalto STRING: string_contains_insensitive, string_does_not_contain_insensitive BOOLEAN: comparison_equalto, comparison_not_equalto BOOLEAN_TRUE: comparison_equalto BOOLEAN_FALSE: comparison_equalto OPTIONS: comparison_equalto, comparison_not_equalto TAGS: collection_contains_insensitive, collection_contains_any_insensitive AUTOCOMPLETE: comparison_equalto, comparison_not_equalto TIME: time_greaterthan, time_greaterthan_or_equalto, time_lessthan, time_lessthan_or_equalto DATE_ABSOLUTE: date_is, date_is_not DATE_RELATIVE: date_after, date_after_or_on, date_before, date_before_or_on | 
|
| values | mixed | Values for a definition with input_type as AUTOCOMPLETE will not be provided by the server | 
Retrieve all definitions
GET /api/v1/slas/definitions.jsonInformation
| Allowed for | Admins & Owners | 
| Scope | configuration | 
Response
    {
        "status": 200,
        "data": [
            {
                "label": "Type",
                "field": "cases.casetypeid",
                "type": "NUMERIC",
                "sub_type": "INTEGER",
                "group": "CASES",
                "rarity": "COMMON",
                "description": "Conversation type",
                "input_type": "OPTIONS",
                "operators": [
                    "comparison_equalto",
                    "comparison_not_equalto"
                ],
                "values": {
                    "0": "none",
                    "4": "Incident",
                    "3": "Problem",
                    "1": "Question",
                    "2": "Task"
                },
                "resource_type": "definition"
            },
            {
                "label": "Team",
                "field": "cases.assigneeteamid",
                "type": "NUMERIC",
                "sub_type": "INTEGER",
                "group": "CASES",
                "rarity": "COMMON",
                "description": "Team assigned to conversation",
                "input_type": "OPTIONS",
                "operators": [
                    "comparison_equalto",
                    "comparison_not_equalto"
                ],
                "values": {
                    "0": "(Unassigned)",
                    "1": "General"
                },
                "resource_type": "definition"
            },
            {
                "label": "Assignee",
                "field": "cases.assigneeagentid",
                "type": "NUMERIC",
                "sub_type": "INTEGER",
                "group": "CASES",
                "rarity": "COMMON",
                "description": "Agent assigned to conversation",
                "input_type": "AUTOCOMPLETE",
                "operators": [
                    "comparison_equalto",
                    "comparison_not_equalto"
                ],
                "values": {
                    "0": "(Unassigned)",
                    "(requester)": "(Requester)"
                },
                "resource_type": "definition"
            },
            {
                "label": "Requester",
                "field": "cases.requesterid",
                "type": "NUMERIC",
                "sub_type": "INTEGER",
                "group": "CASES",
                "rarity": "COMMON",
                "description": "Requester of the conversation",
                "input_type": "AUTOCOMPLETE",
                "operators": [
                    "comparison_equalto",
                    "comparison_not_equalto"
                ],
                "values": {
                    "(assignee)": "(Assignee)"
                },
                "resource_type": "definition"
            },
            {
                "label": "Tags",
                "field": "tags.name",
                "type": "COLLECTION",
                "sub_type": "",
                "group": "CASES",
                "rarity": "COMMON",
                "description": "Tags added to conversation",
                "input_type": "TAGS",
                "operators": [
                    "collection_contains_insensitive",
                    "collection_contains_any_insensitive",
                    "collection_does_not_contain_insensitive"
                ],
                "values": null,
                "resource_type": "definition"
            },
            {
                "label": "Organization",
                "field": "users.organizationid",
                "type": "NUMERIC",
                "sub_type": "INTEGER",
                "group": "CASES",
                "rarity": "COMMON",
                "description": "Requester's organization",
                "input_type": "AUTOCOMPLETE",
                "operators": [
                    "comparison_equalto",
                    "comparison_not_equalto"
                ],
                "values": null,
                "resource_type": "definition"
            },
            {
                "label": "Source Channel",
                "field": "cases.channel",
                "type": "STRING",
                "sub_type": "",
                "group": "CASES",
                "rarity": "COMMON",
                "description": "Channel over which the conversation was started",
                "input_type": "OPTIONS",
                "operators": [
                    "comparison_equalto",
                    "comparison_not_equalto"
                ],
                "values": {
                    "MAIL": "Mail",
                    "MESSENGER": "Messenger",
                    "FACEBOOK": "Facebook",
                    "TWITTER": "Twitter",
                    "NOTE": "Note",
                    "HELPCENTER": "Helpcenter"
                },
                "resource_type": "definition"
            },
            {
                "label": "Brand",
                "field": "cases.brandid",
                "type": "NUMERIC",
                "sub_type": "INTEGER",
                "group": "CASES",
                "rarity": "COMMON",
                "description": "Brand to which conversation belongs",
                "input_type": "OPTIONS",
                "operators": [
                    "comparison_equalto",
                    "comparison_not_equalto"
                ],
                "values": {
                    "1": "Brewfictus"
                },
                "resource_type": "definition"
            },
            {
                "label": "Form",
                "field": "cases.caseformid",
                "type": "NUMERIC",
                "sub_type": "INTEGER",
                "group": "CASES",
                "rarity": "COMMON",
                "description": "Form linked to conversation",
                "input_type": "OPTIONS",
                "operators": [
                    "comparison_equalto",
                    "comparison_not_equalto"
                ],
                "values": {
                    "0": "none",
                    "1": "Default"
                },
                "resource_type": "definition"
            }
        ],
        "resource": "definition",
        "total_count": 9
    }
Autocomplete
Autocomplete
| Name | Type | Read-only | Description | 
|---|---|---|---|
| users.organizationid | Organization | ||
| cases.requesterid | User | ||
| cases.assigneeagentid | User | Filter by multiple comma separated valuesOWNERS,ADMINS,AGENTS,COLLABORATORS` |