Create webhooks

Create and test webhooks.


See notification events

To see all available notification events, call the /webhooks/events endpoint:

GET /webhooks/events HTTP/1.1
Host: api.up42.com
See response example
{
  "data": [
    {
      "name": "job.status",
      "title": "Job Status Updates",
      "category": "job",
      "description": "Sent when job/task status is updated",
      "documentation": "https://docs.up42.com/developers/"
    },
    {
      "name": "order.status",
      "title": "Order Status Updates",
      "category": "order",
      "description": "Sent when order status is updated",
      "documentation": "https://docs.up42.com/developers/"
    }
  ],
  "error": null
}

You can set up webhooks to receive notifications for the following status updates:

  • job.status Every time a job changes its status.
  • order.status When a new order has been completed — successfully or not.

Create a webhook

To create a webhook, call the /workspaces/{workspace_id}/webhooks endpoint with your workspace ID as a path parameter:

POST /workspaces/{workspace_id}/webhooks HTTP/1.1
Host: api.up42.com
Authorization: Bearer {token}
Body parameterOverview
eventsarray of strings / required
A list of event types for this webhook.
namestring / required
A custom name for the webhook.
urlstring / required
A URL endpoint.
secretstring
A HTTPS request signature that verifies the notification.
activeboolean
Whether this webhook should be active after creation. The default value is false.
See request example
{
  "events": ["job.status, order.status"],
  "name": "My alert for job and order statuses",
  "url": "https://my.sample.endpoint.com/",
  "secret": "QWZTFnMEXhqZKNmu",
  "active": true
}

See response example
{
  "data": {
    "id": "1df1ebb0-78a4-55d9-b806-15d22e391bd3",
    "url": "https://my.sample.endpoint.com/",
    "name": "My alert for job and order statuses",
    "active": true,
    "events": ["job.status, order.status"],
    "createdAt": "2022-02-17T08:47:11.377149Z",
    "updatedAt": "2022-02-17T08:47:11.377149Z",
    "secret": "QWZTFnMEXhqZKNmu"
  },
  "error": null
}

Test a created webhook

To test a created webhook, call the /workspaces/{workspace_id}/webhooks/{webhook_id}/tests endpoint with your workspace ID and the created webhook ID as path parameters:

POST /workspaces/{workspace_id}/webhooks/{webhook_id}/tests HTTP/1.1
Host: api.up42.com
Authorization: Bearer {token}
Body parameterOverview
eventNamesarray of strings
Specify if you need to test a specific event type for this webhook. If empty, the endpoint will run tests for all subscribed events.
See request example
{
  "eventNames": ["job.status"]
}

See response example
{
  "data": {
    "startedAt": "2022-02-18T15:12:18.668452Z",
    "testsRun": 1,
    "testsSucceeded": 1,
    "testsFailed": 0,
    "tests": [
      {
        "startedAt": "2022-02-18T15:12:19.362725Z",
        "eventName": "job.status",
        "success": true,
        "message": "Test request was successful!",
        "request": {
          "headers": {
            "caseInsensitiveName": true,
            "empty": false
          },
          "body": {
            "event": "job.status",
            "liveMode": false,
            "messageId": "377669ea-5521-416a-976a-8e290466f7fb",
            "timestamp": "2022-02-18T15:12:18.672945Z",
            "body": {
              "jobId": "FB0DA199-01DF-4635-910D-A823AE7DC200",
              "status": "PENDING",
              "tasks": [
                {
                  "id": "FB0DA199-01DF-4635-910D-A823AE7DC201",
                  "status": "NOT_STARTED",
                  "startedAt": null,
                  "finishedAt": null
                }
              ],
              "startedAt": "2021-12-21T10:14:27Z",
              "finishedAt": null
            }
          }
        },
        "response": "HttpResponse[https://my.sample.endpoint.com/, 200 OK]"
      }
    ]
  },
  "error": null
}