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.
| Setting | Value |
|---|---|
| Method | POST |
| Path | /api/v1/accounts/{account_id}/conversations/{conversation_id}/apply_sla |
| Authorization | User token or agent-bot token. |
Permissions:
- User token: any agent who can see the conversation — see Who can see a conversation.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
account_id | integer | Yes | Account ID. |
conversation_id | integer | Yes | Conversation display ID. |
Body parameters (JSON)
| Name | Type | Required | Description |
|---|---|---|---|
sla_policy_id | integer | Yes | SLA 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:
| Field | Description |
|---|---|
id | The ID of the applied SLA. |
sla_id | The SLA policy's ID. |
sla_status | The SLA's state, for example active. |
sla_name, sla_description | The policy's name and description. |
sla_first_response_time_threshold, sla_next_response_time_threshold, sla_resolution_time_threshold | The policy's thresholds, in seconds. |
sla_only_during_business_hours | Whether the thresholds apply only during business hours. |
created_at, updated_at | Unix time, seconds. |
DELETE /conversations/{conversation_id}/cancel_sla also removes the policy,
but it is deprecated; send {"sla_policy_id": null} instead.
Error responses
| Status | When | Body |
|---|---|---|
404 | No SLA policy with this sla_policy_id. | {"error": "SLA policy not found"} |
Request
Responses
- 200
- 401
- 403
- 404
The full conversation.
The access token is missing or wrong, or its user does not belong to this account.
The token's role does not have the permission this endpoint needs, or the endpoint is not open to agent-bot tokens. See Authorization.
The conversation or the SLA policy does not exist in this account.