Conversations
Create automation rule
POST
/
v1
/
automation
/
rules
Create automation rule
curl --request POST \
--url https://api.wazapin.com/v1/automation/rules \
--header 'Content-Type: application/json' \
--data '
{
"actions": [
{
"type": "<string>",
"agent_id": "<string>",
"fixed_agent_id": "<string>",
"label": "<string>",
"label_id": "<string>",
"strategy": "<string>"
}
],
"name": "<string>",
"trigger": {
"event": "<string>",
"events": [
"<string>"
]
},
"enabled": true,
"scope": {
"channel_type": "<string>",
"conversation_id": "<string>"
}
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
actions: [
{
type: '<string>',
agent_id: '<string>',
fixed_agent_id: '<string>',
label: '<string>',
label_id: '<string>',
strategy: '<string>'
}
],
name: '<string>',
trigger: {event: '<string>', events: ['<string>']},
enabled: true,
scope: {channel_type: '<string>', conversation_id: '<string>'}
})
};
fetch('https://api.wazapin.com/v1/automation/rules', 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"
payload = {
"actions": [
{
"type": "<string>",
"agent_id": "<string>",
"fixed_agent_id": "<string>",
"label": "<string>",
"label_id": "<string>",
"strategy": "<string>"
}
],
"name": "<string>",
"trigger": {
"event": "<string>",
"events": ["<string>"]
},
"enabled": True,
"scope": {
"channel_type": "<string>",
"conversation_id": "<string>"
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(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>"
}
}Body
application/json
Ordered action list
Show child attributes
Show child attributes
Rule name
Minimum string length:
1Automation trigger configuration
Show child attributes
Show child attributes
Whether this rule is active (defaults to true)
Optional organization-local rule scope
Show child attributes
Show child attributes
⌘I
Create automation rule
curl --request POST \
--url https://api.wazapin.com/v1/automation/rules \
--header 'Content-Type: application/json' \
--data '
{
"actions": [
{
"type": "<string>",
"agent_id": "<string>",
"fixed_agent_id": "<string>",
"label": "<string>",
"label_id": "<string>",
"strategy": "<string>"
}
],
"name": "<string>",
"trigger": {
"event": "<string>",
"events": [
"<string>"
]
},
"enabled": true,
"scope": {
"channel_type": "<string>",
"conversation_id": "<string>"
}
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
actions: [
{
type: '<string>',
agent_id: '<string>',
fixed_agent_id: '<string>',
label: '<string>',
label_id: '<string>',
strategy: '<string>'
}
],
name: '<string>',
trigger: {event: '<string>', events: ['<string>']},
enabled: true,
scope: {channel_type: '<string>', conversation_id: '<string>'}
})
};
fetch('https://api.wazapin.com/v1/automation/rules', 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"
payload = {
"actions": [
{
"type": "<string>",
"agent_id": "<string>",
"fixed_agent_id": "<string>",
"label": "<string>",
"label_id": "<string>",
"strategy": "<string>"
}
],
"name": "<string>",
"trigger": {
"event": "<string>",
"events": ["<string>"]
},
"enabled": True,
"scope": {
"channel_type": "<string>",
"conversation_id": "<string>"
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(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>"
}
}