Set an approval rule
Let one kind of action run without asking, or make it need two people.
PUT
/
employees
/
{role}
/
approval-rules
/
{action_type}
Set an approval rule
curl --request PUT \
--url https://app.mithunai.com/mithunai/api/v1/employees/{role}/approval-rules/{action_type} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"mode": "<string>"
}
'import requests
url = "https://app.mithunai.com/mithunai/api/v1/employees/{role}/approval-rules/{action_type}"
payload = { "mode": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({mode: '<string>'})
};
fetch('https://app.mithunai.com/mithunai/api/v1/employees/{role}/approval-rules/{action_type}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));always_allow lets this employee do this kind of action without a person. two_people makes a
second, different person approve it after the first. One rule per kind of action: setting one
replaces the other, and both are kept as changes. Always allow returns 400 for a kind of action that
always needs a person, or that moves money, deletes, publishes or changes access. Work that arrived
by itself still waits for a person, whatever the rule. Requires owner or admin, signed in. Audited.
AI employees are in beta. These routes need a second switch, off by default. See Approval
rules.
Path
string
required
The employee:
support, itsm, devops, marketer, sales or finance.string
required
One of that employee’s kinds of action, for example
support.reply.send.Body
string
required
always_allow or two_people.Response
The rule now in force:role, tool, action_type, title, mode, created_by, created_at.Last modified on November 7, 2026
Set an approval rule
curl --request PUT \
--url https://app.mithunai.com/mithunai/api/v1/employees/{role}/approval-rules/{action_type} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"mode": "<string>"
}
'import requests
url = "https://app.mithunai.com/mithunai/api/v1/employees/{role}/approval-rules/{action_type}"
payload = { "mode": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({mode: '<string>'})
};
fetch('https://app.mithunai.com/mithunai/api/v1/employees/{role}/approval-rules/{action_type}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));