# Getting Started

## **How to setup your first webhook**

Paradime's webhook system supports JSON payloads to your application's endpoint URL when your webhook is triggered.

Paradime supports the below events for Bolt runs:

* `bolt.run.started` — Triggered when a Bolt run is started
* `bolt.run.completed` — Triggered when a Bolt run is completed. This can be a run that has failed or succeeded.

{% @arcade/embed url="<https://app.arcade.software/share/bNf3AKjW6tjLkS9cuSWb>" flowId="bNf3AKjW6tjLkS9cuSWb" %}

## Examples of JSON payloads <a href="#examples-of-json-payloads" id="examples-of-json-payloads"></a>

### An example of a webhook payload for a completed run:

The `bolt.run.completed` event provide all the data required to see the details of the execution for a schedule. This event also enables you to query additional metadata for each dbt™️ command using a pre-populate graphql endpoint provided in the fields:

* **`api_query`** - this endpoint will allow you to query and extract for each command in the schedule the raw console logs
* **`resource_query`** - this endpoint will allow you to query and extract for each command the relate resources generated by the execution of the command, for example the `run_results.json` or the `manifest.json`

{% hint style="info" %}
See Also: [Bolt API](/app-help/documentation/bolt/bolt-api.md)
{% endhint %}

```json
{
   "api_url":"https://api.demo.paradime.io/api/v1/uany7edagtovarzx/graphql",
   "commands":[
      {
         "api_query":"query BoltCommand {\n    boltCommand(commandId: 193439) {\n        command\n        startDttm\n        endDttm\n        stdout\n        stderr\n        returnCode\n        scheduleRunId\n        resources {\n            id\n            path\n        }\n    }\n}",
         "command":"git clone ...",
         "end_dttm":"2023-10-15 16:44:16.986049",
         "id":193439,
         "json_resources":[
            
         ],
         "return_code":0,
         "start_dttm":"2023-10-15 16:44:14.576471",
         "status":"succeeded"
      },
      {
         "api_query":"query BoltCommand {\n    boltCommand(commandId: 193440) {\n        command\n        startDttm\n        endDttm\n        stdout\n        stderr\n        returnCode\n        scheduleRunId\n        resources {\n            id\n            path\n        }\n    }\n}",
         "command":"dbt deps",
         "end_dttm":"2023-10-15 16:44:19.831942",
         "id":193440,
         "json_resources":[
            
         ],
         "return_code":0,
         "start_dttm":"2023-10-15 16:44:17.109897",
         "status":"succeeded"
      },
      {
         "api_query":"query BoltCommand {\n    boltCommand(commandId: 193441) {\n        command\n        startDttm\n        endDttm\n        stdout\n        stderr\n        returnCode\n        scheduleRunId\n        resources {\n            id\n            path\n        }\n    }\n}",
         "command":"dbt seed",
         "end_dttm":"2023-10-15 16:44:29.552605",
         "id":193441,
         "json_resources":[
            {
               "id":1205731,
               "path":"target/manifest.json",
               "resource_query":"query BoltResourceUrl {\n    boltResourceUrl(resourceId: 1205731) {\n        ok\n        url\n    }\n}"
            },
            {
               "id":1205739,
               "path":"target/run_results.json",
               "resource_query":"query BoltResourceUrl {\n    boltResourceUrl(resourceId: 1205739) {\n        ok\n        url\n    }\n}"
            }
         ],
         "return_code":0,
         "start_dttm":"2023-10-15 16:44:19.886774",
         "status":"succeeded"
      },
      {
         "api_query":"query BoltCommand {\n    boltCommand(commandId: 193442) {\n        command\n        startDttm\n        endDttm\n        stdout\n        stderr\n        returnCode\n        scheduleRunId\n        resources {\n            id\n            path\n        }\n    }\n}",
         "command":"dbt run",
         "end_dttm":"2023-10-15 16:44:37.422950",
         "id":193442,
         "json_resources":[
            {
               "id":1205743,
               "path":"target/manifest.json",
               "resource_query":"query BoltResourceUrl {\n    boltResourceUrl(resourceId: 1205743) {\n        ok\n        url\n    }\n}"
            },
            {
               "id":1205761,
               "path":"target/run_results.json",
               "resource_query":"query BoltResourceUrl {\n    boltResourceUrl(resourceId: 1205761) {\n        ok\n        url\n    }\n}"
            }
         ],
         "return_code":1,
         "start_dttm":"2023-10-15 16:44:29.586366",
         "status":"failed"
      }
   ],
   "end_dttm":"2023-10-15 16:44:39.891890",
   "environment":{
      "actor":"Manual",
      "branch":"main",
      "commit_hash":"54a134583ef6dccbe154e30e1cd09a9d94b6bda0",
      "email":"fabio@paradime.io"
   },
   "error_string":null,
   "id":63187,
   "run_url":"https://app.demo.paradime.io/bolt/run_id/63187",
   "schedule":{
      "commands":[
         "dbt seed",
         "dbt run"
      ],
      "deferred_schedule":null,
      "email_notify":[
         "max@acme.io",
         "fabio@acme.io"
      ],
      "email_on":[
         "passed",
         "failed"
      ],
      "environment":"production",
      "git_branch":null,
      "hightouch":null,
      "name":"daily_run",
      "owner_email":"fabio@paradime.io",
      "schedule":"@daily",
      "slack_notify":[
         "data-alerts"
      ],
      "slack_on":[
         "passed",
         "failed"
      ],
      "turbo_ci":null
   },
   "schedule_name":"daily_run",
   "start_dttm":"2023-10-15 16:44:01.476190",
   "status":"failed",
   "uuid":"a7e76080-b371-369f-a93f-4a4969617ab6",
   "workspace":{
      "name":"demo-jaffle",
      "uid":"n0sg8br1m44k0ryj"
   }
}
```

