Skip to main content
POST
/
agents
/
{agent_id}
/
routing
/
rules
Create routing rule
curl --request POST \
  --url https://api.trymaitai.ai/api/v1/agents/{agent_id}/routing/rules \
  --header 'Content-Type: application/json' \
  --header 'X-Maitai-Api-Key: <api-key>' \
  --data '
{
  "label": "Route billing questions",
  "route": {
    "type": "action",
    "action_id": 12
  },
  "conditions": [
    {
      "target_type": "message",
      "variable_path": "content",
      "operator": "sem_match",
      "value_text": "billing"
    }
  ],
  "enabled": true
}
'
{
  "data": {
    "id": 1,
    "agent_id": 101,
    "label": "Route billing questions",
    "enabled": true
  }
}

Authorizations

X-Maitai-Api-Key
string
header
required

Your Maitai API key from the Portal.

Path Parameters

agent_id
integer
required

Body

application/json
label
string
condition_expression
string
route
object
conditions
array
enabled
boolean

Response

201 - application/json

Create routing rule.

data
any