Skip to main content

Background

Webhooks extend the way Lumos connects with your company apps. SeeExtending Lumos With Webhooks This guide shows you how to set up a webhook so that you can use it in your workflows.

Steps

1. Go to Settings → Webhooks.

“Webhooks” is in the “Dev Tools” section of the Settings menu, below “Security”. On a short or zoomed-in browser window, the bottom of that menu can be cut off, so zoom out or go straight to your webhooks in Lumos. To add or test a webhook, you need the Admin role or a custom role that can manage Webhooks.

2. Click “Add Webhook” and choose the type.

3. Fill in the details.

  • In “Name”, add a name that will be clear when you’re adding the webhook to a workflow later.
  • In “Description” (optional), say what the webhook does.
  • In “Endpoint URL”, enter the URL Lumos sends the webhook payload to (via HTTP POST) to trigger your script or workflow. The endpoint must be reachable over the public internet.
  • In “Custom Headers”, add any authentication your endpoint needs. iPaaS tools such as Okta Workflows and Workato often require a specific type. Even for a custom serverless function, Lumos recommends authenticating requests with a shared credential, such as an API key.

4. Click “Test Webhook”.

“Test Webhook” sends a sample request to your “Endpoint URL” with your “Custom Headers”, so you can check that your endpoint is reachable and replies in a format Lumos can read.
  • The sample request is in the “Request Body” section above the button. Expand it to see or edit it. Lumos fills it with example values for the webhook type you chose. You can change the values to try different cases, but the body must stay valid JSON. Your edits apply only to the test and aren’t saved with the webhook.
  • When a real request triggers the webhook, Lumos builds the payload from that request. The payload can’t be customized, and it can include fields the sample leaves out, such as request_comment and request_task_url.
  • If the test works, Lumos shows “Success!” with the result it read from your endpoint’s reply, such as {"response": "PREAPPROVED", "msg": null}. If it fails, Lumos shows “Error dispatching your webhook…” with the reason.
  • Lumos signs test requests only after the webhook is saved. To test signature checks, click “Save”, open the webhook again, and run the test.
For the response format Lumos expects, see “Expected response format” below.

5. Click “Save”.

Expected response format

Your script/workflow needs to return a JSON payload when it finishes to be successfully parsed by Lumos, with the exception of Provisioning, Deprovisioning, and SIEM webhooks. Provisioning and Deprovisioning webhooks will also be considered successful if your script/workflow returns an HTTP 204 response. SIEMwebhooks will be considered successful with any HTTP 2XX response. For all other webhooks, either of the following payload formats can be successfully parsed by Lumos, though the data in the “output” key will be used first, if found.
Webhooks that are not successfully parsed are marked as “Failed” in Lumos, even if your remote script/workflow finished. It’s important that your webhook responds in the correct format. Lumos looks for the value in the “response” key to determine whether the script completed the task (provisioning, deprovisioning, etc.) successfully. Information about expected response values for each webhook type is below: Provisioning Webhooks Deprovisioning Webhooks Request Validation Webhooks Pre-Approval Webhooks

FAQs

I cannot get the “Test Webhook” to succeed.

First, make sure that your _Endpoint URL_and Custom Headers are correct and contain all required info. If so, make sure that your webhook returns a response to Lumos in the expected response format above. If the test shows “You have to provide a valid json in the ‘Request Body’”, the text in “Request Body” isn’t valid JSON. This usually comes from curly quotes or extra characters picked up in copy and paste. Close the form and open it again to restore the sample.