### An example of a webhook payload for a started run:

```json
{
   "api_url":"https://api.paradime.io/api/v1/abc/graphql",
   "environment":{
      "actor":"Scheduler",
      "branch":null,
      "commit_hash":null,
      "email":null
   },
   "id":1234,
   "run_url":"https://app.paradime.io/bolt/run_id/1234",
   "schedule":{
      "commands":[
         "dbt seed",
         "dbt run"
      ],
      "deferred_schedule":null,
      "email_notify":[
         "max@acme.io",
         "fabio@acme.io"
      ],
      "email_on":[
         "passed",
         "failed"
      ],
      "environment":"production",
      "git_branch":null,
      "hightouch":null,
      "name":"daily_run",
      "owner_email":"fabio@paradime.io",
      "schedule":"@daily",
      "slack_notify":[
         "data-alerts"
      ],
      "slack_on":[
         "passed",
         "failed"
      ],
      "turbo_ci":null
   },
   "schedule_name":"daily_run",
   "start_dttm":"2023-10-15 16:44:01.476190",
   "status":"failed",
   "uuid":"a7e76080-b371-369f-a93f-4a4969617ab6",
   "workspace":{
      "name":"demo-jaffle",
      "uid":"n0sg8br1m44k0ryj"
   }
}
```

## Webhook Payload Transformations

Payload transformations let you filter or modify webhook events **before they are delivered**. The transformation runs inside Paradime — if you cancel the event, no request is sent to your destination.

***

### When to use transformations

Use a transformation to suppress webhook deliveries you don't need to act on. Two common cases:

| Case                                            | Why skip it                                  |
| ----------------------------------------------- | -------------------------------------------- |
| `bolt.run.completed` with `status: "passed"`    | Only failures need alerting                  |
| Turbo CI runs (`schedule.turbo_ci` is non-null) | CI jobs are not production schedule failures |

***

### Example: Skip passed runs and Turbo CI

The handler below cancels delivery for both categories above.

```javascript
function handler(webhook) {
  var payload = webhook.payload;

  // Skip passed runs — only failed runs need alerting
  if (payload.status === "passed") {
    webhook.cancel = true;
    return webhook;
  }

  // Skip Turbo CI jobs — these are CI runs, not production schedule failures
  if (payload.schedule && payload.schedule.turbo_ci !== null) {
    webhook.cancel = true;
    return webhook;
  }

  return webhook;
}
```

Setting `webhook.cancel = true` stops delivery entirely. The event is dropped — no HTTP request is made to your endpoint.

***

### How to apply a transformation

1. Go to **Webhooks** and click the webhook you want to configure.
2. Open the **Advanced** tab.
3. Toggle **Enable transformation** on.
4. Click **Edit transformation** and paste your handler function.
5. Save.

> **Tip:** Changes take effect immediately on the next event. Test with a manual run before relying on it in production.

{% @arcade/embed url="<https://app.arcade.software/share/7YL6KA5OSV6ON7xmhXjQ>" flowId="7YL6KA5OSV6ON7xmhXjQ" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.paradime.io/app-help/developers/webhooks/getting-started.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
