Skip to main content

Create an approval action

An approval action specifies what happens when a policy is evaluated. For example, it may approve the request, deny it, or initiate a review process based on the policy's results.

As the first step to configure approvals, you'll need to create an approval action by sending a POST request.

Example request

curl -L 'https://api.nullplatform.com/approval/action' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"nrn": "organization=1",
"entity": "service:action",
"action": "service:action:create",
"on_policy_success": "approve",
"on_policy_fail": "manual"
}
Request details
  • nrn: The NRN where the approval action applies.
  • entity: The type of entity the action applies to (e.g., service:action).
  • action: The specific action being performed (e.g., service:action:create).
  • on_policy_success: The outcome if the policy conditions are met (e.g., approve).
  • on_policy_fail: The outcome if the policy conditions are not met (e.g., manual).

This approval action will be triggered when the user attempts to create a service action. If you'd like to create an approval action for a scope creation attempt with the same outcomes, you'll need to set entity and action as follows:

{
"entity": "scope:action",
"action": "scope:create",
}

Example response

For a successful request, you'll get a response like this:

{
"id": 98765, // Save the action ID for the next steps
"nrn": "organization=1",
"entity": "service:action",
"action": "service:action:create",
"on_policy_success": "approve",
"on_policy_fail": "manual"
}

This ensures that service creation requests are evaluated and either approved or flagged for manual review based on policy results.

tip

The id field contains the unique approval action ID. Be sure to save it, as you'll need it in the next steps.

What's next

Now that you've created your approval action, you can either proceed to set up a notification channel or create a policy to define the rules for when the approval action should be triggered.