Conversations
Enable or disable automation rule
PATCH
/
v1
/
automation
/
rules
/
{ruleID}
Enable or disable automation rule
curl --request PATCH \
--url https://api.wazapin.com/v1/automation/rules/{ruleID} \
--header 'Content-Type: application/json' \
--data '
{
"enabled": true
}
'const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({enabled: true})
};
fetch('https://api.wazapin.com/v1/automation/rules/{ruleID}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.wazapin.com/v1/automation/rules/{ruleID}"
payload = { "enabled": True }
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"actions": [
{
"type": "<string>",
"agent_id": "<string>",
"fixed_agent_id": "<string>",
"label": "<string>",
"label_id": "<string>",
"strategy": "<string>"
}
],
"created_at": "<string>",
"created_by": "<string>",
"enabled": true,
"id": "<string>",
"name": "<string>",
"organization_id": "<string>",
"scope": {
"channel_type": "<string>",
"conversation_id": "<string>"
},
"trigger": {
"event": "<string>",
"events": [
"<string>"
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"message": "<string>",
"code": "<string>",
"field": "<string>",
"location": "<string>"
}
],
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"message": "<string>",
"code": "<string>",
"field": "<string>",
"location": "<string>"
}
],
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"message": "<string>",
"code": "<string>",
"field": "<string>",
"location": "<string>"
}
],
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"message": "<string>",
"code": "<string>",
"field": "<string>",
"location": "<string>"
}
],
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"message": "<string>",
"code": "<string>",
"field": "<string>",
"location": "<string>"
}
],
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"message": "<string>",
"code": "<string>",
"field": "<string>",
"location": "<string>"
}
],
"request_id": "<string>"
}
}Path Parameters
Automation rule ID
Body
application/json
Enable/disable the rule
⌘I
Enable or disable automation rule
curl --request PATCH \
--url https://api.wazapin.com/v1/automation/rules/{ruleID} \
--header 'Content-Type: application/json' \
--data '
{
"enabled": true
}
'const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({enabled: true})
};
fetch('https://api.wazapin.com/v1/automation/rules/{ruleID}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.wazapin.com/v1/automation/rules/{ruleID}"
payload = { "enabled": True }
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"actions": [
{
"type": "<string>",
"agent_id": "<string>",
"fixed_agent_id": "<string>",
"label": "<string>",
"label_id": "<string>",
"strategy": "<string>"
}
],
"created_at": "<string>",
"created_by": "<string>",
"enabled": true,
"id": "<string>",
"name": "<string>",
"organization_id": "<string>",
"scope": {
"channel_type": "<string>",
"conversation_id": "<string>"
},
"trigger": {
"event": "<string>",
"events": [
"<string>"
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"message": "<string>",
"code": "<string>",
"field": "<string>",
"location": "<string>"
}
],
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"message": "<string>",
"code": "<string>",
"field": "<string>",
"location": "<string>"
}
],
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"message": "<string>",
"code": "<string>",
"field": "<string>",
"location": "<string>"
}
],
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"message": "<string>",
"code": "<string>",
"field": "<string>",
"location": "<string>"
}
],
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"message": "<string>",
"code": "<string>",
"field": "<string>",
"location": "<string>"
}
],
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"message": "<string>",
"code": "<string>",
"field": "<string>",
"location": "<string>"
}
],
"request_id": "<string>"
}
}