Skip to main content
POST
Create an approval rule

Authorizations

Authorization
string
header
required

Authenticate using a bearer token. To create a token, navigate to /settings/api-tokens and click Create API Token.

Body

application/json
name
string
required

Unique among the rules of the same model.

Maximum string length: 255
Example:

"Wholesale prepay"

model
enum<string>
required
Available options:
SALES_ORDER,
SUPPLIER_PURCHASE_ORDER
operator
enum<string>
required

How the conditions combine.

Available options:
AND,
OR
condition
object[]
required

One or more conditions. Each field and operator must come from GET /approval-models/{model}/fields for the rule's model.

approval_user_template_id
integer
required

ID of an existing approver template (GET /approval-user-templates).

Example:

3

enable_single_approver
boolean

When true, one approver's sign-off releases the document. Optional on create (defaults to false); required on PUT.

order
integer

Optional position of the rule.

Response

Approval rule created.

data
object

An approval rule (Settings › Approvals › Approval Rules). Every new document of its model whose fields match its conditions is held for sign-off by the users of its approver template.