API StatusPartner Portal
HomeGuidesAPI ExplorerSDKsGitHubSupport
HomeGuidesAPI ExplorerSDKsGitHubSupport
  • API Concepts
    • Overview
    • Environments and URLs
    • Authentication
    • API versioning
    • Rate limiting
    • HTTP headers
    • Pagination, sorting, and filtering
  • General
  • Common
  • Accounts payable
  • Accounts receivable
  • E-invoicing
  • Payments
  • Accounting integration
  • Expense management
  • Utilities
LogoLogo
API StatusPartner Portal
Accounts payableApproval policies

POST
/approval_policies
POST
/v1/approval_policies
1curl -X POST https://api.sandbox.monite.com/v1/approval_policies \
2 -H "x-monite-version: 2024-05-25" \
3 -H "x-monite-entity-id: 9d2b4c8f-2087-4738-ba91-7359683c49a4" \
4 -H "Authorization: Bearer <token>" \
5 -H "Content-Type: application/json" \
6 -d '{
7 "name": "name",
8 "script": [
9 true
10 ]
11}'
Try it
1{
2 "id": "id",
3 "created_at": "2024-01-15T09:30:00Z",
4 "updated_at": "2024-01-15T09:30:00Z",
5 "created_by": "created_by",
6 "name": "name",
7 "script": [
8 true
9 ],
10 "status": "active",
11 "description": "description",
12 "ends_at": "2024-01-15T09:30:00Z",
13 "priority": 1,
14 "starts_at": "2024-01-15T09:30:00Z",
15 "trigger": true,
16 "updated_by": "updated_by"
17}
Was this page helpful?
Previous

Get an approval policy by ID

Next
Create a new approval policy.
Create an approval policy

Authentication

AuthorizationBearer
Bearer authentication of the form `Bearer <token>`, where token is your auth token.

Headers

x-monite-versionstringRequired
x-monite-entity-idstringRequired
The ID of the entity that owns the requested resource.

Request

This endpoint expects an object.
namestringRequired<=255 characters
The name of the approval policy.
scriptlist of booleans or doubles or strings or lists of any or maps from strings to anyRequired
A list of JSON objects that represents the approval policy script. The script contains the logic that determines whether an action should be sent to approval. This field is required, and it should contain at least one script object.
descriptionstringOptional<=255 characters
A brief description of the approval policy.
ends_atdatetimeOptional
The date and time (in the ISO 8601 format) when the approval policy stops being active and stops triggering approval workflows.If `ends_at` is provided in the request, then `starts_at` must also be provided and `ends_at` must be later than `starts_at`. The value will be converted to UTC.
priorityintegerOptional-32768-32767Defaults to 0
The priority controls which approval policy takes precedence when a payable matches multiple approval policies. A higher value mean higher priority.
starts_atdatetimeOptional
The date and time (in the ISO 8601 format) when the approval policy becomes active. Only payables submitted for approval during the policy's active period will trigger this policy. If omitted or `null`, the policy is effective immediately. The value will be converted to UTC.
triggerboolean or double or string or list of any or map from strings to anyOptional
A JSON object that represents the trigger for the approval policy. The trigger specifies the event that will trigger the policy to be evaluated.

Response

Successful Response
idstringformat: "uuid"
created_atdatetime
updated_atdatetime
created_bystringformat: "uuid"
namestring<=255 characters
The name of the approval policy.
scriptlist of booleans or doubles or strings or lists of any or maps from strings to any
A list of JSON objects that represents the approval policy script. The script contains the logic that determines whether an action should be sent to approval. This field is required, and it should contain at least one script object.
statusenum
The current status of the approval policy.
Allowed values:
descriptionstring or null<=255 characters
A brief description of the approval policy.
ends_atdatetime or null
The date and time (in the ISO 8601 format) when the approval policy stops being active and stops triggering approval workflows.If `ends_at` is provided in the request, then `starts_at` must also be provided and `ends_at` must be later than `starts_at`. The value will be converted to UTC.
priorityinteger or null-32768-32767Defaults to 0
The priority controls which approval policy takes precedence when a payable matches multiple approval policies. A higher value mean higher priority.
starts_atdatetime or null
The date and time (in the ISO 8601 format) when the approval policy becomes active. Only payables submitted for approval during the policy's active period will trigger this policy. If omitted or `null`, the policy is effective immediately. The value will be converted to UTC.
triggerboolean or double or string or list of any or map from strings to any or null
A JSON object that represents the trigger for the approval policy. The trigger specifies the event that will trigger the policy to be evaluated.
updated_bystring or nullformat: "uuid"

Errors

The name of the approval policy.
A list of JSON objects that represents the approval policy script. The script contains the logic that determines whether an action should be sent to approval. This field is required, and it should contain at least one script object.
A brief description of the approval policy.
The priority controls which approval policy takes precedence when a payable matches multiple approval policies. A higher value mean higher priority.
A JSON object that represents the trigger for the approval policy. The trigger specifies the event that will trigger the policy to be evaluated.
Successful Response

The date and time (in the ISO 8601 format) when the approval policy stops being active and stops triggering approval workflows.If ends_at is provided in the request, then starts_at must also be provided and ends_at must be later than starts_at. The value will be converted to UTC.

Bearer authentication of the form Bearer <token>, where token is your auth token.

The date and time (in the ISO 8601 format) when the approval policy becomes active. Only payables submitted for approval during the policy’s active period will trigger this policy. If omitted or null, the policy is effective immediately. The value will be converted to UTC.

The date and time (in the ISO 8601 format) when the approval policy stops being active and stops triggering approval workflows.If ends_at is provided in the request, then starts_at must also be provided and ends_at must be later than starts_at. The value will be converted to UTC.

The date and time (in the ISO 8601 format) when the approval policy becomes active. Only payables submitted for approval during the policy’s active period will trigger this policy. If omitted or null, the policy is effective immediately. The value will be converted to UTC.