Skip to main content

Apply SLA Policy

POST 

/accounts/:account_id/conversations/:conversation_id/apply_sla

Applies an SLA policy to the conversation, or removes it, and returns the full conversation.

The policy is removed when sla_policy_id is null. The SLA is in the conversation's sla_policy_id and applied_sla.

SettingValue
MethodPOST
Path/api/v1/accounts/{account_id}/conversations/{conversation_id}/apply_sla
AuthorizationUser token or agent-bot token.

Permissions:

Path parameters

NameTypeRequiredDescription
account_idintegerYesAccount ID.
conversation_idintegerYesConversation display ID.

Body parameters (JSON)

NameTypeRequiredDescription
sla_policy_idintegerYesSLA policy ID, or null to remove the policy.

Example request

curl -X POST 'https://online.99digital.co.il/api/v1/accounts/12/conversations/1501/apply_sla' \
-H 'api_access_token: <YOUR_API_ACCESS_TOKEN>' \
-H 'Content-Type: application/json' \
-d '{ "sla_policy_id": 4 }'

Example response (200 OK): a full conversation object. Only the SLA fields are shown here.

{
"id": 1501,
"sla_policy_id": 4,
"applied_sla": {
"id": 210,
"sla_id": 4,
"sla_status": "active",
"created_at": 1794473400,
"updated_at": 1794473400,
"sla_description": "Standard response times",
"sla_name": "Standard",
"sla_first_response_time_threshold": 60.0,
"sla_next_response_time_threshold": 180.0,
"sla_only_during_business_hours": false,
"sla_resolution_time_threshold": 240.0
},
"sla_events": []
}

Thresholds are in seconds. applied_sla holds:

FieldDescription
idThe ID of the applied SLA.
sla_idThe SLA policy's ID.
sla_statusThe SLA's state, for example active.
sla_name, sla_descriptionThe policy's name and description.
sla_first_response_time_threshold, sla_next_response_time_threshold, sla_resolution_time_thresholdThe policy's thresholds, in seconds.
sla_only_during_business_hoursWhether the thresholds apply only during business hours.
created_at, updated_atUnix time, seconds.

DELETE /conversations/{conversation_id}/cancel_sla also removes the policy, but it is deprecated; send {"sla_policy_id": null} instead.

Error responses

StatusWhenBody
404No SLA policy with this sla_policy_id.{"error": "SLA policy not found"}

Request​

Responses​

The full conversation.