/

Create webhooks (console)

How to quickly create webhooks triggered by UP42 events using the console.


Introduction

In this guide, you will learn how to easily create a webhook and select a webhook event using the console. Depending on your use case, you can be notified everytime a job task changes its status or check whether a placed order has been successfully completed or not.

Create webhook

After signing up, open the console, go to the upper-right corner and select the section Webhooks.

The webhooks dashboard is empty.

To create a webhook from scratch, click on Create Webhook.

empty dashboard

A new window appears, where you can configure the webhook parameters. Each parameter is explained in the table below.

create with data

ParameterDefinitionRequired
NameWebhook nameyes
URL endpointUnique URL where the webhook will send the message (HTTPS is required)yes
SecretThe secret is a string used to add a signature to the HTTPS request that is sent to the specific URL. The signature will be part of the HTTPS headers. If no secret is added, there will be no signature header. Using a secret has the following advantages: the recipient is informed about the author of the received HTTPS request and can validate the request integrity (i.e. if the data payload is the original or it got modified).no
EventsThe event types that trigger your webhooks: Job Status, Order Statusyes
StatusWebhook status: Active, Inactiveyes

After you finish the webhook configuration, click on Save.

Your newly-created webhook is now displayed on the webhook dashboard.

webhooks dashboard

Edit webhook

To edit the webhook, click on Edit.

edit webhook

Delete webhook

To delete the webhook, click on Delete.

delete webhook

Test webhook

To test the webhook, click on Send test event. By clicking on this button, a message will be sent to the URL endpoint.

test webhook

Trigger webhook

The next step is to perform an action defined by one of the two events and trigger the webhook. In this example, you will run a job. When the job run starts, the webhook will send a payload to the webhook URL of the recipient. The example below shows the payload for a job status:

{
"event": "job.status",
"liveMode": true,
"messageId": "8e3bfae9-ac06-4a0a-beae-653b2d56f69f",
"timestamp": "2022-04-05T12:46:17Z",
"body": {
   "id": "a04c1abe-ff2b-4942-8584-daff733da98d",
   "status": "RUNNING",
   "startedAt": "2022-04-05T12:46:01Z",
   "finishedAt": null,
   "tasks": [{
   "id": "807a3121-bd8f-4671-8c2d-f70663d80e92",
   "status": "RUNNING",
   "startedAt": "2022-04-05T12:46:11Z",
   "finishedAt": null,
   "logUrl": "https://api.up42.com/projects/{project_id}/jobs/{job_id}/tasks/{task_id}/logs"
      }]
   }
}