Run an Onboard Policy

In the gPanel application, we have the ability to run a policy when a new user is created.  Here is the documentation for how this is achieved within the application user interface: https://resources.promevo.com/knowledgebase/gpanel/tools/create-a-new-user-policy


With the Onboard Policy API endpoint, we are able to run an on-boarding policy (a.k.a. New User Policy) via an API call.

We just need to provide the policy to run and the user to run it against.


The definitive documentation for this API endpoint is in the developer portal.  This is where you will find the technical details, such as which HTTP verb to use, and what parameters you need to provide.

https://developer.promevo.com/docs/onboard-policy-invoker/1/overview

Form your API Request

The gPanel Application can help us form our API request.  Locate the New User Creation policy you wish to invoke, and view the policy details by clicking the double arrows.

gPanel API 2

The Policy Details view will show two relevant pieces of information that will help you form your API call.

gPanel API 3

Visiting the docs in the developer portal shows me that this API request takes two parameters via a POST body:

gPanel API 4

Using all of this information, we can now form our request.  Be sure to plugin your own values for userEmail, policyId, and apikey.

Here is a sample curl command:

gPanel API 5

Response

A successful response (HTTP response code 2xx) means that your request was received and gPanel will run your policy.  Note, however, that a successful response from your API call does not mean that your policy ran successfully to completion.  

Your policy is being run asynchronously as a background task in gPanel.  To gain insight into the outcome of the policy execution, visit the gPanel application.