Links

Set SLA to Inquiry

Set SLA policy to an inquiry.
It requires either the view-l-room or manage-livechat-sla permission.
URL
Requires Auth
HTTP Method
/api/v1/livechat/inquiry.setSLA
YES
PUT

Headers

Argument
Example
Required
Description
X-User-Id
myuser-name
Required
Your username hash (returned after you log in through the API)
X-Auth-Token
myauth-token
Required
Your token (returned after you log in through the API)

Payload

Argument
Example
Required
Description
roomId
ZDYMFPpvnXgptmzMs
Required
The room Id
sla
6417f67528384134ed600dc6
Required
Name or Id of the SLA.

Example Payload

{
"roomId":"ZDYMFPpvnXgptmzMs",
"sla":"6417f67528384134ed600dc6"
}

Example Call

curl --location --request PUT 'https://writing-demo.dev.rocket.chat/api/v1/livechat/inquiry.setSLA' \
--header 'x-auth-token: fjiPBhtyFAn5JO3RDdDvKjkXToV2pd4_lb-nkdgJ_Q4' \
--header 'x-user-id: rbAXPnMktTFbNpwtJ' \
--data '{
"roomId":"ZDYMFPpvnXgptmzMs",
"sla":"6417f67528384134ed600dc6"
}'

Example Result

Success

{
"success": true
}

Error

Any of the following errors can occur on the endpoint.
  • Authorization: Requires an authentication token for the request to be made.
  • No Permission: Occurs when the authenticated user neither has the view-l-room nor manage-livechat-sla permission.
  • Invalid Inquiry: This occurs when the inquiry is invalid.
Authorization
No Permission
Invalid Inquiry
{
"status": "error",
"message": "You must be logged in to do this."
}
{
"success": false,
"error": "User does not have the permissions required for this action [error-unauthorized]"
}
{
"success": false,
"error": "error-invalid-inquiry"
}

Change Log

Version
Description
5.0.0
Added
Last modified 2mo ago
Deprecation for cloud services and apps is now extended to November 20, 2023. Rocket.Chat versions receive support for six months after release.